XPRBsos
| 
     XPRBsos
     | |||||
| 
     Synopsis
     | 
     XPRBsos();
      XPRBsos(xbsos *s); XPRBsos(xbsos *s, XPRBexpr& l); | ||||
| 
     Arguments
     | 
 | ||||
| 
     Description
     | 
     Create a new SOS object.
     | ||||
|  | |||||
| 
     add
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     int add(const XPRBexpr& le);
     | ||||||||||||||||||||||||
| 
     Argument
     | 
 | ||||||||||||||||||||||||
| 
     Return value
     | 
      0 if method executed successfully, 1 otherwise.
      | ||||||||||||||||||||||||
| 
     Description
     | |||||||||||||||||||||||||
| 
     Example
     | 
      This example shows different ways of defining SOS and modifying their contents. The resulting SOS definitions (as obtained with
      XPRBsos.print) and the output printed by the program are displayed as comments.
       XPRBvar x,y,z;
XPRBsos SO1, SO2;
XPRBprob prob("myprob");
x = prob.newVar("x", XPRB_PL, 0, 200);
y = prob.newVar("y", XPRB_PL, 0, 200);
z = prob.newVar("z", XPRB_PL, 0, 200);
SO1 = prob.newSos("SO1", XPRB_S1);
SO1.add(x+2*y+3*z);       // SO1(1): x(+1) y(+2) z(+3)
SO1 += 2*z-x;             // SO1(1): y(+2) z(+5)
cout << SO1.getName() << " type: ";
cout << (SO1.getType()==XPRB_S1?1:2) << endl;
                          // SO1 type: 1
SO2 = prob.newSos("SO2", XPRB_S2, 10*x+20*y);
SO2.addElement(z, 5);     // SO2(2): x(+10) y(+20) z(+5)
SO2.delElement(x);        // SO2(2): y(+20) z(+5)  | ||||||||||||||||||||||||
| 
     addElement
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     int addElement(XPRBvar& var, double val);
      int addElement(double val, XPRBvar& var); | ||||||||||||||||||||||||
| 
     Arguments
     | 
 | ||||||||||||||||||||||||
| 
     Return value
     | 
      0 if function executed successfully, 1 otherwise
      | ||||||||||||||||||||||||
| 
     Description
     | |||||||||||||||||||||||||
| 
     Example
     | 
      See
      XPRBsos.add.
       | ||||||||||||||||||||||||
| 
     Related topics
     | 
      Calls
     XPRBaddsosel
      | ||||||||||||||||||||||||
| 
     delElement
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     int delElement(XPRBvar& var);
     | ||||||||||||||||||||||||
| 
     Argument
     | 
 | ||||||||||||||||||||||||
| 
     Return value
     | 
      0 if method executed successfully, 1 otherwise.
      | ||||||||||||||||||||||||
| 
     Description
     | |||||||||||||||||||||||||
| 
     Example
     | 
      See
      XPRBsos.add.
       | ||||||||||||||||||||||||
| 
     Related topics
     | 
      Calls
     XPRBdelsosel
      | ||||||||||||||||||||||||
| 
     getCRef
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     xbsos *getCRef();
     | ||||||||||||||||||||||||
| 
     Return value
     | 
      The underlying modeling object in BCL C.
      | ||||||||||||||||||||||||
| 
     Description
     | 
     This method returns the SOS object in BCL C that belongs to the C++ SOS object.
     | ||||||||||||||||||||||||
| 
     getName
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     const char *getName();
     | ||||||||||||||||||||||||
| 
     Return value
     | 
      Name of the SOS if executed successfully,
      NULL otherwise.
      | ||||||||||||||||||||||||
| 
     Description
     | |||||||||||||||||||||||||
| 
     Example
     | 
      See
      XPRBsos.add.
       | ||||||||||||||||||||||||
| 
     Related topics
     | 
      Calls
     XPRBgetsosname
      | ||||||||||||||||||||||||
| 
     getType
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     int getType();
     | ||||||||||||||||||||||||
| 
     Return value
     | |||||||||||||||||||||||||
| 
     Description
     | |||||||||||||||||||||||||
| 
     Example
     | 
      See
      XPRBsos.add.
       | ||||||||||||||||||||||||
| 
     Related topics
     | 
      Calls
     XPRBgetsostype
      | ||||||||||||||||||||||||
| 
     isValid
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     bool isValid();
     | ||||||||||||||||||||||||
| 
     Return value
     | 
      true if object is valid,
      false otherwise.
      | ||||||||||||||||||||||||
| 
     Description
     | 
     This method checks whether the SOS object is correctly defined. It should always be used to test the result returned by
     XPRBprob.getSosByName.
     | ||||||||||||||||||||||||
| 
     Example
     | |||||||||||||||||||||||||
| 
     print
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     int print();
     | ||||||||||||||||||||||||
| 
     Return value
     | 
      0 if function executed successfully, 1 otherwise.
      | ||||||||||||||||||||||||
| 
     Description
     | |||||||||||||||||||||||||
| 
     Example
     | |||||||||||||||||||||||||
| 
     Related topics
     | 
      Calls
     XPRBprintsos
      | ||||||||||||||||||||||||
| 
     setDir
     | |||||||||||||||||||||||||
| 
     Synopsis
     | 
     int setDir(int type, double val);
      int setDir(int type); | ||||||||||||||||||||||||
| 
     Arguments
     | 
 | ||||||||||||||||||||||||
| 
     Return value
     | 
      0 if method executed successfully, 1 otherwise.
      | ||||||||||||||||||||||||
| 
     Description
     | 
     
     
     
     This method sets any type of branching directive available in Xpress. This may be a priority for branching on a SOS (type
     XPRB_PR), the preferred branching direction (types
     XPRB_UP,
     XPRB_DN) or the estimated cost incurred when branching on a SOS (types
     XPRB_PU,
     XPRB_PD). Several directives of different types may be set for a single set. Method
     XPRBvar.setDir may be used to set a directive for a variable.
     | ||||||||||||||||||||||||
| 
     Example
     | 
      See
      XPRBprob.clearDir.
       | ||||||||||||||||||||||||
| 
     Related topics
     | 
      Calls
     XPRBsetsosdir
      | ||||||||||||||||||||||||
|  | |||||||||||||||||||||||||
© 2001-2023 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
 
