XPRBsol
| 
     XPRBsol
     | |||
| 
     Synopsis
     | 
     XPRBsol();
      XPRBsos(xbsol *s); | ||
| 
     Argument
     | 
 | ||
| 
     Description
     | 
     Create a new solution object.
     | ||
|  | |||
| 
     delVar
     | |||||||
| 
     Synopsis
     | 
     int delVar(XPRBvar& var);
     | ||||||
| 
     Argument
     | 
 | ||||||
| 
     Return value
     | 
      0 if method executed successfully, 1 otherwise.
      | ||||||
| 
     Description
     | |||||||
| 
     Example
     | 
      See
      XPRBsol.setVar.
       | ||||||
| 
     Related topics
     | 
      Calls
     XPRBdelsolvar
      | ||||||
| 
     getSize
     | |||||||
| 
     Synopsis
     | 
     int getSize();
     | ||||||
| 
     Return value
     | 
      Size (= number of variables assigned to a value) of the solution, or -1 in case of an error.
      | ||||||
| 
     Description
     | |||||||
| 
     Example
     | 
      See
      XPRBsol.setVar.
       | ||||||
| 
     Related topics
     | 
      Calls
     XPRBgetsolsize
      | ||||||
| 
     getVar
     | |||||||
| 
     Synopsis
     | 
     int getVar(XPRBvar& var, double *val);
     | ||||||
| 
     Arguments
     | 
 | ||||||
| 
     Return value
     | 
 | ||||||
| 
     Description
     | |||||||
| 
     Example
     | 
      See
      XPRBsol.setVar.
       | ||||||
| 
     Related topics
     | 
      Calls
     XPRBgetsolvar
      | ||||||
| 
     isValid
     | |||||||
| 
     Synopsis
     | 
     bool isValid();
     | ||||||
| 
     Return value
     | 
      true if object is valid,
      false otherwise.
      | ||||||
| 
     Description
     | |||||||
| 
     print
     | |||||||
| 
     Synopsis
     | 
     int print();
     | ||||||
| 
     Return value
     | 
      0 if function executed successfully, 1 otherwise.
      | ||||||
| 
     Description
     | 
     
     This method prints out a solution (note that
     XPRBsol solutions represent user-defined solutions to be passed to the Optimizer, not solutions coming from the Optimizer). A solution is printed as a sequence like "
     varname =
     value, ... ". If the solution doesn't contain any variable, only an empty line is printed.
     | ||||||
| 
     Example
     | 
      See
      XPRBsol.setVar.
       | ||||||
| 
     Related topics
     | 
      Calls
     XPRBprintsol
      | ||||||
| 
     reset
     | |||||||
| 
     Synopsis
     | 
     void reset();
     | ||||||
| 
     Description
     | |||||||
| 
     Example
     | 
      See
      XPRBsol.setVar.
       | ||||||
| 
     Related topics
     | 
      Calls
     XPRBdelsol
      | ||||||
| 
     setVar
     | |||||||
| 
     Synopsis
     | 
     int setVar(XPRBvar& var, double val);
     | ||||||
| 
     Arguments
     | 
 | ||||||
| 
     Return value
     | 
      0 if method executed successfully, 1 otherwise.
      | ||||||
| 
     Description
     | |||||||
| 
     Example
     | 
      This example sets variable x and y in solution
      sol1 and then changes them.
       XPRBvar x, y;
XPRBsol sol1;
XPRBprob prob("myprob");
double d;
x = prob.newVar("x", XPRB_PL, 0, 200);
y = prob.newVar("y", XPRB_PL, 0, 200);
sol1 = prob.newSol();
sol1.setVar(x, 7.0);
sol1.setVar(y, 15.0);
cout << "Sol1: ";
sol1.print();                         // Sol1: x = 7, y = 15
sol1.setVar(x, 10.0);
sol1.getVar(x, &d);
cout << "In sol1, x = " << d << endl; // In sol1, x = 10
sol1.delVar(y);
cout << "Sol1: ";
sol1.print();                         // Sol1: x = 10
sol1.reset(); | ||||||
| 
     Related topics
     | 
      Calls
     XPRBsetsolvar
      | ||||||
|  | |||||||
© 2001-2021 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.
 
