#include <OsiClpSolverInterface.hpp>
Inheritance diagram for OsiClpSolverInterface:
Protected methods | |
const double * | upRange () const |
If doing fast hot start then ranges are computed. | |
const double * | downRange () const |
If doing fast hot start then ranges are computed. | |
void | passInRanges (int *array) |
Pass in range array. | |
void | gutsOfDestructor () |
The real work of a copy constructor (used by copy and assignment). | |
void | freeCachedResults () const |
Deletes all mutable stuff. | |
void | extractSenseRhsRange () const |
A method that fills up the rowsense_, rhs_ and rowrange_ arrays. | |
void | fillParamMaps () |
If doing fast hot start then ranges are computed. | |
CoinWarmStartBasis | getBasis (ClpSimplex *model) const |
Warm start. | |
void | setBasis (const CoinWarmStartBasis &basis, ClpSimplex *model) |
Sets up working basis as a copy of input. | |
void | crunch () |
Crunch down problem a bit. | |
Public Member Functions | |
virtual void | setObjSense (double s) |
Set objective function sense (1 for min (default), -1 for max,). | |
virtual void | setColSolution (const double *colsol) |
Set the primal solution column values. | |
virtual void | setRowPrice (const double *rowprice) |
Set dual solution vector. | |
Solve methods | |
virtual void | initialSolve () |
Solve initial LP relaxation. | |
virtual void | resolve () |
Resolve an LP relaxation after problem modification. | |
virtual void | branchAndBound () |
Invoke solver's built-in enumeration algorithm. | |
OsiSimplexInterface methods | |
virtual void | enableSimplexInterface (bool doingPrimal) |
Enables normal operation of subsequent functions. | |
virtual void | disableSimplexInterface () |
Undo whatever setting changes the above method had to make. | |
virtual int | canDoSimplexInterface () const |
Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none. | |
virtual void | enableFactorization () const |
Tells solver that calls to getBInv etc are about to take place. | |
virtual void | disableFactorization () const |
and stop | |
void | setupForRepeatedUse (int senseOfAdventure=0, int printOut=0) |
Sets up solver for repeated use by Osi interface. | |
virtual void | synchronizeModel () |
Synchronize model (really if no cuts in tree). | |
void | setSpecialOptionsMutable (unsigned int value) const |
Enables normal operation of subsequent functions. | |
virtual bool | basisIsAvailable () const |
Returns true if a basis is available AND problem is optimal. | |
virtual void | getBasisStatus (int *cstat, int *rstat) const |
The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasis if: 1. | |
virtual int | setBasisStatus (const int *cstat, const int *rstat) |
Set the status of structural/artificial variables and factorize, update solution etc. | |
virtual int | pivot (int colIn, int colOut, int outStatus) |
Perform a pivot by substituting a colIn for colOut in the basis. | |
virtual int | primalPivotResult (int colIn, int sign, int &colOut, int &outStatus, double &t, CoinPackedVector *dx) |
Obtain a result of the primal pivot Outputs: colOut -- leaving column, outStatus -- its status, t -- step size, and, if dx!=NULL, *dx -- primal ray direction. | |
virtual int | dualPivotResult (int &colIn, int &sign, int colOut, int outStatus, double &t, CoinPackedVector *dx) |
Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and a sign of its change are now the outputs, the leaving variable and its statuts -- the inputs If dx!=NULL, then *dx contains dual ray Return code: same. | |
virtual void | getReducedGradient (double *columnReducedCosts, double *duals, const double *c) |
Get the reduced gradient for the cost vector c. | |
virtual void | setObjectiveAndRefresh (double *c) |
Set a new objective and apply the old basis so that the reduced costs are properly updated. | |
virtual void | getBInvARow (int row, double *z, double *slack=NULL) const |
Get a row of the tableau (slack part in slack if not NULL). | |
virtual void | getBInvRow (int row, double *z) const |
Get a row of the basis inverse. | |
virtual void | getBInvACol (int col, double *vec) const |
Get a column of the tableau. | |
virtual void | getBInvCol (int col, double *vec) const |
Get a column of the basis inverse. | |
virtual void | getBasics (int *index) const |
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()). | |
Parameter set/get methods | |
The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the clp algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver.
The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false. | |
bool | setIntParam (OsiIntParam key, int value) |
bool | setDblParam (OsiDblParam key, double value) |
bool | setStrParam (OsiStrParam key, const std::string &value) |
bool | getIntParam (OsiIntParam key, int &value) const |
bool | getDblParam (OsiDblParam key, double &value) const |
bool | getStrParam (OsiStrParam key, std::string &value) const |
virtual bool | setHintParam (OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL) |
Methods returning info on how the solution process terminated | |
virtual bool | isAbandoned () const |
Are there a numerical difficulties? | |
virtual bool | isProvenOptimal () const |
Is optimality proven? | |
virtual bool | isProvenPrimalInfeasible () const |
Is primal infeasiblity proven? | |
virtual bool | isProvenDualInfeasible () const |
Is dual infeasiblity proven? | |
virtual bool | isPrimalObjectiveLimitReached () const |
Is the given primal objective limit reached? | |
virtual bool | isDualObjectiveLimitReached () const |
Is the given dual objective limit reached? | |
virtual bool | isIterationLimitReached () const |
Iteration limit reached? | |
WarmStart related methods | |
virtual CoinWarmStart * | getEmptyWarmStart () const |
Get an empty warm start object. | |
virtual CoinWarmStart * | getWarmStart () const |
Get warmstarting information. | |
virtual bool | setWarmStart (const CoinWarmStart *warmstart) |
Set warmstarting information. | |
Hotstart related methods (primarily used in strong branching). <br> | |
The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there. NOTE: between hotstarted optimizations only bound changes are allowed. | |
virtual void | markHotStart () |
Create a hotstart point of the optimization process. | |
virtual void | solveFromHotStart () |
Optimize starting from the hotstart. | |
virtual void | unmarkHotStart () |
Delete the snapshot. | |
Methods related to querying the input data | |
virtual int | getNumCols () const |
Get number of columns. | |
virtual int | getNumRows () const |
Get number of rows. | |
virtual int | getNumElements () const |
Get number of nonzero elements. | |
virtual std::string | getRowName (int rowIndex) const |
Return name of row if one exists or Rnnnnnnn. | |
virtual std::string | getColName (int colIndex) const |
Return name of column if one exists or Cnnnnnnn. | |
virtual const double * | getColLower () const |
Get pointer to array[getNumCols()] of column lower bounds. | |
virtual const double * | getColUpper () const |
Get pointer to array[getNumCols()] of column upper bounds. | |
virtual const char * | getRowSense () const |
Get pointer to array[getNumRows()] of row constraint senses. | |
virtual const double * | getRightHandSide () const |
Get pointer to array[getNumRows()] of rows right-hand sides. | |
virtual const double * | getRowRange () const |
Get pointer to array[getNumRows()] of row ranges. | |
virtual const double * | getRowLower () const |
Get pointer to array[getNumRows()] of row lower bounds. | |
virtual const double * | getRowUpper () const |
Get pointer to array[getNumRows()] of row upper bounds. | |
virtual const double * | getObjCoefficients () const |
Get pointer to array[getNumCols()] of objective function coefficients. | |
virtual double | getObjSense () const |
Get objective function sense (1 for min (default), -1 for max). | |
virtual bool | isContinuous (int colNumber) const |
Return true if column is continuous. | |
virtual const CoinPackedMatrix * | getMatrixByRow () const |
Get pointer to row-wise copy of matrix. | |
virtual const CoinPackedMatrix * | getMatrixByCol () const |
Get pointer to column-wise copy of matrix. | |
virtual double | getInfinity () const |
Get solver's value for infinity. | |
Methods related to querying the solution | |
virtual const double * | getColSolution () const |
Get pointer to array[getNumCols()] of primal solution vector. | |
virtual const double * | getRowPrice () const |
Get pointer to array[getNumRows()] of dual prices. | |
virtual const double * | getReducedCost () const |
Get a pointer to array[getNumCols()] of reduced costs. | |
virtual const double * | getRowActivity () const |
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector. | |
virtual double | getObjValue () const |
Get objective function value. | |
virtual int | getIterationCount () const |
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver. | |
virtual std::vector< double * > | getDualRays (int maxNumRays) const |
Get as many dual rays as the solver can provide. | |
virtual std::vector< double * > | getPrimalRays (int maxNumRays) const |
Get as many primal rays as the solver can provide. | |
Changing bounds on variables and constraints | |
virtual void | setObjCoeff (int elementIndex, double elementValue) |
Set an objective function coefficient. | |
virtual void | setColLower (int elementIndex, double elementValue) |
Set a single column lower bound Use -DBL_MAX for -infinity. | |
virtual void | setColUpper (int elementIndex, double elementValue) |
Set a single column upper bound Use DBL_MAX for infinity. | |
virtual void | setColBounds (int elementIndex, double lower, double upper) |
Set a single column lower and upper bound. | |
virtual void | setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundList) |
Set the bounds on a number of columns simultaneously The default implementation just invokes setColLower() and setColUpper() over and over again. | |
virtual void | setRowLower (int elementIndex, double elementValue) |
Set a single row lower bound Use -DBL_MAX for -infinity. | |
virtual void | setRowUpper (int elementIndex, double elementValue) |
Set a single row upper bound Use DBL_MAX for infinity. | |
virtual void | setRowBounds (int elementIndex, double lower, double upper) |
Set a single row lower and upper bound. | |
virtual void | setRowType (int index, char sense, double rightHandSide, double range) |
Set the type of a single row . | |
virtual void | setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundList) |
Set the bounds on a number of rows simultaneously The default implementation just invokes setRowLower() and setRowUpper() over and over again. | |
virtual void | setRowSetTypes (const int *indexFirst, const int *indexLast, const char *senseList, const double *rhsList, const double *rangeList) |
Set the type of a number of rows simultaneously The default implementation just invokes setRowType() over and over again. | |
virtual void | setObjective (const double *array) |
Set the objective coefficients for all columns array [getNumCols()] is an array of values for the objective. | |
virtual void | setColLower (const double *array) |
Set the lower bounds for all columns array [getNumCols()] is an array of values for the objective. | |
virtual void | setColUpper (const double *array) |
Set the upper bounds for all columns array [getNumCols()] is an array of values for the objective. | |
virtual void | setRowName (int rowIndex, std::string &name) |
Set name of row. | |
virtual void | setColName (int colIndex, std::string &name) |
Set name of column. | |
Integrality related changing methods | |
virtual void | setContinuous (int index) |
Set the index-th variable to be a continuous variable. | |
virtual void | setInteger (int index) |
Set the index-th variable to be an integer variable. | |
virtual void | setContinuous (const int *indices, int len) |
Set the variables listed in indices (which is of length len) to be continuous variables. | |
virtual void | setInteger (const int *indices, int len) |
Set the variables listed in indices (which is of length len) to be integer variables. | |
Methods to expand a problem.<br> | |
Note that if a column is added then by default it will correspond to a continuous variable. | |
virtual void | addCol (const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj) |
Add a column (primal variable) to the problem. | |
virtual void | addCol (int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj) |
Add a column (primal variable) to the problem. | |
virtual void | addCols (const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj) |
Add a set of columns (primal variables) to the problem. | |
virtual void | deleteCols (const int num, const int *colIndices) |
Remove a set of columns (primal variables) from the problem. | |
virtual void | addRow (const CoinPackedVectorBase &vec, const double rowlb, const double rowub) |
Add a row (constraint) to the problem. | |
virtual void | addRow (const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng) |
Add a column (primal variable) to the problem. | |
virtual void | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub) |
Add a set of rows (constraints) to the problem. | |
virtual void | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng) |
Add a set of rows (constraints) to the problem. | |
void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false) |
virtual void | deleteRows (const int num, const int *rowIndices) |
Delete a set of rows (constraints) from the problem. | |
virtual void | applyRowCuts (int numberCuts, const OsiRowCut *cuts) |
Apply a collection of row cuts which are all effective. | |
virtual void | applyRowCuts (int numberCuts, const OsiRowCut **cuts) |
Apply a collection of row cuts which are all effective. | |
Methods to input a problem | |
virtual void | loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub) |
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). | |
virtual void | assignProblem (CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub) |
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds). | |
virtual void | loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng) |
Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). | |
virtual void | assignProblem (CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng) |
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets). | |
virtual void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub) |
Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). | |
virtual void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng) |
Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps). | |
virtual int | loadFromCoinModel (CoinModel &modelObject, bool keepSolution=false) |
This loads a model from a coinModel object - returns number of errors. | |
virtual int | readMps (const char *filename, const char *extension="mps") |
Read an mps file from the given filename (defaults to Osi reader) - returns number of errors (see OsiMpsReader class). | |
virtual void | writeMps (const char *filename, const char *extension="mps", double objSense=0.0) const |
Write the problem into an mps file of the given filename. | |
virtual int | writeMpsNative (const char *filename, const char **rowNames, const char **columnNames, int formatType=0, int numberAcross=2, double objSense=0.0) const |
Write the problem into an mps file of the given filename, names may be null. | |
virtual int | readLp (const char *filename, const double epsilon=1e-5) |
Read file in LP format (with names). | |
virtual void | writeLp (const char *filename, const char *extension="lp", const double epsilon=1e-5, const int numberAcross=10, const int decimals=5, const double objSense=0.0, const bool useRowNames=true) const |
Write the problem into an Lp file of the given filename. | |
virtual void | writeLp (FILE *fp, const double epsilon=1e-5, const int numberAcross=10, const int decimals=5, const double objSense=0.0, const bool useRowNames=true) const |
Write the problem into the file pointed to by the parameter fp. | |
virtual void | replaceMatrixOptional (const CoinPackedMatrix &matrix) |
I (JJF) am getting annoyed because I can't just replace a matrix. | |
virtual void | replaceMatrix (const CoinPackedMatrix &matrix) |
And if it does matter (not used at present). | |
Message handling (extra for Clp messages). | |
Normally I presume you would want the same language.
If not then you could use underlying model pointer | |
void | newLanguage (CoinMessages::Language language) |
Set language. | |
void | setLanguage (CoinMessages::Language language) |
Set language. | |
void | generateCpp (FILE *fp) |
Create C++ lines to get to current state. | |
Clp specific public interfaces | |
ClpSimplex * | getModelPtr () const |
Get pointer to Clp model. | |
unsigned int | specialOptions () const |
Get special options. | |
void | setSpecialOptions (unsigned int value) |
Get pointer to Clp model. | |
int | cleanupScaling () const |
Get scaling action option. | |
void | setCleanupScaling (int value) |
Set Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled is not. | |
double | smallestElementInCut () const |
Get smallest allowed element in cut. | |
void | setSmallestElementInCut (double value) |
Set smallest allowed element in cut. | |
double | smallestChangeInCut () const |
Get smallest change in cut. | |
void | setSmallestChangeInCut (double value) |
Set smallest change in cut. | |
Constructors and destructors | |
OsiClpSolverInterface () | |
Default Constructor. | |
virtual OsiSolverInterface * | clone (bool copyData=true) const |
Clone. | |
OsiClpSolverInterface (const OsiClpSolverInterface &) | |
Copy constructor. | |
OsiClpSolverInterface (ClpSimplex *rhs, bool reallyOwn=false) | |
Borrow constructor - only delete one copy. | |
void | releaseClp () |
Releases so won't error. | |
OsiClpSolverInterface & | operator= (const OsiClpSolverInterface &rhs) |
Assignment operator. | |
virtual | ~OsiClpSolverInterface () |
Destructor. | |
virtual void | reset () |
Resets as if default constructor. | |
Protected Member Functions | |
Protected methods | |
virtual void | applyRowCut (const OsiRowCut &rc) |
Apply a row cut (append to constraint matrix). | |
virtual void | applyColCut (const OsiColCut &cc) |
Apply a column cut (adjust one or more bounds). | |
Protected Attributes | |
Protected member data | |
ClpSimplex * | modelPtr_ |
Clp model represented by this class instance. | |
double * | linearObjective_ |
Linear objective - just points to ClpModel. | |
Cached information derived from the OSL model | |
char * | rowsense_ |
Pointer to dense vector of row sense indicators. | |
double * | rhs_ |
Pointer to dense vector of row right-hand side values. | |
double * | rowrange_ |
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows). | |
CoinWarmStartBasis * | ws_ |
A pointer to the warmstart information to be used in the hotstarts. | |
double * | rowActivity_ |
also save row and column information for hot starts only used in hotstarts so can be casual | |
double * | columnActivity_ |
Pointer to dense vector of row sense indicators. | |
ClpSimplex * | smallModel_ |
Alternate model (hot starts). | |
ClpFactorization * | factorization_ |
factorization for hot starts | |
double | smallestElementInCut_ |
Smallest allowed element in cut. | |
double | smallestChangeInCut_ |
Smallest change in cut. | |
char * | spareArrays_ |
Arrays for hot starts. | |
CoinWarmStartBasis | basis_ |
Warmstart information to be used in resolves. | |
int | itlimOrig_ |
The original iteration limit before hotstarts started. | |
int | lastAlgorithm_ |
Last algorithm used. | |
bool | notOwned_ |
To say if destructor should delete underlying model. | |
CoinPackedMatrix * | matrixByRow_ |
Pointer to row-wise copy of problem matrix coefficients. | |
char * | integerInformation_ |
Pointer to integer information. | |
int * | whichRange_ |
Pointer to variables for which we want range information The number is in [0] memory is not owned by OsiClp. | |
ClpDataSave | saveData_ |
To save data in OsiSimplex stuff. | |
int | cleanupScaling_ |
Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled is not. | |
unsigned int | specialOptions_ |
Special options 0x80000000 off 0 simple stuff for branch and bound 1 try and keep work regions as much as possible 2 do not use any perturbation 4 allow exit before re-factorization 8 try and re-use factorization if no cuts 16 use standard strong branching rather than clp's 32 Just go to first factorization in fast dual 64 try and tighten bounds in crunch 128 Model will only change in column bounds 256 Clean up model before hot start 512 Give user direct access to Clp regions in getBInvARow etc Bits above 8192 give where called from in Cbc At present 0 is normal, 1 doing fast hotstarts, 2 is can do quick check. | |
Friends | |
void | OsiClpSolverInterfaceUnitTest (const std::string &mpsDir, const std::string &netlibDir) |
A function that tests the methods in the OsiClpSolverInterface class. |
Instantiation of OsiClpSolverInterface for the Model Algorithm.
Definition at line 32 of file OsiClpSolverInterface.hpp.
|
Default Constructor.
|
|
Copy constructor.
|
|
Borrow constructor - only delete one copy.
|
|
Destructor.
|
|
Solve initial LP relaxation.
Implements OsiSolverInterface. |
|
Resolve an LP relaxation after problem modification.
Implements OsiSolverInterface. |
|
Invoke solver's built-in enumeration algorithm.
Implements OsiSolverInterface. |
|
Enables normal operation of subsequent functions. This method is supposed to ensure that all typical things (like reduced costs, etc.) are updated when individual pivots are executed and can be queried by other methods Reimplemented from OsiSolverInterface. |
|
Undo whatever setting changes the above method had to make.
Reimplemented from OsiSolverInterface. |
|
Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none.
Reimplemented from OsiSolverInterface. |
|
Tells solver that calls to getBInv etc are about to take place. Underlying code may need mutable as this may be called from CglCut:;generateCuts which is const. If that is too horrific then each solver e.g. BCP or CBC will have to do something outside main loop. Reimplemented from OsiSolverInterface. |
|
and stop
Reimplemented from OsiSolverInterface. |
|
Sets up solver for repeated use by Osi interface. The normal usage does things like keeping factorization around so can be used. Will also do things like keep scaling and row copy of matrix if matrix does not change. adventure: 0 - safe stuff as above 1 - will take more risks - if it does not work then bug which will be fixed 2 - don't bother doing most extreme termination checks e.g. don't bother re-factorizing if less than 20 iterations. 3 - Actually safer than 1 (mainly just keeps factorization) printOut - -1 always skip round common messages instead of doing some work 0 skip if normal defaults 1 leaves |
|
Synchronize model (really if no cuts in tree).
|
|
Enables normal operation of subsequent functions. This method is supposed to ensure that all typical things (like reduced costs, etc.) are updated when individual pivots are executed and can be queried by other methods |
|
Returns true if a basis is available AND problem is optimal. This should be used to see if the BInvARow type operations are possible and meaningful. Reimplemented from OsiSolverInterface. |
|
The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasis if: 1. OsiWarmStartBasis resize operation is implemented more efficiently and 2. It is ensured that effects on the solver are the same Returns a basis status of the structural/artificial variables At present as warm start i.e 0 free, 1 basic, 2 upper, 3 lower NOTE artificials are treated as +1 elements so for <= rhs artificial will be at lower bound if constraint is tight This means that Clpsimplex flips artificials as it works in terms of row activities Reimplemented from OsiSolverInterface. |
|
Set the status of structural/artificial variables and factorize, update solution etc. NOTE artificials are treated as +1 elements so for <= rhs artificial will be at lower bound if constraint is tight This means that Clpsimplex flips artificials as it works in terms of row activities Reimplemented from OsiSolverInterface. |
|
Perform a pivot by substituting a colIn for colOut in the basis. The status of the leaving variable is given in statOut. Where 1 is to upper bound, -1 to lower bound Return code is 0 for okay, 1 if inaccuracy forced re-factorization (should be okay) and -1 for singular factorization Reimplemented from OsiSolverInterface. |
|
Obtain a result of the primal pivot Outputs: colOut -- leaving column, outStatus -- its status, t -- step size, and, if dx!=NULL, *dx -- primal ray direction. Inputs: colIn -- entering column, sign -- direction of its change (+/-1). Both for colIn and colOut, artificial variables are index by the negative of the row index minus 1. Return code (for now): 0 -- leaving variable found, -1 -- everything else? Clearly, more informative set of return values is required Primal and dual solutions are updated Reimplemented from OsiSolverInterface. |
|
Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and a sign of its change are now the outputs, the leaving variable and its statuts -- the inputs If dx!=NULL, then *dx contains dual ray Return code: same.
Reimplemented from OsiSolverInterface. |
|
Get the reduced gradient for the cost vector c.
Reimplemented from OsiSolverInterface. |
|
Set a new objective and apply the old basis so that the reduced costs are properly updated.
Reimplemented from OsiSolverInterface. |
|
Get a row of the tableau (slack part in slack if not NULL).
Reimplemented from OsiSolverInterface. |
|
Get a row of the basis inverse.
Reimplemented from OsiSolverInterface. |
|
Get a column of the tableau.
Reimplemented from OsiSolverInterface. |
|
Get a column of the basis inverse.
Reimplemented from OsiSolverInterface. |
|
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()).
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Reimplemented from OsiSolverInterface. |
|
Are there a numerical difficulties?
Implements OsiSolverInterface. |
|
Is optimality proven?
Implements OsiSolverInterface. |
|
Is primal infeasiblity proven?
Implements OsiSolverInterface. |
|
Is dual infeasiblity proven?
Implements OsiSolverInterface. |
|
Is the given primal objective limit reached?
Implements OsiSolverInterface. |
|
Is the given dual objective limit reached?
Implements OsiSolverInterface. |
|
Iteration limit reached?
Implements OsiSolverInterface. |
|
Get an empty warm start object. This routine returns an empty CoinWarmStartBasis object. Its purpose is to provide a way to give a client a warm start basis object of the appropriate type, which can resized and modified as desired. Implements OsiSolverInterface. |
|
Get warmstarting information.
Implements OsiSolverInterface. |
|
Set warmstarting information. Return true/false depending on whether the warmstart information was accepted or not. Implements OsiSolverInterface. |
|
Create a hotstart point of the optimization process.
Reimplemented from OsiSolverInterface. |
|
Optimize starting from the hotstart.
Reimplemented from OsiSolverInterface. |
|
Delete the snapshot.
Reimplemented from OsiSolverInterface. |
|
Get number of columns.
Implements OsiSolverInterface. Definition at line 297 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get number of rows.
Implements OsiSolverInterface. Definition at line 301 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get number of nonzero elements.
Implements OsiSolverInterface. Definition at line 305 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Return name of row if one exists or Rnnnnnnn.
|
|
Return name of column if one exists or Cnnnnnnn.
|
|
Get pointer to array[getNumCols()] of column lower bounds.
Implements OsiSolverInterface. Definition at line 319 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get pointer to array[getNumCols()] of column upper bounds.
Implements OsiSolverInterface. Definition at line 322 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get pointer to array[getNumRows()] of row constraint senses.
Implements OsiSolverInterface. |
|
Get pointer to array[getNumRows()] of rows right-hand sides.
Implements OsiSolverInterface. |
|
Get pointer to array[getNumRows()] of row ranges.
Implements OsiSolverInterface. |
|
Get pointer to array[getNumRows()] of row lower bounds.
Implements OsiSolverInterface. Definition at line 356 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get pointer to array[getNumRows()] of row upper bounds.
Implements OsiSolverInterface. Definition at line 359 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get pointer to array[getNumCols()] of objective function coefficients.
Implements OsiSolverInterface. Definition at line 362 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get objective function sense (1 for min (default), -1 for max).
Implements OsiSolverInterface. Definition at line 366 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Return true if column is continuous.
Implements OsiSolverInterface. |
|
Get pointer to row-wise copy of matrix.
Implements OsiSolverInterface. |
|
Get pointer to column-wise copy of matrix.
Implements OsiSolverInterface. |
|
Get solver's value for infinity.
Implements OsiSolverInterface. Definition at line 380 of file OsiClpSolverInterface.hpp. |
|
Get pointer to array[getNumCols()] of primal solution vector.
Implements OsiSolverInterface. |
|
Get pointer to array[getNumRows()] of dual prices.
Implements OsiSolverInterface. |
|
Get a pointer to array[getNumCols()] of reduced costs.
Implements OsiSolverInterface. |
|
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector.
Implements OsiSolverInterface. |
|
Get objective function value.
Implements OsiSolverInterface. |
|
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
Implements OsiSolverInterface. Definition at line 403 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Get as many dual rays as the solver can provide. (In case of proven primal infeasibility there should be at least one.)
NOTE for implementers of solver interfaces:
NOTE for users of solver interfaces: Implements OsiSolverInterface. |
|
Get as many primal rays as the solver can provide. (In case of proven dual infeasibility there should be at least one.)
NOTE for implementers of solver interfaces:
NOTE for users of solver interfaces: Implements OsiSolverInterface. |
|
Set an objective function coefficient.
Implements OsiSolverInterface. |
|
Set a single column lower bound
Implements OsiSolverInterface. |
|
Set a single column upper bound
Implements OsiSolverInterface. |
|
Set a single column lower and upper bound.
Reimplemented from OsiSolverInterface. |
|
Set the bounds on a number of columns simultaneously
Reimplemented from OsiSolverInterface. |
|
Set a single row lower bound
Implements OsiSolverInterface. |
|
Set a single row upper bound
Implements OsiSolverInterface. |
|
Set a single row lower and upper bound.
Reimplemented from OsiSolverInterface. |
|
Set the type of a single row
Implements OsiSolverInterface. |
|
Set the bounds on a number of rows simultaneously
Reimplemented from OsiSolverInterface. |
|
Set the type of a number of rows simultaneously
Reimplemented from OsiSolverInterface. |
|
Set the objective coefficients for all columns array [getNumCols()] is an array of values for the objective. This defaults to a series of set operations and is here for speed. Reimplemented from OsiSolverInterface. |
|
Set the lower bounds for all columns array [getNumCols()] is an array of values for the objective. This defaults to a series of set operations and is here for speed. Reimplemented from OsiSolverInterface. |
|
Set the upper bounds for all columns array [getNumCols()] is an array of values for the objective. This defaults to a series of set operations and is here for speed. Reimplemented from OsiSolverInterface. |
|
Set name of row.
|
|
Set name of column.
|
|
Set the index-th variable to be a continuous variable.
Implements OsiSolverInterface. |
|
Set the index-th variable to be an integer variable.
Implements OsiSolverInterface. |
|
Set the variables listed in indices (which is of length len) to be continuous variables.
Reimplemented from OsiSolverInterface. |
|
Set the variables listed in indices (which is of length len) to be integer variables.
Reimplemented from OsiSolverInterface. |
|
Set objective function sense (1 for min (default), -1 for max,).
Implements OsiSolverInterface. Definition at line 553 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Set the primal solution column values. colsol[numcols()] is an array of values of the problem column variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of colsol() until changed by another call to setColsol() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. Implements OsiSolverInterface. |
|
Set dual solution vector. rowprice[numrows()] is an array of values of the problem row dual variables. These values are copied to memory owned by the solver object or the solver. They will be returned as the result of rowprice() until changed by another call to setRowprice() or by a call to any solver routine. Whether the solver makes use of the solution in any way is solver-dependent. Implements OsiSolverInterface. |
|
Add a column (primal variable) to the problem.
Implements OsiSolverInterface. |
|
Add a column (primal variable) to the problem.
Reimplemented from OsiSolverInterface. |
|
Add a set of columns (primal variables) to the problem. The default implementation simply makes repeated calls to addCol(). Reimplemented from OsiSolverInterface. |
|
Remove a set of columns (primal variables) from the problem. The solver interface for a basis-oriented solver will maintain valid warm start information if all deleted variables are nonbasic. Implements OsiSolverInterface. |
|
Add a row (constraint) to the problem.
Implements OsiSolverInterface. |
|
Add a column (primal variable) to the problem.
Implements OsiSolverInterface. |
|
Add a set of rows (constraints) to the problem. The default implementation simply makes repeated calls to addRow(). Reimplemented from OsiSolverInterface. |
|
Add a set of rows (constraints) to the problem. The default implementation simply makes repeated calls to addRow(). Reimplemented from OsiSolverInterface. |
|
Definition at line 619 of file OsiClpSolverInterface.hpp. References modelPtr_. |
|
Delete a set of rows (constraints) from the problem. The solver interface for a basis-oriented solver will maintain valid warm start information if all deleted rows are loose. Implements OsiSolverInterface. |
|
Apply a collection of row cuts which are all effective. applyCuts seems to do one at a time which seems inefficient. Reimplemented from OsiSolverInterface. |
|
Apply a collection of row cuts which are all effective. applyCuts seems to do one at a time which seems inefficient. This uses array of pointers Reimplemented from OsiSolverInterface. |
|
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds). If a pointer is 0 then the following values are the default:
Implements OsiSolverInterface. |
|
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds).
For default values see the previous method. Implements OsiSolverInterface. |
|
Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets). If a pointer is 0 then the following values are the default:
Implements OsiSolverInterface. |
|
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets).
For default values see the previous method. Implements OsiSolverInterface. |
|
Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps).
Implements OsiSolverInterface. |
|
Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps).
Implements OsiSolverInterface. |
|
This loads a model from a coinModel object - returns number of errors.
Reimplemented from OsiSolverInterface. |
|
Read an mps file from the given filename (defaults to Osi reader) - returns number of errors (see OsiMpsReader class).
Reimplemented from OsiSolverInterface. |
|
Write the problem into an mps file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants Implements OsiSolverInterface. |
|
Write the problem into an mps file of the given filename, names may be null. formatType is 0 - normal 1 - extra accuracy 2 - IEEE hex (later) Returns non-zero on I/O error Reimplemented from OsiSolverInterface. |
|
Read file in LP format (with names).
Reimplemented from OsiSolverInterface. |
|
Write the problem into an Lp file of the given filename. If objSense is non zero then -1.0 forces the code to write a maximization objective and +1.0 to write a minimization one. If 0.0 then solver can do what it wants. This version calls writeLpNative with names Reimplemented from OsiSolverInterface. |
|
Write the problem into the file pointed to by the parameter fp. Other parameters are similar to those of writeLp() with first parameter filename. Reimplemented from OsiSolverInterface. |
|
I (JJF) am getting annoyed because I can't just replace a matrix. The default behavior of this is do nothing so only use where that would not matter e.g. strengthening a matrix for MIP Reimplemented from OsiSolverInterface. |
|
And if it does matter (not used at present).
Reimplemented from OsiSolverInterface. |
|
Set language.
Reimplemented from OsiSolverInterface. Referenced by setLanguage(). |
|
Set language.
Reimplemented from OsiSolverInterface. Definition at line 786 of file OsiClpSolverInterface.hpp. References newLanguage(). |
|
Create C++ lines to get to current state.
|
|
Get pointer to Clp model.
|
|
Get special options.
Definition at line 798 of file OsiClpSolverInterface.hpp. |
|
Get pointer to Clp model.
|
|
Get scaling action option.
Definition at line 802 of file OsiClpSolverInterface.hpp. |
|
Set Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled is not. Clp returns a secondary status code to that effect. This option allows for a cleanup. If you use it I would suggest 1. This only affects actions when scaled optimal 0 - no action 1 - clean up using dual if primal infeasibility 2 - clean up using dual if dual infeasibility 3 - clean up using dual if primal or dual infeasibility 11,12,13 - as 1,2,3 but use primal Definition at line 816 of file OsiClpSolverInterface.hpp. References cleanupScaling_. |
|
Get smallest allowed element in cut. If smaller than this then ignored Definition at line 820 of file OsiClpSolverInterface.hpp. |
|
Set smallest allowed element in cut. If smaller than this then ignored Definition at line 824 of file OsiClpSolverInterface.hpp. References smallestElementInCut_. |
|
Get smallest change in cut. If (upper-lower)*element < this then element is taken out and cut relaxed. (upper-lower) is taken to be at least 1.0 and this is assumed >= smallestElementInCut_ Definition at line 832 of file OsiClpSolverInterface.hpp. |
|
Set smallest change in cut. If (upper-lower)*element < this then element is taken out and cut relaxed. (upper-lower) is taken to be at least 1.0 and this is assumed >= smallestElementInCut_ Definition at line 840 of file OsiClpSolverInterface.hpp. References smallestChangeInCut_. |
|
Clone.
Implements OsiSolverInterface. |
|
Releases so won't error.
|
|
Assignment operator.
|
|
Resets as if default constructor.
Reimplemented from OsiSolverInterface. |
|
Apply a row cut (append to constraint matrix).
Implements OsiSolverInterface. |
|
Apply a column cut (adjust one or more bounds).
Implements OsiSolverInterface. |
|
The real work of a copy constructor (used by copy and assignment).
|
|
Deletes all mutable stuff.
|
|
A method that fills up the rowsense_, rhs_ and rowrange_ arrays.
|
|
If doing fast hot start then ranges are computed.
|
|
Warm start. NOTE artificials are treated as +1 elements so for <= rhs artificial will be at lower bound if constraint is tight This means that Clpsimplex flips artificials as it works in terms of row activities |
|
Sets up working basis as a copy of input. NOTE artificials are treated as +1 elements so for <= rhs artificial will be at lower bound if constraint is tight This means that Clpsimplex flips artificials as it works in terms of row activities |
|
Crunch down problem a bit.
|
|
If doing fast hot start then ranges are computed.
Definition at line 923 of file OsiClpSolverInterface.hpp. |
|
If doing fast hot start then ranges are computed.
Definition at line 925 of file OsiClpSolverInterface.hpp. |
|
Pass in range array.
Definition at line 928 of file OsiClpSolverInterface.hpp. References whichRange_. |
|
A function that tests the methods in the OsiClpSolverInterface class. The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. Also, if this method is compiled with optimization, the compilation takes 10-15 minutes and the machine pages (has 256M core memory!)... |
|
Clp model represented by this class instance.
Definition at line 936 of file OsiClpSolverInterface.hpp. Referenced by getColLower(), getColUpper(), getIterationCount(), getNumCols(), getNumElements(), getNumRows(), getObjCoefficients(), getObjSense(), getRowLower(), getRowUpper(), modifyCoefficient(), and setObjSense(). |
|
Linear objective - just points to ClpModel.
Definition at line 938 of file OsiClpSolverInterface.hpp. |
|
Pointer to dense vector of row sense indicators.
Definition at line 942 of file OsiClpSolverInterface.hpp. |
|
Pointer to dense vector of row right-hand side values.
Definition at line 945 of file OsiClpSolverInterface.hpp. |
|
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows).
Definition at line 950 of file OsiClpSolverInterface.hpp. |
|
A pointer to the warmstart information to be used in the hotstarts. This is NOT efficient and more thought should be given to it... Reimplemented from OsiSolverInterface. Definition at line 954 of file OsiClpSolverInterface.hpp. |
|
also save row and column information for hot starts only used in hotstarts so can be casual
Definition at line 957 of file OsiClpSolverInterface.hpp. |
|
Pointer to dense vector of row sense indicators.
Definition at line 958 of file OsiClpSolverInterface.hpp. |
|
Alternate model (hot starts).
Definition at line 960 of file OsiClpSolverInterface.hpp. |
|
factorization for hot starts
Definition at line 962 of file OsiClpSolverInterface.hpp. |
|
Smallest allowed element in cut. If smaller than this then ignored Definition at line 965 of file OsiClpSolverInterface.hpp. Referenced by setSmallestElementInCut(). |
|
Smallest change in cut. If (upper-lower)*element < this then element is taken out and cut relaxed. Definition at line 969 of file OsiClpSolverInterface.hpp. Referenced by setSmallestChangeInCut(). |
|
Arrays for hot starts.
Definition at line 971 of file OsiClpSolverInterface.hpp. |
|
Warmstart information to be used in resolves.
Definition at line 973 of file OsiClpSolverInterface.hpp. |
|
The original iteration limit before hotstarts started.
Definition at line 975 of file OsiClpSolverInterface.hpp. |
|
Last algorithm used.
Definition at line 978 of file OsiClpSolverInterface.hpp. |
|
To say if destructor should delete underlying model.
Definition at line 981 of file OsiClpSolverInterface.hpp. |
|
Pointer to row-wise copy of problem matrix coefficients.
Definition at line 984 of file OsiClpSolverInterface.hpp. |
|
Pointer to integer information.
Definition at line 987 of file OsiClpSolverInterface.hpp. |
|
Pointer to variables for which we want range information The number is in [0] memory is not owned by OsiClp.
Definition at line 993 of file OsiClpSolverInterface.hpp. Referenced by passInRanges(). |
|
To save data in OsiSimplex stuff.
Definition at line 1000 of file OsiClpSolverInterface.hpp. |
|
Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled is not. Clp returns a secondary status code to that effect. This option allows for a cleanup. If you use it I would suggest 1. This only affects actions when scaled optimal 0 - no action 1 - clean up using dual if primal infeasibility 2 - clean up using dual if dual infeasibility 3 - clean up using dual if primal or dual infeasibility 11,12,13 - as 1,2,3 but use primal Definition at line 1013 of file OsiClpSolverInterface.hpp. Referenced by setCleanupScaling(). |
|
Special options 0x80000000 off 0 simple stuff for branch and bound 1 try and keep work regions as much as possible 2 do not use any perturbation 4 allow exit before re-factorization 8 try and re-use factorization if no cuts 16 use standard strong branching rather than clp's 32 Just go to first factorization in fast dual 64 try and tighten bounds in crunch 128 Model will only change in column bounds 256 Clean up model before hot start 512 Give user direct access to Clp regions in getBInvARow etc Bits above 8192 give where called from in Cbc At present 0 is normal, 1 doing fast hotstarts, 2 is can do quick check.
Definition at line 1030 of file OsiClpSolverInterface.hpp. |