Loading...
Searching...
No Matches
OsiClpSolverInterface Class Reference

Clp Solver Interface. More...

`#include <OsiClpSolverInterface.hpp>`

Inheritance diagram for OsiClpSolverInterface:
[legend]
Collaboration diagram for OsiClpSolverInterface:
[legend]

## Public Member Functions

Solve methods
virtual void | initialSolve ()
| Solve initial LP relaxation.
virtual void | resolve ()
| Resolve an LP relaxation after problem modification.
virtual void | resolveGub (int needed)
| Resolve an LP relaxation after problem modification (try GUB).
virtual void | branchAndBound ()
| Invoke solver's built-in enumeration algorithm.
void | crossover (int options, int basis)
| Solve when primal column and dual row solutions are near-optimal options - 0 no presolve (use primal and dual) 1 presolve (just use primal) 2 no presolve (just use primal) basis - 0 use all slack basis 1 try and put some in basis.
OsiSimplexInterface methods
Methods for the Osi Simplex API. The current implementation should work for both minimisation and maximisation in mode 1 (tableau access). In mode 2 (single pivot), only minimisation is supported as of 100907.
virtual int | canDoSimplexInterface () const
| Simplex API capability.
virtual void | enableFactorization () const
| Enables simplex mode 1 (tableau access).
virtual void | disableFactorization () const
| Undo any setting changes made by enableFactorization.
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:
virtual int | setBasisStatus (const int *cstat, const int *rstat)
| Set the status of structural/artificial variables and factorize, update solution etc.
virtual void | getReducedGradient (double *columnReducedCosts, double *duals, const double *c) const
| Get the reduced gradient for the cost vector c.
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 | getBInvARow (int row, CoinIndexedVector *z, CoinIndexedVector *slack=NULL, bool keepScaled=false) const
| Get a row of the tableau (slack part in slack if not NULL) If keepScaled is true then scale factors not applied after so user has to use coding similar to what is in this method.
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 | getBInvACol (int col, CoinIndexedVector *vec) const
| Get a column of the tableau.
virtual void | getBInvACol (CoinIndexedVector *vec) const
| Update (i.e.
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()).
virtual void | enableSimplexInterface (bool doingPrimal)
| Enables simplex mode 2 (individual pivot control).
virtual void | disableSimplexInterface ()
| Undo setting changes made by enableSimplexInterface.
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.
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.
CoinWarmStartBasis * | getPointerToWarmStart ()
| Get warmstarting information.
const CoinWarmStartBasis * | getConstPointerToWarmStart () const
| Get warmstarting information.
virtual bool | setWarmStart (const CoinWarmStart *warmstart)
| Set warmstarting information.
virtual CoinWarmStart * | getPointerToWarmStart (bool &mustDelete)
| Get warm start information.
void | setColumnStatus (int iColumn, ClpSimplex::Status status)
| Set column status in ClpSimplex and warmStart.
Hotstart related methods (primarily used in strong branching).
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.
int | startFastDual (int options)
| Start faster dual - returns negative if problems 1 if infeasible, Options to pass to solver 1 - create external reduced costs for columns 2 - create external reduced costs for rows 4 - create external row activity (columns always done) Above only done if feasible When set resolve does less work.
void | stopFastDual ()
| Stop fast dual.
void | setStuff (double tolerance, double increment)
| Sets integer tolerance and increment.
OsiRowCut * | smallModelCut (const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
| Return a conflict analysis cut from small model.
OsiRowCut * | modelCut (const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
| Return a conflict analysis cut from model If type is 0 then genuine cut, if 1 then only partially processed.
Methods related to querying the input data
virtual int | getNumCols () const
| Get number of columns.
virtual int | getNumRows () const
| Get number of rows.
virtual CoinBigIndex | getNumElements () const
| Get number of nonzero elements.
virtual std::string | getRowName (int rowIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
| Return name of row if one exists or Rnnnnnnn maxLen is currently ignored and only there to match the signature from the base class!
virtual std::string | getColName (int colIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
| Return name of column if one exists or Cnnnnnnn maxLen is currently ignored and only there to match the signature from the base class!
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 bool | isBinary (int colIndex) const
| Return true if variable is binary.
virtual bool | isInteger (int colIndex) const
| Return true if column is integer.
virtual bool | isIntegerNonBinary (int colIndex) const
| Return true if variable is general integer.
virtual bool | isFreeBinary (int colIndex) const
| Return true if variable is binary and not fixed at either bound.
virtual const char * | getColType (bool refresh=false) const
| Return array of column length 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later).
bool | isOptionalInteger (int colIndex) const
| Return true if column is integer but does not have to be declared as such.
void | setOptionalInteger (int index)
| Set the index-th variable to be an optional integer variable.
bool | isHeuristicInteger (int colIndex) const
| Return true only if integer and not optional.
int | integerType (int colIndex) const
| Return integer type (0,1,2=optional,3=sc,4=scint).
void | setIntegerType (int colIndex, int value)
| Set integer type (0,1,2=optional,3=sc,4=scint).
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 CoinPackedMatrix * | getMutableMatrixByCol () const
| Get pointer to mutable 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, bool fullRay=false) 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.
int | numberSOS () const
| Number of SOS sets.
const CoinSet * | setInfo () const
| SOS set info.
void | replaceSetInfo (int numberSOS, CoinSet *setInfo)
| Replace setInfo (takes over ownership).
virtual int | findIntegersAndSOS (bool justCount)
| Identify integer variables and SOS and create corresponding objects.
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.
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)
virtual void | addCol (const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj, std::string name)
| Add a named 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 | addCol (int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj, std::string name)
| Add a named 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)
virtual void | addCols (const int numcols, const CoinBigIndex *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
virtual void | deleteCols (const int num, const int *colIndices)
virtual void | addRow (const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
virtual void | addRow (const CoinPackedVectorBase &vec, const double rowlb, const double rowub, std::string name)
| Add a named row (constraint) to the problem.
virtual void | addRow (const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
virtual void | addRow (int numberElements, const int *columns, const double *element, 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, std::string name)
| Add a named row (constraint) to the problem.
virtual void | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
virtual void | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
virtual void | addRows (const int numrows, const CoinBigIndex *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub)
void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
virtual void | deleteRows (const int num, const int *rowIndices)
virtual void | saveBaseModel ()
| If solver wants it can save a copy of "base" (continuous) model here.
virtual void | restoreBaseModel (int numberRows)
| Strip off rows to get to this number of rows.
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.
virtual ApplyCutsReturnCode | applyCuts (const OsiCuts &cs, double effectivenessLb=0.0)
| Apply a collection of cuts.
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 ClpMatrixBase &matrix, 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 as a ClpMatrixBase.
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).
int | readMps (const char *filename, bool keepNames, bool allowErrors)
| Read an mps file from the given filename returns number of errors (see OsiMpsReader class).
virtual int | readMps (const char *filename, const char *extension, int &numberSets, CoinSet **&sets)
| Read an mps file.
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", double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
| Write the problem into an Lp file of the given filename.
virtual void | writeLp (FILE *fp, double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, 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
virtual void | passInMessageHandler (CoinMessageHandler *handler)
| Pass in a message handler.
void | newLanguage (CoinMessages::Language language)
| Set language.
void | setLanguage (CoinMessages::Language language)
void | setLogLevel (int value)
| Set log level (will also set underlying solver's log level).
void | generateCpp (FILE *fp)
| Create C++ lines to get to current state.
Clp specific public interfaces
ClpSimplex * | getModelPtr () const
| Get pointer to Clp model.
ClpSimplex * | swapModelPtr (ClpSimplex *newModel)
| Set pointer to Clp model and return old.
unsigned int | specialOptions () const
| Get special options.
void | setSpecialOptions (unsigned int value)
int | lastAlgorithm () const
| Last algorithm used , 1 = primal, 2 = dual other unknown.
void | setLastAlgorithm (int value)
| Set last algorithm used , 1 = primal, 2 = dual other unknown.
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.
void | setSolveOptions (const ClpSolve &options)
| Pass in initial solve options.
virtual int | tightenBounds (int lightweight=0)
| Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers, 2 lightweight and all.
int | infeasibleOtherWay (char *whichWay)
| See if any integer variables make infeasible other way.
virtual CoinBigIndex | getSizeL () const
| Return number of entries in L part of current factorization.
virtual CoinBigIndex | getSizeU () const
| Return number of entries in U part of current factorization.
const OsiClpDisasterHandler * | disasterHandler () const
| Get disaster handler.
void | passInDisasterHandler (OsiClpDisasterHandler *handler)
| Pass in disaster handler.
ClpLinearObjective * | fakeObjective () const
| Get fake objective.
void | setFakeObjective (ClpLinearObjective *fakeObjective)
| Set fake objective (and take ownership).
void | setFakeObjective (double *fakeObjective)
| Set fake objective.
void | setupForRepeatedUse (int senseOfAdventure=0, int printOut=0)
| Set 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
| Set special options in underlying clp solver.
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 Attributes

Protected member data
ClpSimplex * | modelPtr_
| Clp model represented by this class instance.
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_
ClpNodeStuff | stuff_
| Stuff for fast dual.
int | numberSOS_
| Number of SOS sets.
CoinSet * | setInfo_
| SOS set info.
ClpSimplex * | smallModel_
| Alternate model (hot starts) - but also could be permanent and used for crunch.
ClpFactorization * | factorization_
| factorization for hot starts
double | smallestElementInCut_
| Smallest allowed element in cut.
double | smallestChangeInCut_
| Smallest change in cut.
double | largestAway_
| Largest amount continuous away from bound.
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.
CoinPackedMatrix * | matrixByRowAtContinuous_
| Pointer to row-wise copy of continuous 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.
bool | fakeMinInSimplex_
| Faking min to get proper dual solution signs in simplex API.
double * | linearObjective_
| Linear objective.
ClpDataSave | saveData_
| To save data in OsiSimplex stuff.
ClpSolve | solveOptions_
| Options for initialSolve.
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 (i.e., do not unscale, and do not return result in getBInv parameters; you have to know where to look for the answer) 1024 Don't "borrow" model in initialSolve 2048 Don't crunch 4096 quick check for optimality Bits above 8192 give where called from in Cbc At present 0 is normal, 1 doing fast hotstarts, 2 is can do quick check 65536 Keep simple i.e.

ClpSimplex * | baseModel_
| Copy of model when option 131072 set.
int | lastNumberRows_
| Number of rows when last "scaled".
ClpSimplex * | continuousModel_
| Continuous model.
OsiClpDisasterHandler * | disasterHandler_
| Possible disaster handler.
ClpLinearObjective * | fakeObjective_
| Fake objective.
CoinDoubleArrayWithLength | rowScale_
| Row scale factors (has inverse at end).
CoinDoubleArrayWithLength | columnScale_
| Column scale factors (has inverse at end).

## Friends

void | OsiClpSolverInterfaceUnitTest (const std::string &mpsDir, const std::string &netlibDir)
| A function that tests the methods in the OsiClpSolverInterface class.

## Protected methods

void | setBasis (const CoinWarmStartBasis &basis)
| Sets up working basis as a copy of input and puts in as basis.
void | setBasis ()
| Just puts current basis_ into ClpSimplex model.
CoinWarmStartDiff * | getBasisDiff (const unsigned char *statusArray) const
| Warm start difference from basis_ to statusArray.
CoinWarmStartBasis * | getBasis (const unsigned char *statusArray) const
| Warm start from statusArray.
void | deleteScaleFactors ()
| Delete all scale factor stuff and reset option.
const double * | upRange () const
| If doing fast hot start then ranges are computed.
const double * | downRange () const
void | passInRanges (int *array)
| Pass in range array.
void | setSOSData (int numberSOS, const char *type, const int *start, const int *indices, const double *weights=NULL)
| Pass in sos stuff from AMPl.
void | computeLargestAway ()
| Compute largest amount any at continuous away from bound.
double | largestAway () const
| Get largest amount continuous away from bound.
void | setLargestAway (double value)
| Set largest amount continuous away from bound.
void | lexSolve ()
| Sort of lexicographic resolve.
ClpSimplex * | getContinuousModel () const
| Get continuous model.
void | setContinuousModel (ClpSimplex *model)
| Set continuous model.
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).
void | gutsOfDestructor ()
| The real work of a copy constructor (used by copy and assignment).
void | freeCachedResults () const
| Deletes all mutable stuff.
void | freeCachedResults0 () const
| Deletes all mutable stuff for row ranges etc.
void | freeCachedResults1 () const
| Deletes all mutable stuff for matrix etc.
void | extractSenseRhsRange () const
| A method that fills up the rowsense_, rhs_ and rowrange_ arrays.
void | fillParamMaps ()
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.
void | redoScaleFactors (int numberRows, const CoinBigIndex *starts, const int *indices, const double *elements)
| Extend scale factors.

## Detailed Description

Clp Solver Interface.

Instantiation of OsiClpSolverInterface for the Model Algorithm.

Definition at line 37 of file OsiClpSolverInterface.hpp.

## Constructor & Destructor Documentation

## OsiClpSolverInterface() [1/3]

OsiClpSolverInterface::OsiClpSolverInterface | ( |  | ) |

Default Constructor.

## OsiClpSolverInterface() [2/3]

OsiClpSolverInterface::OsiClpSolverInterface | ( | const OsiClpSolverInterface & |  | ) |

Copy constructor.

## OsiClpSolverInterface() [3/3]

OsiClpSolverInterface::OsiClpSolverInterface | ( | ClpSimplex * | rhs,
|  | bool | reallyOwn = false )

Borrow constructor - only delete one copy.

## ~OsiClpSolverInterface()

virtual OsiClpSolverInterface::~OsiClpSolverInterface | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## initialSolve()

virtual void OsiClpSolverInterface::initialSolve | ( |  | ) |

virtual

Solve initial LP relaxation.

## resolve()

virtual void OsiClpSolverInterface::resolve | ( |  | ) |

virtual

Resolve an LP relaxation after problem modification.

## resolveGub()

virtual void OsiClpSolverInterface::resolveGub | ( | int | needed | ) |

virtual

Resolve an LP relaxation after problem modification (try GUB).

## branchAndBound()

virtual void OsiClpSolverInterface::branchAndBound | ( |  | ) |

virtual

Invoke solver's built-in enumeration algorithm.

## crossover()

void OsiClpSolverInterface::crossover | ( | int | options,
|  | int | basis )

Solve when primal column and dual row solutions are near-optimal options - 0 no presolve (use primal and dual) 1 presolve (just use primal) 2 no presolve (just use primal) basis - 0 use all slack basis 1 try and put some in basis.

## canDoSimplexInterface()

virtual int OsiClpSolverInterface::canDoSimplexInterface | ( |  | ) | const

virtual

Simplex API capability.

Returns

- 0 if no simplex API
- 1 if can just do getBInv etc
- 2 if has all OsiSimplex methods

## enableFactorization()

virtual void OsiClpSolverInterface::enableFactorization | ( |  | ) | const

virtual

Enables simplex mode 1 (tableau access).

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.

## disableFactorization()

virtual void OsiClpSolverInterface::disableFactorization | ( |  | ) | const

virtual

Undo any setting changes made by enableFactorization.

## basisIsAvailable()

virtual bool OsiClpSolverInterface::basisIsAvailable | ( |  | ) | const

virtual

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.

## getBasisStatus()

virtual void OsiClpSolverInterface::getBasisStatus | ( | int * | cstat,
|  | int * | rstat ) const

virtual

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

## setBasisStatus()

virtual int OsiClpSolverInterface::setBasisStatus | ( | const int * | cstat,
|  | const int * | rstat )

virtual

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 Returns 0 if OK, 1 if problem is bad e.g. duplicate elements, too large ...

## getReducedGradient()

virtual void OsiClpSolverInterface::getReducedGradient | ( | double * | columnReducedCosts,
|  | double * | duals,
|  | const double * | c ) const

virtual

Get the reduced gradient for the cost vector c.

## getBInvARow() [1/2]

virtual void OsiClpSolverInterface::getBInvARow | ( | int | row,
|  | double * | z,
|  | double * | slack = NULL ) const

virtual

Get a row of the tableau (slack part in slack if not NULL).

## getBInvARow() [2/2]

virtual void OsiClpSolverInterface::getBInvARow | ( | int | row,
|  | CoinIndexedVector * | z,
|  | CoinIndexedVector * | slack = NULL,
|  | bool | keepScaled = false ) const

virtual

Get a row of the tableau (slack part in slack if not NULL) If keepScaled is true then scale factors not applied after so user has to use coding similar to what is in this method.

## getBInvRow()

virtual void OsiClpSolverInterface::getBInvRow | ( | int | row,
|  | double * | z ) const

virtual

Get a row of the basis inverse.

## getBInvACol() [1/3]

virtual void OsiClpSolverInterface::getBInvACol | ( | int | col,
|  | double * | vec ) const

virtual

Get a column of the tableau.

## getBInvACol() [2/3]

virtual void OsiClpSolverInterface::getBInvACol | ( | int | col,
|  | CoinIndexedVector * | vec ) const

virtual

Get a column of the tableau.

## getBInvACol() [3/3]

virtual void OsiClpSolverInterface::getBInvACol | ( | CoinIndexedVector * | vec | ) | const

virtual

Update (i.e.

ftran) the vector passed in. Unscaling is applied after - can't be applied before

## getBInvCol()

virtual void OsiClpSolverInterface::getBInvCol | ( | int | col,
|  | double * | vec ) const

virtual

Get a column of the basis inverse.

## getBasics()

virtual void OsiClpSolverInterface::getBasics | ( | int * | index | ) | const

virtual

Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBInvACol() and getBInvCol()).

## enableSimplexInterface()

virtual void OsiClpSolverInterface::enableSimplexInterface | ( | bool | doingPrimal | ) |

virtual

Enables simplex mode 2 (individual pivot control).

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.

## disableSimplexInterface()

virtual void OsiClpSolverInterface::disableSimplexInterface | ( |  | ) |

virtual

Undo setting changes made by enableSimplexInterface.

## pivot()

virtual int OsiClpSolverInterface::pivot | ( | int | colIn,
|  | int | colOut,
|  | int | outStatus )

virtual

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

## primalPivotResult()

virtual int OsiClpSolverInterface::primalPivotResult | ( | int | colIn,
|  | int | sign,
|  | int & | colOut,
|  | int & | outStatus,
|  | double & | t,
|  | CoinPackedVector * | dx )

virtual

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

## dualPivotResult()

virtual int OsiClpSolverInterface::dualPivotResult | ( | int & | colIn,
|  | int & | sign,
|  | int | colOut,
|  | int | outStatus,
|  | double & | t,
|  | CoinPackedVector * | dx )

virtual

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.

## setIntParam()

bool OsiClpSolverInterface::setIntParam | ( | OsiIntParam | key,
|  | int | value )

## setDblParam()

bool OsiClpSolverInterface::setDblParam | ( | OsiDblParam | key,
|  | double | value )

## setStrParam()

bool OsiClpSolverInterface::setStrParam | ( | OsiStrParam | key,
|  | const std::string & | value )

## getIntParam()

bool OsiClpSolverInterface::getIntParam | ( | OsiIntParam | key,
|  | int & | value ) const

## getDblParam()

bool OsiClpSolverInterface::getDblParam | ( | OsiDblParam | key,
|  | double & | value ) const

## getStrParam()

bool OsiClpSolverInterface::getStrParam | ( | OsiStrParam | key,
|  | std::string & | value ) const

## setHintParam()

virtual bool OsiClpSolverInterface::setHintParam | ( | OsiHintParam | key,
|  | bool | yesNo = true,
|  | OsiHintStrength | strength = OsiHintTry,
|  | void * | otherInformation = NULL )

virtual

## isAbandoned()

virtual bool OsiClpSolverInterface::isAbandoned | ( |  | ) | const

virtual

Are there a numerical difficulties?

## isProvenOptimal()

virtual bool OsiClpSolverInterface::isProvenOptimal | ( |  | ) | const

virtual

Is optimality proven?

## isProvenPrimalInfeasible()

virtual bool OsiClpSolverInterface::isProvenPrimalInfeasible | ( |  | ) | const

virtual

Is primal infeasiblity proven?

## isProvenDualInfeasible()

virtual bool OsiClpSolverInterface::isProvenDualInfeasible | ( |  | ) | const

virtual

Is dual infeasiblity proven?

## isPrimalObjectiveLimitReached()

virtual bool OsiClpSolverInterface::isPrimalObjectiveLimitReached | ( |  | ) | const

virtual

Is the given primal objective limit reached?

## isDualObjectiveLimitReached()

virtual bool OsiClpSolverInterface::isDualObjectiveLimitReached | ( |  | ) | const

virtual

Is the given dual objective limit reached?

## isIterationLimitReached()

virtual bool OsiClpSolverInterface::isIterationLimitReached | ( |  | ) | const

virtual

Iteration limit reached?

## getEmptyWarmStart()

virtual CoinWarmStart * OsiClpSolverInterface::getEmptyWarmStart | ( |  | ) | const

virtual

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.

## getWarmStart()

virtual CoinWarmStart * OsiClpSolverInterface::getWarmStart | ( |  | ) | const

virtual

Get warmstarting information.

## getPointerToWarmStart() [1/2]

CoinWarmStartBasis * OsiClpSolverInterface::getPointerToWarmStart | ( |  | ) |

inline

Get warmstarting information.

Definition at line 285 of file OsiClpSolverInterface.hpp.

## getConstPointerToWarmStart()

const CoinWarmStartBasis * OsiClpSolverInterface::getConstPointerToWarmStart | ( |  | ) | const

inline

Get warmstarting information.

Definition at line 290 of file OsiClpSolverInterface.hpp.

## setWarmStart()

virtual bool OsiClpSolverInterface::setWarmStart | ( | const CoinWarmStart * | warmstart | ) |

virtual

Set warmstarting information.

Return true/false depending on whether the warmstart information was accepted or not.

## getPointerToWarmStart() [2/2]

virtual CoinWarmStart * OsiClpSolverInterface::getPointerToWarmStart | ( | bool & | mustDelete | ) |

virtual

Get warm start information.

Return warm start information for the current state of the solver interface. If there is no valid warm start information, an empty warm start object wil be returned. This does not necessarily create an object - may just point to one. must Delete set true if user should delete returned object. OsiClp version always returns pointer and false.

## setColumnStatus()

void OsiClpSolverInterface::setColumnStatus | ( | int | iColumn,
|  | ClpSimplex::Status | status )

Set column status in ClpSimplex and warmStart.

## markHotStart()

virtual void OsiClpSolverInterface::markHotStart | ( |  | ) |

virtual

Create a hotstart point of the optimization process.

## solveFromHotStart()

virtual void OsiClpSolverInterface::solveFromHotStart | ( |  | ) |

virtual

Optimize starting from the hotstart.

## unmarkHotStart()

virtual void OsiClpSolverInterface::unmarkHotStart | ( |  | ) |

virtual

Delete the snapshot.

## startFastDual()

int OsiClpSolverInterface::startFastDual | ( | int | options | ) |

Start faster dual - returns negative if problems 1 if infeasible, Options to pass to solver 1 - create external reduced costs for columns 2 - create external reduced costs for rows 4 - create external row activity (columns always done) Above only done if feasible When set resolve does less work.

## stopFastDual()

void OsiClpSolverInterface::stopFastDual | ( |  | ) |

Stop fast dual.

## setStuff()

void OsiClpSolverInterface::setStuff | ( | double | tolerance,
|  | double | increment )

Sets integer tolerance and increment.

## smallModelCut()

OsiRowCut * OsiClpSolverInterface::smallModelCut | ( | const double * | originalLower,
|  | const double * | originalUpper,
|  | int | numberRowsAtContinuous,
|  | const int * | whichGenerator,
|  | int | typeCut = 0 )

Return a conflict analysis cut from small model.

## modelCut()

OsiRowCut * OsiClpSolverInterface::modelCut | ( | const double * | originalLower,
|  | const double * | originalUpper,
|  | int | numberRowsAtContinuous,
|  | const int * | whichGenerator,
|  | int | typeCut = 0 )

Return a conflict analysis cut from model If type is 0 then genuine cut, if 1 then only partially processed.

## getNumCols()

virtual int OsiClpSolverInterface::getNumCols | ( |  | ) | const

inline virtual

Get number of columns.

Definition at line 367 of file OsiClpSolverInterface.hpp.

## getNumRows()

virtual int OsiClpSolverInterface::getNumRows | ( |  | ) | const

inline virtual

Get number of rows.

Definition at line 373 of file OsiClpSolverInterface.hpp.

## getNumElements()

virtual CoinBigIndex OsiClpSolverInterface::getNumElements | ( |  | ) | const

inline virtual

Get number of nonzero elements.

Definition at line 379 of file OsiClpSolverInterface.hpp.

## getRowName()

virtual std::string OsiClpSolverInterface::getRowName | ( | int | rowIndex,
|  | unsigned | maxLen = static_cast< unsigned >(std::string::npos) ) const

virtual

Return name of row if one exists or Rnnnnnnn maxLen is currently ignored and only there to match the signature from the base class!

## getColName()

virtual std::string OsiClpSolverInterface::getColName | ( | int | colIndex,
|  | unsigned | maxLen = static_cast< unsigned >(std::string::npos) ) const

virtual

Return name of column if one exists or Cnnnnnnn maxLen is currently ignored and only there to match the signature from the base class!

## getColLower()

virtual const double * OsiClpSolverInterface::getColLower | ( |  | ) | const

inline virtual

Get pointer to array[getNumCols()] of column lower bounds.

Definition at line 399 of file OsiClpSolverInterface.hpp.

## getColUpper()

virtual const double * OsiClpSolverInterface::getColUpper | ( |  | ) | const

inline virtual

Get pointer to array[getNumCols()] of column upper bounds.

Definition at line 402 of file OsiClpSolverInterface.hpp.

## getRowSense()

virtual const char * OsiClpSolverInterface::getRowSense | ( |  | ) | const

virtual

Get pointer to array[getNumRows()] of row constraint senses.

- 'L' <= constraint
- 'E' = constraint
- 'G' >= constraint
- 'R' ranged constraint
- 'N' free constraint

## getRightHandSide()

virtual const double * OsiClpSolverInterface::getRightHandSide | ( |  | ) | const

virtual

Get pointer to array[getNumRows()] of rows right-hand sides.

- if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
- if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
- if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
- if rowsense()[i] == 'N' then rhs()[i] == 0.0

## getRowRange()

virtual const double * OsiClpSolverInterface::getRowRange | ( |  | ) | const

virtual

Get pointer to array[getNumRows()] of row ranges.

- if rowsense()[i] == 'R' then rowrange()[i] == rowupper()[i] - rowlower()[i]
- if rowsense()[i] != 'R' then rowrange()[i] is undefined

## getRowLower()

virtual const double * OsiClpSolverInterface::getRowLower | ( |  | ) | const

inline virtual

Get pointer to array[getNumRows()] of row lower bounds.

Definition at line 436 of file OsiClpSolverInterface.hpp.

## getRowUpper()

virtual const double * OsiClpSolverInterface::getRowUpper | ( |  | ) | const

inline virtual

Get pointer to array[getNumRows()] of row upper bounds.

Definition at line 439 of file OsiClpSolverInterface.hpp.

## getObjCoefficients()

virtual const double * OsiClpSolverInterface::getObjCoefficients | ( |  | ) | const

inline virtual

Get pointer to array[getNumCols()] of objective function coefficients.

Definition at line 442 of file OsiClpSolverInterface.hpp.

## getObjSense()

virtual double OsiClpSolverInterface::getObjSense | ( |  | ) | const

inline virtual

Get objective function sense (1 for min (default), -1 for max).

Definition at line 451 of file OsiClpSolverInterface.hpp.

## isContinuous()

virtual bool OsiClpSolverInterface::isContinuous | ( | int | colNumber | ) | const

virtual

Return true if column is continuous.

## isBinary()

virtual bool OsiClpSolverInterface::isBinary | ( | int | colIndex | ) | const

virtual

Return true if variable is binary.

## isInteger()

virtual bool OsiClpSolverInterface::isInteger | ( | int | colIndex | ) | const

virtual

Return true if column is integer.

Note: This function returns true if the the column is binary or a general integer.

## isIntegerNonBinary()

virtual bool OsiClpSolverInterface::isIntegerNonBinary | ( | int | colIndex | ) | const

virtual

Return true if variable is general integer.

## isFreeBinary()

virtual bool OsiClpSolverInterface::isFreeBinary | ( | int | colIndex | ) | const

virtual

Return true if variable is binary and not fixed at either bound.

## getColType()

virtual const char * OsiClpSolverInterface::getColType | ( | bool | refresh = false | ) | const

virtual

Return array of column length 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later).

## isOptionalInteger()

bool OsiClpSolverInterface::isOptionalInteger | ( | int | colIndex | ) | const

Return true if column is integer but does not have to be declared as such.

Note: This function returns true if the the column is binary or a general integer.

## setOptionalInteger()

void OsiClpSolverInterface::setOptionalInteger | ( | int | index | ) |

Set the index-th variable to be an optional integer variable.

## isHeuristicInteger()

bool OsiClpSolverInterface::isHeuristicInteger | ( | int | colIndex | ) | const

inline

Return true only if integer and not optional.

Definition at line 488 of file OsiClpSolverInterface.hpp.

## integerType()

int OsiClpSolverInterface::integerType | ( | int | colIndex | ) | const

inline

Return integer type (0,1,2=optional,3=sc,4=scint).

Definition at line 493 of file OsiClpSolverInterface.hpp.

## setIntegerType()

void OsiClpSolverInterface::setIntegerType | ( | int | colIndex,
|  | int | value )

inline

Set integer type (0,1,2=optional,3=sc,4=scint).

Definition at line 498 of file OsiClpSolverInterface.hpp.

## getMatrixByRow()

virtual const CoinPackedMatrix * OsiClpSolverInterface::getMatrixByRow | ( |  | ) | const

virtual

Get pointer to row-wise copy of matrix.

## getMatrixByCol()

virtual const CoinPackedMatrix * OsiClpSolverInterface::getMatrixByCol | ( |  | ) | const

virtual

Get pointer to column-wise copy of matrix.

## getMutableMatrixByCol()

virtual CoinPackedMatrix * OsiClpSolverInterface::getMutableMatrixByCol | ( |  | ) | const

virtual

Get pointer to mutable column-wise copy of matrix.

## getInfinity()

virtual double OsiClpSolverInterface::getInfinity | ( |  | ) | const

inline virtual

Get solver's value for infinity.

Definition at line 512 of file OsiClpSolverInterface.hpp.

## getColSolution()

virtual const double * OsiClpSolverInterface::getColSolution | ( |  | ) | const

virtual

Get pointer to array[getNumCols()] of primal solution vector.

## getRowPrice()

virtual const double * OsiClpSolverInterface::getRowPrice | ( |  | ) | const

virtual

Get pointer to array[getNumRows()] of dual prices.

## getReducedCost()

virtual const double * OsiClpSolverInterface::getReducedCost | ( |  | ) | const

virtual

Get a pointer to array[getNumCols()] of reduced costs.

## getRowActivity()

virtual const double * OsiClpSolverInterface::getRowActivity | ( |  | ) | const

virtual

Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector.

## getObjValue()

virtual double OsiClpSolverInterface::getObjValue | ( |  | ) | const

virtual

Get objective function value.

## getIterationCount()

virtual int OsiClpSolverInterface::getIterationCount | ( |  | ) | const

inline virtual

Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.

Definition at line 535 of file OsiClpSolverInterface.hpp.

## getDualRays()

virtual std::vector< double * > OsiClpSolverInterface::getDualRays | ( | int | maxNumRays,
|  | bool | fullRay = false ) const

virtual

Get as many dual rays as the solver can provide.

(In case of proven primal infeasibility there should be at least one.)

The first getNumRows() ray components will always be associated with the row duals (as returned by getRowPrice()). If `fullRay` is true, the final getNumCols() entries will correspond to the ray components associated with the nonbasic variables. If the full ray is requested and the method cannot provide it, it will throw an exception.

NOTE for implementers of solver interfaces:
The double pointers in the vector should point to arrays of length getNumRows() and they should be allocated via new[].

NOTE for users of solver interfaces:
It is the user's responsibility to free the double pointers in the vector using delete[].

## getPrimalRays()

virtual std::vector< double * > OsiClpSolverInterface::getPrimalRays | ( | int | maxNumRays | ) | const

virtual

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:
The double pointers in the vector should point to arrays of length getNumCols() and they should be allocated via new[].

NOTE for users of solver interfaces:
It is the user's responsibility to free the double pointers in the vector using delete[].

## setObjCoeff()

virtual void OsiClpSolverInterface::setObjCoeff | ( | int | elementIndex,
|  | double | elementValue )

virtual

Set an objective function coefficient.

## setColLower() [1/2]

virtual void OsiClpSolverInterface::setColLower | ( | int | elementIndex,
|  | double | elementValue )

virtual

Set a single column lower bound
Use -DBL_MAX for -infinity.

## setColUpper() [1/2]

virtual void OsiClpSolverInterface::setColUpper | ( | int | elementIndex,
|  | double | elementValue )

virtual

Set a single column upper bound
Use DBL_MAX for infinity.

## setColBounds()

virtual void OsiClpSolverInterface::setColBounds | ( | int | elementIndex,
|  | double | lower,
|  | double | upper )

virtual

Set a single column lower and upper bound.

## setColSetBounds()

virtual void OsiClpSolverInterface::setColSetBounds | ( | const int * | indexFirst,
|  | const int * | indexLast,
|  | const double * | boundList )

virtual

Set the bounds on a number of columns simultaneously
The default implementation just invokes setColLower() and setColUpper() over and over again.

Parameters

  indexFirst,indexLast | pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes
  boundList | the new lower/upper bound pairs for the variables

## setRowLower()

virtual void OsiClpSolverInterface::setRowLower | ( | int | elementIndex,
|  | double | elementValue )

virtual

Set a single row lower bound
Use -DBL_MAX for -infinity.

## setRowUpper()

virtual void OsiClpSolverInterface::setRowUpper | ( | int | elementIndex,
|  | double | elementValue )

virtual

Set a single row upper bound
Use DBL_MAX for infinity.

## setRowBounds()

virtual void OsiClpSolverInterface::setRowBounds | ( | int | elementIndex,
|  | double | lower,
|  | double | upper )

virtual

Set a single row lower and upper bound.

## setRowType()

virtual void OsiClpSolverInterface::setRowType | ( | int | index,
|  | char | sense,
|  | double | rightHandSide,
|  | double | range )

virtual

Set the type of a single row
.

## setRowSetBounds()

virtual void OsiClpSolverInterface::setRowSetBounds | ( | const int * | indexFirst,
|  | const int * | indexLast,
|  | const double * | boundList )

virtual

Set the bounds on a number of rows simultaneously
The default implementation just invokes setRowLower() and setRowUpper() over and over again.

Parameters

  indexFirst,indexLast | pointers to the beginning and after the end of the array of the indices of the constraints whose either bound changes
  boundList | the new lower/upper bound pairs for the constraints

## setRowSetTypes()

virtual void OsiClpSolverInterface::setRowSetTypes | ( | const int * | indexFirst,
|  | const int * | indexLast,
|  | const char * | senseList,
|  | const double * | rhsList,
|  | const double * | rangeList )

virtual

Set the type of a number of rows simultaneously
The default implementation just invokes setRowType() over and over again.

Parameters

  indexFirst,indexLast | pointers to the beginning and after the end of the array of the indices of the constraints whose any characteristics changes
  senseList | the new senses
  rhsList | the new right hand sides
  rangeList | the new ranges

## setObjective()

virtual void OsiClpSolverInterface::setObjective | ( | const double * | array | ) |

virtual

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.

## setColLower() [2/2]

virtual void OsiClpSolverInterface::setColLower | ( | const double * | array | ) |

virtual

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.

## setColUpper() [2/2]

virtual void OsiClpSolverInterface::setColUpper | ( | const double * | array | ) |

virtual

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.

## setRowName()

virtual void OsiClpSolverInterface::setRowName | ( | int | rowIndex,
|  | std::string | name )

virtual

Set name of row.

## setColName()

virtual void OsiClpSolverInterface::setColName | ( | int | colIndex,
|  | std::string | name )

virtual

Set name of column.

## setContinuous() [1/2]

virtual void OsiClpSolverInterface::setContinuous | ( | int | index | ) |

virtual

Set the index-th variable to be a continuous variable.

## setInteger() [1/2]

virtual void OsiClpSolverInterface::setInteger | ( | int | index | ) |

virtual

Set the index-th variable to be an integer variable.

## setContinuous() [2/2]

virtual void OsiClpSolverInterface::setContinuous | ( | const int * | indices,
|  | int | len )

virtual

Set the variables listed in indices (which is of length len) to be continuous variables.

## setInteger() [2/2]

virtual void OsiClpSolverInterface::setInteger | ( | const int * | indices,
|  | int | len )

virtual

Set the variables listed in indices (which is of length len) to be integer variables.

## numberSOS()

int OsiClpSolverInterface::numberSOS | ( |  | ) | const

inline

Number of SOS sets.

Definition at line 696 of file OsiClpSolverInterface.hpp.

## setInfo()

const CoinSet * OsiClpSolverInterface::setInfo | ( |  | ) | const

inline

SOS set info.

Definition at line 701 of file OsiClpSolverInterface.hpp.

## replaceSetInfo()

void OsiClpSolverInterface::replaceSetInfo | ( | int | numberSOS,
|  | CoinSet * | setInfo )

Replace setInfo (takes over ownership).

## findIntegersAndSOS()

virtual int OsiClpSolverInterface::findIntegersAndSOS | ( | bool | justCount | ) |

virtual

Identify integer variables and SOS and create corresponding objects.

Record integer variables and create an OsiSimpleInteger object for each one. All existing OsiSimpleInteger objects will be destroyed. If the solver supports SOS then do the same for SOS. If justCount then no objects created and we just store numberIntegers_ Returns number of SOS

## setObjSense()

virtual void OsiClpSolverInterface::setObjSense | ( | double | s | ) |

inline virtual

Set objective function sense (1 for min (default), -1 for max,).

Definition at line 721 of file OsiClpSolverInterface.hpp.

## setColSolution()

virtual void OsiClpSolverInterface::setColSolution | ( | const double * | colsol | ) |

virtual

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.

## setRowPrice()

virtual void OsiClpSolverInterface::setRowPrice | ( | const double * | rowprice | ) |

virtual

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.

## addCol() [1/4]

virtual void OsiClpSolverInterface::addCol | ( | const CoinPackedVectorBase & | vec,
|  | const double | collb,
|  | const double | colub,
|  | const double | obj )

virtual

## addCol() [2/4]

virtual void OsiClpSolverInterface::addCol | ( | const CoinPackedVectorBase & | vec,
|  | const double | collb,
|  | const double | colub,
|  | const double | obj,
|  | std::string | name )

virtual

Add a named column (primal variable) to the problem.

## addCol() [3/4]

virtual void OsiClpSolverInterface::addCol | ( | int | numberElements,
|  | const int * | rows,
|  | const double * | elements,
|  | const double | collb,
|  | const double | colub,
|  | const double | obj )

virtual

Add a column (primal variable) to the problem.

## addCol() [4/4]

virtual void OsiClpSolverInterface::addCol | ( | int | numberElements,
|  | const int * | rows,
|  | const double * | elements,
|  | const double | collb,
|  | const double | colub,
|  | const double | obj,
|  | std::string | name )

virtual

Add a named column (primal variable) to the problem.

## addCols() [1/2]

virtual void OsiClpSolverInterface::addCols | ( | const int | numcols,
|  | const CoinPackedVectorBase *const * | cols,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj )

virtual

## addCols() [2/2]

virtual void OsiClpSolverInterface::addCols | ( | const int | numcols,
|  | const CoinBigIndex * | columnStarts,
|  | const int * | rows,
|  | const double * | elements,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj )

virtual

## deleteCols()

virtual void OsiClpSolverInterface::deleteCols | ( | const int | num,
|  | const int * | colIndices )

virtual

## addRow() [1/5]

virtual void OsiClpSolverInterface::addRow | ( | const CoinPackedVectorBase & | vec,
|  | const double | rowlb,
|  | const double | rowub )

virtual

## addRow() [2/5]

virtual void OsiClpSolverInterface::addRow | ( | const CoinPackedVectorBase & | vec,
|  | const double | rowlb,
|  | const double | rowub,
|  | std::string | name )

virtual

Add a named row (constraint) to the problem.

The default implementation adds the row, then changes the name. This can surely be made more efficient within an OsiXXX class.

## addRow() [3/5]

virtual void OsiClpSolverInterface::addRow | ( | const CoinPackedVectorBase & | vec,
|  | const char | rowsen,
|  | const double | rowrhs,
|  | const double | rowrng )

virtual

## addRow() [4/5]

virtual void OsiClpSolverInterface::addRow | ( | int | numberElements,
|  | const int * | columns,
|  | const double * | element,
|  | const double | rowlb,
|  | const double | rowub )

virtual

Add a row (constraint) to the problem.

## addRow() [5/5]

virtual void OsiClpSolverInterface::addRow | ( | const CoinPackedVectorBase & | vec,
|  | const char | rowsen,
|  | const double | rowrhs,
|  | const double | rowrng,
|  | std::string | name )

virtual

Add a named row (constraint) to the problem.

## addRows() [1/3]

virtual void OsiClpSolverInterface::addRows | ( | const int | numrows,
|  | const CoinPackedVectorBase *const * | rows,
|  | const double * | rowlb,
|  | const double * | rowub )

virtual

## addRows() [2/3]

virtual void OsiClpSolverInterface::addRows | ( | const int | numrows,
|  | const CoinPackedVectorBase *const * | rows,
|  | const char * | rowsen,
|  | const double * | rowrhs,
|  | const double * | rowrng )

virtual

## addRows() [3/3]

virtual void OsiClpSolverInterface::addRows | ( | const int | numrows,
|  | const CoinBigIndex * | rowStarts,
|  | const int * | columns,
|  | const double * | element,
|  | const double * | rowlb,
|  | const double * | rowub )

virtual

## modifyCoefficient()

void OsiClpSolverInterface::modifyCoefficient | ( | int | row,
|  | int | column,
|  | double | newElement,
|  | bool | keepZero = false )

inline

Definition at line 827 of file OsiClpSolverInterface.hpp.

## deleteRows()

virtual void OsiClpSolverInterface::deleteRows | ( | const int | num,
|  | const int * | rowIndices )

virtual

## saveBaseModel()

virtual void OsiClpSolverInterface::saveBaseModel | ( |  | ) |

virtual

If solver wants it can save a copy of "base" (continuous) model here.

## restoreBaseModel()

virtual void OsiClpSolverInterface::restoreBaseModel | ( | int | numberRows | ) |

virtual

Strip off rows to get to this number of rows.

If solver wants it can restore a copy of "base" (continuous) model here

## applyRowCuts() [1/2]

virtual void OsiClpSolverInterface::applyRowCuts | ( | int | numberCuts,
|  | const OsiRowCut * | cuts )

virtual

Apply a collection of row cuts which are all effective.

applyCuts seems to do one at a time which seems inefficient.

## applyRowCuts() [2/2]

virtual void OsiClpSolverInterface::applyRowCuts | ( | int | numberCuts,
|  | const OsiRowCut ** | cuts )

virtual

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

## applyCuts()

virtual ApplyCutsReturnCode OsiClpSolverInterface::applyCuts | ( | const OsiCuts & | cs,
|  | double | effectivenessLb = 0.0 )

virtual

Apply a collection of cuts.

Only cuts which have an `effectiveness >= effectivenessLb` are applied.

- ReturnCode.getNumineffective() – number of cuts which were not applied because they had an `effectiveness < effectivenessLb`
- ReturnCode.getNuminconsistent() – number of invalid cuts
- ReturnCode.getNuminconsistentWrtIntegerModel() – number of cuts that are invalid with respect to this integer model
- ReturnCode.getNuminfeasible() – number of cuts that would make this integer model infeasible
- ReturnCode.getNumApplied() – number of integer cuts which were applied to the integer model
- cs.size() == getNumineffective() + getNuminconsistent() + getNuminconsistentWrtIntegerModel() + getNuminfeasible() + getNumApplied()

## loadProblem() [1/5]

virtual void OsiClpSolverInterface::loadProblem | ( | const CoinPackedMatrix & | matrix,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj,
|  | const double * | rowlb,
|  | const double * | rowub )

virtual

Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds).

If a pointer is NULL then the following values are the default:

- `colub`: all columns have upper bound infinity
- `collb`: all columns have lower bound 0
- `rowub`: all rows have upper bound infinity
- `rowlb`: all rows have lower bound -infinity
- `obj`: all variables have 0 objective coefficient

## assignProblem() [1/2]

virtual void OsiClpSolverInterface::assignProblem | ( | CoinPackedMatrix *& | matrix,
|  | double *& | collb,
|  | double *& | colub,
|  | double *& | obj,
|  | double *& | rowlb,
|  | double *& | rowub )

virtual

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.
WARNING: The arguments passed to this method will be freed using the C++ `delete` and `delete[]` functions.

## loadProblem() [2/5]

virtual void OsiClpSolverInterface::loadProblem | ( | const CoinPackedMatrix & | matrix,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj,
|  | const char * | rowsen,
|  | const double * | rowrhs,
|  | const double * | rowrng )

virtual

Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets).

If a pointer is NULL then the following values are the default:

- `colub`: all columns have upper bound infinity
- `collb`: all columns have lower bound 0
- `obj`: all variables have 0 objective coefficient
- `rowsen`: all rows are >=
- `rowrhs`: all right hand sides are 0
- `rowrng`: 0 for the ranged rows

## assignProblem() [2/2]

virtual void OsiClpSolverInterface::assignProblem | ( | CoinPackedMatrix *& | matrix,
|  | double *& | collb,
|  | double *& | colub,
|  | double *& | obj,
|  | char *& | rowsen,
|  | double *& | rowrhs,
|  | double *& | rowrng )

virtual

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.
WARNING: The arguments passed to this method will be freed using the C++ `delete` and `delete[]` functions.

## loadProblem() [3/5]

virtual void OsiClpSolverInterface::loadProblem | ( | const ClpMatrixBase & | matrix,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj,
|  | const double * | rowlb,
|  | const double * | rowub )

virtual

Just like the other loadProblem() methods except that the matrix is given as a ClpMatrixBase.

## loadProblem() [4/5]

virtual void OsiClpSolverInterface::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 )

virtual

Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps).

## loadProblem() [5/5]

virtual void OsiClpSolverInterface::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 )

virtual

Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps).

## loadFromCoinModel()

virtual int OsiClpSolverInterface::loadFromCoinModel | ( | CoinModel & | modelObject,
|  | bool | keepSolution = false )

virtual

This loads a model from a coinModel object - returns number of errors.

## readMps() [1/3]

virtual int OsiClpSolverInterface::readMps | ( | const char * | filename,
|  | const char * | extension = "mps" )

virtual

Read an mps file from the given filename (defaults to Osi reader) - returns number of errors (see OsiMpsReader class).

## readMps() [2/3]

int OsiClpSolverInterface::readMps | ( | const char * | filename,
|  | bool | keepNames,
|  | bool | allowErrors )

Read an mps file from the given filename returns number of errors (see OsiMpsReader class).

## readMps() [3/3]

virtual int OsiClpSolverInterface::readMps | ( | const char * | filename,
|  | const char * | extension,
|  | int & | numberSets,
|  | CoinSet **& | sets )

virtual

Read an mps file.

## writeMps()

virtual void OsiClpSolverInterface::writeMps | ( | const char * | filename,
|  | const char * | extension = "mps",
|  | double | objSense = 0.0 ) const

virtual

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

## writeMpsNative()

virtual int OsiClpSolverInterface::writeMpsNative | ( | const char * | filename,
|  | const char ** | rowNames,
|  | const char ** | columnNames,
|  | int | formatType = 0,
|  | int | numberAcross = 2,
|  | double | objSense = 0.0 ) const

virtual

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

## readLp()

virtual int OsiClpSolverInterface::readLp | ( | const char * | filename,
|  | const double | epsilon = 1e-5 )

virtual

Read file in LP format (with names).

## writeLp() [1/2]

virtual void OsiClpSolverInterface::writeLp | ( | const char * | filename,
|  | const char * | extension = "lp",
|  | double | epsilon = 1e-5,
|  | int | numberAcross = 10,
|  | int | decimals = 5,
|  | double | objSense = 0.0,
|  | bool | useRowNames = true ) const

virtual

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

## writeLp() [2/2]

virtual void OsiClpSolverInterface::writeLp | ( | FILE * | fp,
|  | double | epsilon = 1e-5,
|  | int | numberAcross = 10,
|  | int | decimals = 5,
|  | double | objSense = 0.0,
|  | bool | useRowNames = true ) const

virtual

Write the problem into the file pointed to by the parameter fp.

Other parameters are similar to those of writeLp() with first parameter filename.

## replaceMatrixOptional()

virtual void OsiClpSolverInterface::replaceMatrixOptional | ( | const CoinPackedMatrix & | matrix | ) |

virtual

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

## replaceMatrix()

virtual void OsiClpSolverInterface::replaceMatrix | ( | const CoinPackedMatrix & | matrix | ) |

virtual

And if it does matter (not used at present).

## passInMessageHandler()

virtual void OsiClpSolverInterface::passInMessageHandler | ( | CoinMessageHandler * | handler | ) |

virtual

Pass in a message handler.

It is the client's responsibility to destroy a message handler installed by this routine; it will not be destroyed when the solver interface is destroyed.

## newLanguage()

void OsiClpSolverInterface::newLanguage | ( | CoinMessages::Language | language | ) |

Set language.

## setLanguage()

void OsiClpSolverInterface::setLanguage | ( | CoinMessages::Language | language | ) |

inline

Definition at line 1048 of file OsiClpSolverInterface.hpp.

## setLogLevel()

void OsiClpSolverInterface::setLogLevel | ( | int | value | ) |

Set log level (will also set underlying solver's log level).

## generateCpp()

void OsiClpSolverInterface::generateCpp | ( | FILE * | fp | ) |

Create C++ lines to get to current state.

## getModelPtr()

ClpSimplex * OsiClpSolverInterface::getModelPtr | ( |  | ) | const

Get pointer to Clp model.

## swapModelPtr()

ClpSimplex * OsiClpSolverInterface::swapModelPtr | ( | ClpSimplex * | newModel | ) |

inline

Set pointer to Clp model and return old.

Definition at line 1064 of file OsiClpSolverInterface.hpp.

## specialOptions()

unsigned int OsiClpSolverInterface::specialOptions | ( |  | ) | const

inline

Get special options.

Definition at line 1071 of file OsiClpSolverInterface.hpp.

## setSpecialOptions()

void OsiClpSolverInterface::setSpecialOptions | ( | unsigned int | value | ) |

## lastAlgorithm()

int OsiClpSolverInterface::lastAlgorithm | ( |  | ) | const

inline

Last algorithm used , 1 = primal, 2 = dual other unknown.

Definition at line 1077 of file OsiClpSolverInterface.hpp.

## setLastAlgorithm()

void OsiClpSolverInterface::setLastAlgorithm | ( | int | value | ) |

inline

Set last algorithm used , 1 = primal, 2 = dual other unknown.

Definition at line 1082 of file OsiClpSolverInterface.hpp.

## cleanupScaling()

int OsiClpSolverInterface::cleanupScaling | ( |  | ) | const

inline

Get scaling action option.

Definition at line 1087 of file OsiClpSolverInterface.hpp.

## setCleanupScaling()

void OsiClpSolverInterface::setCleanupScaling | ( | int | value | ) |

inline

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 1103 of file OsiClpSolverInterface.hpp.

## smallestElementInCut()

double OsiClpSolverInterface::smallestElementInCut | ( |  | ) | const

inline

Get smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1109 of file OsiClpSolverInterface.hpp.

## setSmallestElementInCut()

void OsiClpSolverInterface::setSmallestElementInCut | ( | double | value | ) |

inline

Set smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1115 of file OsiClpSolverInterface.hpp.

## smallestChangeInCut()

double OsiClpSolverInterface::smallestChangeInCut | ( |  | ) | const

inline

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 1125 of file OsiClpSolverInterface.hpp.

## setSmallestChangeInCut()

void OsiClpSolverInterface::setSmallestChangeInCut | ( | double | value | ) |

inline

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 1135 of file OsiClpSolverInterface.hpp.

## setSolveOptions()

void OsiClpSolverInterface::setSolveOptions | ( | const ClpSolve & | options | ) |

inline

Pass in initial solve options.

Definition at line 1140 of file OsiClpSolverInterface.hpp.

## tightenBounds()

virtual int OsiClpSolverInterface::tightenBounds | ( | int | lightweight = 0 | ) |

virtual

Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers, 2 lightweight and all.

## infeasibleOtherWay()

int OsiClpSolverInterface::infeasibleOtherWay | ( | char * | whichWay | ) |

See if any integer variables make infeasible other way.

## getSizeL()

virtual CoinBigIndex OsiClpSolverInterface::getSizeL | ( |  | ) | const

virtual

Return number of entries in L part of current factorization.

## getSizeU()

virtual CoinBigIndex OsiClpSolverInterface::getSizeU | ( |  | ) | const

virtual

Return number of entries in U part of current factorization.

## disasterHandler()

const OsiClpDisasterHandler * OsiClpSolverInterface::disasterHandler | ( |  | ) | const

inline

Get disaster handler.

Definition at line 1155 of file OsiClpSolverInterface.hpp.

## passInDisasterHandler()

void OsiClpSolverInterface::passInDisasterHandler | ( | OsiClpDisasterHandler * | handler | ) |

Pass in disaster handler.

## fakeObjective()

ClpLinearObjective * OsiClpSolverInterface::fakeObjective | ( |  | ) | const

inline

Get fake objective.

Definition at line 1162 of file OsiClpSolverInterface.hpp.

## setFakeObjective() [1/2]

void OsiClpSolverInterface::setFakeObjective | ( | ClpLinearObjective * | fakeObjective | ) |

Set fake objective (and take ownership).

## setFakeObjective() [2/2]

void OsiClpSolverInterface::setFakeObjective | ( | double * | fakeObjective | ) |

Set fake objective.

## setupForRepeatedUse()

void OsiClpSolverInterface::setupForRepeatedUse | ( | int | senseOfAdventure = 0,
|  | int | printOut = 0 )

Set 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.

`senseOfAdventure:`

- 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

## synchronizeModel()

virtual void OsiClpSolverInterface::synchronizeModel | ( |  | ) |

virtual

Synchronize model (really if no cuts in tree).

## setSpecialOptionsMutable()

void OsiClpSolverInterface::setSpecialOptionsMutable | ( | unsigned int | value | ) | const

Set special options in underlying clp solver.

Safe as const because modelPtr_ is mutable.

## clone()

virtual OsiSolverInterface * OsiClpSolverInterface::clone | ( | bool | copyData = true | ) | const

virtual

Clone.

## releaseClp()

void OsiClpSolverInterface::releaseClp | ( |  | ) |

Releases so won't error.

## operator=()

OsiClpSolverInterface & OsiClpSolverInterface::operator= | ( | const OsiClpSolverInterface & | rhs | ) |

Assignment operator.

## reset()

virtual void OsiClpSolverInterface::reset | ( |  | ) |

virtual

Resets as if default constructor.

## applyRowCut()

virtual void OsiClpSolverInterface::applyRowCut | ( | const OsiRowCut & | rc | ) |

protected virtual

Apply a row cut (append to constraint matrix).

## applyColCut()

virtual void OsiClpSolverInterface::applyColCut | ( | const OsiColCut & | cc | ) |

protected virtual

Apply a column cut (adjust one or more bounds).

## gutsOfDestructor()

void OsiClpSolverInterface::gutsOfDestructor | ( |  | ) |

protected

The real work of a copy constructor (used by copy and assignment).

## freeCachedResults()

void OsiClpSolverInterface::freeCachedResults | ( |  | ) | const

protected

Deletes all mutable stuff.

## freeCachedResults0()

void OsiClpSolverInterface::freeCachedResults0 | ( |  | ) | const

protected

Deletes all mutable stuff for row ranges etc.

## freeCachedResults1()

void OsiClpSolverInterface::freeCachedResults1 | ( |  | ) | const

protected

Deletes all mutable stuff for matrix etc.

## extractSenseRhsRange()

void OsiClpSolverInterface::extractSenseRhsRange | ( |  | ) | const

protected

A method that fills up the rowsense_, rhs_ and rowrange_ arrays.

## fillParamMaps()

void OsiClpSolverInterface::fillParamMaps | ( |  | ) |

protected

## getBasis() [1/2]

CoinWarmStartBasis OsiClpSolverInterface::getBasis | ( | ClpSimplex * | model | ) | const

protected

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

## setBasis() [1/3]

void OsiClpSolverInterface::setBasis | ( | const CoinWarmStartBasis & | basis,
|  | ClpSimplex * | model )

protected

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()

void OsiClpSolverInterface::crunch | ( |  | ) |

protected

Crunch down problem a bit.

## redoScaleFactors()

void OsiClpSolverInterface::redoScaleFactors | ( | int | numberRows,
|  | const CoinBigIndex * | starts,
|  | const int * | indices,
|  | const double * | elements )

protected

Extend scale factors.

## setBasis() [2/3]

void OsiClpSolverInterface::setBasis | ( | const CoinWarmStartBasis & | basis | ) |

Sets up working basis as a copy of input and puts in as basis.

## setBasis() [3/3]

void OsiClpSolverInterface::setBasis | ( |  | ) |

inline

Just puts current basis_ into ClpSimplex model.

Definition at line 1292 of file OsiClpSolverInterface.hpp.

## getBasisDiff()

CoinWarmStartDiff * OsiClpSolverInterface::getBasisDiff | ( | const unsigned char * | statusArray | ) | const

Warm start difference from basis_ to statusArray.

## getBasis() [2/2]

CoinWarmStartBasis * OsiClpSolverInterface::getBasis | ( | const unsigned char * | statusArray | ) | const

Warm start from statusArray.

## deleteScaleFactors()

void OsiClpSolverInterface::deleteScaleFactors | ( |  | ) |

Delete all scale factor stuff and reset option.

## upRange()

const double * OsiClpSolverInterface::upRange | ( |  | ) | const

inline

If doing fast hot start then ranges are computed.

Definition at line 1303 of file OsiClpSolverInterface.hpp.

## downRange()

const double * OsiClpSolverInterface::downRange | ( |  | ) | const

inline

Definition at line 1307 of file OsiClpSolverInterface.hpp.

## passInRanges()

void OsiClpSolverInterface::passInRanges | ( | int * | array | ) |

inline

Pass in range array.

Definition at line 1312 of file OsiClpSolverInterface.hpp.

## setSOSData()

void OsiClpSolverInterface::setSOSData | ( | int | numberSOS,
|  | const char * | type,
|  | const int * | start,
|  | const int * | indices,
|  | const double * | weights = NULL )

Pass in sos stuff from AMPl.

## computeLargestAway()

void OsiClpSolverInterface::computeLargestAway | ( |  | ) |

Compute largest amount any at continuous away from bound.

## largestAway()

double OsiClpSolverInterface::largestAway | ( |  | ) | const

inline

Get largest amount continuous away from bound.

Definition at line 1322 of file OsiClpSolverInterface.hpp.

## setLargestAway()

void OsiClpSolverInterface::setLargestAway | ( | double | value | ) |

inline

Set largest amount continuous away from bound.

Definition at line 1327 of file OsiClpSolverInterface.hpp.

## lexSolve()

void OsiClpSolverInterface::lexSolve | ( |  | ) |

Sort of lexicographic resolve.

## getContinuousModel()

ClpSimplex * OsiClpSolverInterface::getContinuousModel | ( |  | ) | const

inline

Get continuous model.

Definition at line 1334 of file OsiClpSolverInterface.hpp.

## setContinuousModel()

void OsiClpSolverInterface::setContinuousModel | ( | ClpSimplex * | model | ) |

inline

Set continuous model.

Definition at line 1339 of file OsiClpSolverInterface.hpp.

## Friends And Related Symbol Documentation

## OsiClpSolverInterfaceUnitTest

void OsiClpSolverInterfaceUnitTest | ( | const std::string & | mpsDir,
|  | const std::string & | netlibDir )

friend

A function that tests the methods in the OsiClpSolverInterface class.

## Member Data Documentation

## modelPtr_

ClpSimplex* OsiClpSolverInterface::modelPtr_

mutable protected

Clp model represented by this class instance.

Definition at line 1349 of file OsiClpSolverInterface.hpp.

## rowsense_

char* OsiClpSolverInterface::rowsense_

mutable protected

Pointer to dense vector of row sense indicators.

Definition at line 1354 of file OsiClpSolverInterface.hpp.

## rhs_

double* OsiClpSolverInterface::rhs_

mutable protected

Pointer to dense vector of row right-hand side values.

Definition at line 1357 of file OsiClpSolverInterface.hpp.

## rowrange_

double* OsiClpSolverInterface::rowrange_

mutable protected

Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows).

Definition at line 1362 of file OsiClpSolverInterface.hpp.

## ws_

CoinWarmStartBasis* OsiClpSolverInterface::ws_

mutable protected

A pointer to the warmstart information to be used in the hotstarts.

This is NOT efficient and more thought should be given to it...

Definition at line 1366 of file OsiClpSolverInterface.hpp.

## rowActivity_

double* OsiClpSolverInterface::rowActivity_

mutable protected

also save row and column information for hot starts only used in hotstarts so can be casual

Definition at line 1369 of file OsiClpSolverInterface.hpp.

## columnActivity_

double* OsiClpSolverInterface::columnActivity_

mutable protected

Definition at line 1370 of file OsiClpSolverInterface.hpp.

## stuff_

ClpNodeStuff OsiClpSolverInterface::stuff_

protected

Stuff for fast dual.

Definition at line 1372 of file OsiClpSolverInterface.hpp.

## numberSOS_

int OsiClpSolverInterface::numberSOS_

protected

Number of SOS sets.

Definition at line 1374 of file OsiClpSolverInterface.hpp.

## setInfo_

CoinSet* OsiClpSolverInterface::setInfo_

protected

SOS set info.

Definition at line 1376 of file OsiClpSolverInterface.hpp.

## smallModel_

ClpSimplex* OsiClpSolverInterface::smallModel_

protected

Alternate model (hot starts) - but also could be permanent and used for crunch.

Definition at line 1378 of file OsiClpSolverInterface.hpp.

## factorization_

ClpFactorization* OsiClpSolverInterface::factorization_

protected

factorization for hot starts

Definition at line 1380 of file OsiClpSolverInterface.hpp.

## smallestElementInCut_

double OsiClpSolverInterface::smallestElementInCut_

protected

Smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1383 of file OsiClpSolverInterface.hpp.

## smallestChangeInCut_

double OsiClpSolverInterface::smallestChangeInCut_

protected

Smallest change in cut.

If (upper-lower)*element < this then element is taken out and cut relaxed.

Definition at line 1387 of file OsiClpSolverInterface.hpp.

## largestAway_

double OsiClpSolverInterface::largestAway_

protected

Largest amount continuous away from bound.

Definition at line 1389 of file OsiClpSolverInterface.hpp.

## spareArrays_

char* OsiClpSolverInterface::spareArrays_

protected

Arrays for hot starts.

Definition at line 1391 of file OsiClpSolverInterface.hpp.

## basis_

CoinWarmStartBasis OsiClpSolverInterface::basis_

protected

Warmstart information to be used in resolves.

Definition at line 1393 of file OsiClpSolverInterface.hpp.

## itlimOrig_

int OsiClpSolverInterface::itlimOrig_

protected

The original iteration limit before hotstarts started.

Definition at line 1395 of file OsiClpSolverInterface.hpp.

## lastAlgorithm_

int OsiClpSolverInterface::lastAlgorithm_

mutable protected

Last algorithm used.

Coded as

- 0 invalid
- 1 primal
- 2 dual
- -911 disaster in the algorithm that was attempted
- 999 current solution no longer optimal due to change in problem or basis

Definition at line 1407 of file OsiClpSolverInterface.hpp.

## notOwned_

bool OsiClpSolverInterface::notOwned_

protected

To say if destructor should delete underlying model.

Definition at line 1410 of file OsiClpSolverInterface.hpp.

## matrixByRow_

CoinPackedMatrix* OsiClpSolverInterface::matrixByRow_

mutable protected

Pointer to row-wise copy of problem matrix coefficients.

Definition at line 1413 of file OsiClpSolverInterface.hpp.

## matrixByRowAtContinuous_

CoinPackedMatrix* OsiClpSolverInterface::matrixByRowAtContinuous_

protected

Pointer to row-wise copy of continuous problem matrix coefficients.

Definition at line 1416 of file OsiClpSolverInterface.hpp.

## integerInformation_

char* OsiClpSolverInterface::integerInformation_

protected

Pointer to integer information.

Definition at line 1419 of file OsiClpSolverInterface.hpp.

## whichRange_

int* OsiClpSolverInterface::whichRange_

protected

Pointer to variables for which we want range information The number is in [0] memory is not owned by OsiClp.

Definition at line 1425 of file OsiClpSolverInterface.hpp.

## fakeMinInSimplex_

bool OsiClpSolverInterface::fakeMinInSimplex_

mutable protected

Faking min to get proper dual solution signs in simplex API.

Definition at line 1432 of file OsiClpSolverInterface.hpp.

## linearObjective_

double* OsiClpSolverInterface::linearObjective_

mutable protected

Linear objective.

Normally a pointer to the linear coefficient array in the clp objective. An independent copy when fakeMinInSimplex_ is true, because we need something permanent to point to when getObjCoefficients is called.

Definition at line 1439 of file OsiClpSolverInterface.hpp.

## saveData_

ClpDataSave OsiClpSolverInterface::saveData_

mutable protected

To save data in OsiSimplex stuff.

Definition at line 1442 of file OsiClpSolverInterface.hpp.

## solveOptions_

ClpSolve OsiClpSolverInterface::solveOptions_

protected

Options for initialSolve.

Definition at line 1444 of file OsiClpSolverInterface.hpp.

## cleanupScaling_

int OsiClpSolverInterface::cleanupScaling_

protected

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 1457 of file OsiClpSolverInterface.hpp.

## specialOptions_

unsigned int OsiClpSolverInterface::specialOptions_

mutable protected

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 (i.e., do not unscale, and do not return result in getBInv parameters; you have to know where to look for the answer) 1024 Don't "borrow" model in initialSolve 2048 Don't crunch 4096 quick check for optimality Bits above 8192 give where called from in Cbc At present 0 is normal, 1 doing fast hotstarts, 2 is can do quick check 65536 Keep simple i.e.

no crunch etc 131072 Try and keep scaling factors around 262144 Don't try and tighten bounds (funny global cuts) 524288 Fake objective and 0-1 1048576 Don't recompute ray after crunch 2097152 8388608 Odd integers e.g. semi-continuous

Definition at line 1486 of file OsiClpSolverInterface.hpp.

## baseModel_

ClpSimplex* OsiClpSolverInterface::baseModel_

protected

Copy of model when option 131072 set.

Definition at line 1488 of file OsiClpSolverInterface.hpp.

## lastNumberRows_

int OsiClpSolverInterface::lastNumberRows_

protected

Number of rows when last "scaled".

Definition at line 1490 of file OsiClpSolverInterface.hpp.

## continuousModel_

ClpSimplex* OsiClpSolverInterface::continuousModel_

protected

Continuous model.

Definition at line 1492 of file OsiClpSolverInterface.hpp.

## disasterHandler_

OsiClpDisasterHandler* OsiClpSolverInterface::disasterHandler_

protected

Possible disaster handler.

Definition at line 1494 of file OsiClpSolverInterface.hpp.

## fakeObjective_

ClpLinearObjective* OsiClpSolverInterface::fakeObjective_

protected

Fake objective.

Definition at line 1496 of file OsiClpSolverInterface.hpp.

## rowScale_

CoinDoubleArrayWithLength OsiClpSolverInterface::rowScale_

protected

Row scale factors (has inverse at end).

Definition at line 1498 of file OsiClpSolverInterface.hpp.

## columnScale_

CoinDoubleArrayWithLength OsiClpSolverInterface::columnScale_

protected

Column scale factors (has inverse at end).

Definition at line 1500 of file OsiClpSolverInterface.hpp.

The documentation for this class was generated from the following file:

- Clp/src/OsiClp/OsiClpSolverInterface.hpp