# OsiClpSolverInterface Class Reference

Clp Solver Interface. More...

`#include <OsiClpSolverInterface.hpp>`

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

List of all members.

## Public Member Functions
virtual void | setObjSense (double s)
| Set objective function sense (1 for min (default), -1 for max,).
virtual void | setColSolution (const double *colsol)
| Set the primal solution column values.
virtual void | setRowPrice (const double *rowprice)
| Set dual solution vector.
Solve methods
virtual void | initialSolve ()
| Solve initial LP relaxation.
virtual void | resolve ()
| Resolve an LP relaxation after problem modification.
virtual void | 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: 1.
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).
void | copyEnabledSuff (OsiClpSolverInterface &rhs)
| Copy across enabled stuff from one solver to another.
virtual void | disableSimplexInterface ()
| Undo setting changes made by enableSimplexInterface.
void | copyEnabledStuff (ClpSimplex &rhs)
| Copy across enabled stuff from one solver to another.
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)
| Set an integer parameter.
bool | setDblParam (OsiDblParam key, double value)
| Set a double parameter.
bool | setStrParam (OsiStrParam key, const std::string &value)
| Set a string parameter.
bool | getIntParam (OsiIntParam key, int &value) const
| Get an integer parameter.
bool | getDblParam (OsiDblParam key, double &value) const
| Get a double parameter.
bool | getStrParam (OsiStrParam key, std::string &value) const
| Get a string parameter.
virtual bool | setHintParam (OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL)
| Set a hint parameter.
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 int | 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.
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.
virtual int | findIntegersAndSOS (bool justCount)
| Identify integer variables and SOS and create corresponding objects.
Methods to expand a problem.<br>
Note that if a column is added then by default it will correspond to a continuous variable.
virtual void | addCol (const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
| Add a named column (primal variable) to the problem.
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)
| Add a named column (primal variable) to the problem.
virtual void | addCols (const int numcols, const int *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
| Add a named column (primal variable) to the problem.
virtual void | deleteCols (const int num, const int *colIndices)
| Add a named column (primal variable) to the problem.
virtual void | addRow (const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
| Add a named column (primal variable) to the problem.
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)
| Add a named column (primal variable) to the problem.
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)
| Add a named column (primal variable) to the problem.
virtual void | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
| Add a named column (primal variable) to the problem.
virtual void | addRows (const int numrows, const int *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub)
| Add a named column (primal variable) to the problem.
void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
| Add a named column (primal variable) to the problem.
virtual void | deleteRows (const int num, const int *rowIndices)
| Add a named column (primal variable) to the problem.
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)
| Pass in a message handler.
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)
| Get pointer to Clp model.
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_
| Pointer to dense vector of row sense indicators.
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
| Sets up working basis as a copy of input and puts in as basis.
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.
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 ()
| Sets up working basis as a copy of input and puts in as basis.
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 38 of file OsiClpSolverInterface.hpp.

## Constructor & Destructor Documentation

OsiClpSolverInterface::OsiClpSolverInterface | ( |  | ) |

Default Constructor.

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

Copy constructor.

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

Borrow constructor - only delete one copy.

virtual OsiClpSolverInterface::~OsiClpSolverInterface | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual void OsiClpSolverInterface::initialSolve | ( |  | ) | `[virtual]`

Solve initial LP relaxation.

Implements OsiSolverInterface.

virtual void OsiClpSolverInterface::resolve | ( |  | ) | `[virtual]`

Resolve an LP relaxation after problem modification.

Implements OsiSolverInterface.

virtual void OsiClpSolverInterface::resolveGub | ( | int | needed | ) | `[virtual]`

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

virtual void OsiClpSolverInterface::branchAndBound | ( |  | ) | `[virtual]`

Invoke solver's built-in enumeration algorithm.

Implements OsiSolverInterface.

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.

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::disableFactorization | ( |  | ) | const`[virtual]`

Undo any setting changes made by enableFactorization.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Get the reduced gradient for the cost vector c.

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

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

Get a row of the basis inverse.

Reimplemented from OsiSolverInterface.

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

Get a column of the tableau.

Reimplemented from OsiSolverInterface.

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

Get a column of the tableau.

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

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

Get a column of the basis inverse.

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

void OsiClpSolverInterface::copyEnabledSuff | ( | OsiClpSolverInterface & | rhs | ) |

Copy across enabled stuff from one solver to another.

virtual void OsiClpSolverInterface::disableSimplexInterface | ( |  | ) | `[virtual]`

Undo setting changes made by enableSimplexInterface.

Reimplemented from OsiSolverInterface.

void OsiClpSolverInterface::copyEnabledStuff | ( | ClpSimplex & | rhs | ) |

Copy across enabled stuff from one solver to another.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

bool OsiClpSolverInterface::setIntParam | ( | OsiIntParam | key,
|  | int | value |
| ) |  |  | `[virtual]`

Set an integer parameter.

Reimplemented from OsiSolverInterface.

bool OsiClpSolverInterface::setDblParam | ( | OsiDblParam | key,
|  | double | value |
| ) |  |  | `[virtual]`

Set a double parameter.

Reimplemented from OsiSolverInterface.

bool OsiClpSolverInterface::setStrParam | ( | OsiStrParam | key,
|  | const std::string & | value |
| ) |  |  | `[virtual]`

Set a string parameter.

Reimplemented from OsiSolverInterface.

bool OsiClpSolverInterface::getIntParam | ( | OsiIntParam | key,
|  | int & | value |
| ) |  |  | const`[virtual]`

Get an integer parameter.

Reimplemented from OsiSolverInterface.

bool OsiClpSolverInterface::getDblParam | ( | OsiDblParam | key,
|  | double & | value |
| ) |  |  | const`[virtual]`

Get a double parameter.

Reimplemented from OsiSolverInterface.

bool OsiClpSolverInterface::getStrParam | ( | OsiStrParam | key,
|  | std::string & | value |
| ) |  |  | const`[virtual]`

Get a string parameter.

Reimplemented from OsiSolverInterface.

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

Set a hint parameter.

The `otherInformation` parameter can be used to pass in an arbitrary block of information which is interpreted by the OSI and the underlying solver. Users are cautioned that this hook is solver-specific.

Implementors: The default implementation completely ignores `otherInformation` and always throws an exception for OsiForceDo. This is almost certainly not the behaviour you want; you really should override this method.

Reimplemented from OsiSolverInterface.

virtual bool OsiClpSolverInterface::isAbandoned | ( |  | ) | const`[virtual]`

Are there a numerical difficulties?

Implements OsiSolverInterface.

virtual bool OsiClpSolverInterface::isProvenOptimal | ( |  | ) | const`[virtual]`

Is optimality proven?

Implements OsiSolverInterface.

virtual bool OsiClpSolverInterface::isProvenPrimalInfeasible | ( |  | ) | const`[virtual]`

Is primal infeasiblity proven?

Implements OsiSolverInterface.

virtual bool OsiClpSolverInterface::isProvenDualInfeasible | ( |  | ) | const`[virtual]`

Is dual infeasiblity proven?

Implements OsiSolverInterface.

virtual bool OsiClpSolverInterface::isPrimalObjectiveLimitReached | ( |  | ) | const`[virtual]`

Is the given primal objective limit reached?

Reimplemented from OsiSolverInterface.

virtual bool OsiClpSolverInterface::isDualObjectiveLimitReached | ( |  | ) | const`[virtual]`

Is the given dual objective limit reached?

Reimplemented from OsiSolverInterface.

virtual bool OsiClpSolverInterface::isIterationLimitReached | ( |  | ) | const`[virtual]`

Iteration limit reached?

Implements OsiSolverInterface.

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.

Implements OsiSolverInterface.

virtual CoinWarmStart* OsiClpSolverInterface::getWarmStart | ( |  | ) | const`[virtual]`

Get warmstarting information.

Implements OsiSolverInterface.

CoinWarmStartBasis* OsiClpSolverInterface::getPointerToWarmStart | ( |  | ) | `[inline]`

Get warmstarting information.

Definition at line 292 of file OsiClpSolverInterface.hpp.

const CoinWarmStartBasis* OsiClpSolverInterface::getConstPointerToWarmStart | ( |  | ) | const`[inline]`

Get warmstarting information.

Definition at line 295 of file OsiClpSolverInterface.hpp.

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

Set warmstarting information.

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

Implements OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

Set column status in ClpSimplex and warmStart.

virtual void OsiClpSolverInterface::markHotStart | ( |  | ) | `[virtual]`

Create a hotstart point of the optimization process.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::solveFromHotStart | ( |  | ) | `[virtual]`

Optimize starting from the hotstart.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::unmarkHotStart | ( |  | ) | `[virtual]`

Delete the snapshot.

Reimplemented from OsiSolverInterface.

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.

void OsiClpSolverInterface::stopFastDual | ( |  | ) |

Stop fast dual.

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

Sets integer tolerance and increment.

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.

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.

virtual int OsiClpSolverInterface::getNumCols | ( |  | ) | const`[inline, virtual]`

Get number of columns.

Implements OsiSolverInterface.

Definition at line 370 of file OsiClpSolverInterface.hpp.

virtual int OsiClpSolverInterface::getNumRows | ( |  | ) | const`[inline, virtual]`

Get number of rows.

Implements OsiSolverInterface.

Definition at line 374 of file OsiClpSolverInterface.hpp.

virtual int OsiClpSolverInterface::getNumElements | ( |  | ) | const`[inline, virtual]`

Get number of nonzero elements.

Implements OsiSolverInterface.

Definition at line 378 of file OsiClpSolverInterface.hpp.

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!

Reimplemented from OsiSolverInterface.

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!

Reimplemented from OsiSolverInterface.

virtual const double* OsiClpSolverInterface::getColLower | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 396 of file OsiClpSolverInterface.hpp.

virtual const double* OsiClpSolverInterface::getColUpper | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 399 of file OsiClpSolverInterface.hpp.

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

Implements OsiSolverInterface.

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

Implements OsiSolverInterface.

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

Implements OsiSolverInterface.

virtual const double* OsiClpSolverInterface::getRowLower | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 433 of file OsiClpSolverInterface.hpp.

virtual const double* OsiClpSolverInterface::getRowUpper | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 436 of file OsiClpSolverInterface.hpp.

virtual const double* OsiClpSolverInterface::getObjCoefficients | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 439 of file OsiClpSolverInterface.hpp.

virtual double OsiClpSolverInterface::getObjSense | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 446 of file OsiClpSolverInterface.hpp.

virtual bool OsiClpSolverInterface::isContinuous | ( | int | colNumber | ) | const`[virtual]`

Return true if column is continuous.

Implements OsiSolverInterface.

virtual bool OsiClpSolverInterface::isBinary | ( | int | colIndex | ) | const`[virtual]`

Return true if variable is binary.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

virtual bool OsiClpSolverInterface::isIntegerNonBinary | ( | int | colIndex | ) | const`[virtual]`

Return true if variable is general integer.

Reimplemented from OsiSolverInterface.

virtual bool OsiClpSolverInterface::isFreeBinary | ( | int | colIndex | ) | const`[virtual]`

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

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

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

virtual const CoinPackedMatrix* OsiClpSolverInterface::getMatrixByRow | ( |  | ) | const`[virtual]`

Get pointer to row-wise copy of matrix.

Implements OsiSolverInterface.

virtual const CoinPackedMatrix* OsiClpSolverInterface::getMatrixByCol | ( |  | ) | const`[virtual]`

Get pointer to column-wise copy of matrix.

Implements OsiSolverInterface.

virtual CoinPackedMatrix* OsiClpSolverInterface::getMutableMatrixByCol | ( |  | ) | const`[virtual]`

Get pointer to mutable column-wise copy of matrix.

Reimplemented from OsiSolverInterface.

virtual double OsiClpSolverInterface::getInfinity | ( |  | ) | const`[inline, virtual]`

Get solver's value for infinity.

Implements OsiSolverInterface.

Definition at line 492 of file OsiClpSolverInterface.hpp.

virtual const double* OsiClpSolverInterface::getColSolution | ( |  | ) | const`[virtual]`

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

Implements OsiSolverInterface.

virtual const double* OsiClpSolverInterface::getRowPrice | ( |  | ) | const`[virtual]`

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

Implements OsiSolverInterface.

virtual const double* OsiClpSolverInterface::getReducedCost | ( |  | ) | const`[virtual]`

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

Implements OsiSolverInterface.

virtual const double* OsiClpSolverInterface::getRowActivity | ( |  | ) | const`[virtual]`

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

Implements OsiSolverInterface.

virtual double OsiClpSolverInterface::getObjValue | ( |  | ) | const`[virtual]`

Get objective function value.

Implements OsiSolverInterface.

virtual int OsiClpSolverInterface::getIterationCount | ( |  | ) | const`[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 515 of file OsiClpSolverInterface.hpp.

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[].

Implements OsiSolverInterface.

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[].

Implements OsiSolverInterface.

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

Set an objective function coefficient.

Implements OsiSolverInterface.

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

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

Implements OsiSolverInterface.

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

Set a single column upper bound
Use DBL_MAX for infinity.

Implements OsiSolverInterface.

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

Set a single column lower and upper bound.

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

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

Implements OsiSolverInterface.

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

Set a single row upper bound
Use DBL_MAX for infinity.

Implements OsiSolverInterface.

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

Set a single row lower and upper bound.

Reimplemented from OsiSolverInterface.

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

Set the type of a single row
.

Implements OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

Set name of row.

Reimplemented from OsiSolverInterface.

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

Set name of column.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::setContinuous | ( | int | index | ) | `[virtual]`

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

Implements OsiSolverInterface.

virtual void OsiClpSolverInterface::setInteger | ( | int | index | ) | `[virtual]`

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

Implements OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

int OsiClpSolverInterface::numberSOS | ( |  | ) | const`[inline]`

Number of SOS sets.

Definition at line 674 of file OsiClpSolverInterface.hpp.

const CoinSet* OsiClpSolverInterface::setInfo | ( |  | ) | const`[inline]`

SOS set info.

Definition at line 677 of file OsiClpSolverInterface.hpp.

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

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::setObjSense | ( | double | s | ) | `[inline, virtual]`

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

Implements OsiSolverInterface.

Definition at line 693 of file OsiClpSolverInterface.hpp.

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.

Implements OsiSolverInterface.

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.

Implements OsiSolverInterface.

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

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

Implements OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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

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

Implements OsiSolverInterface.

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

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

Implements OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

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

Implements OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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

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

Definition at line 797 of file OsiClpSolverInterface.hpp.

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

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

Implements OsiSolverInterface.

virtual void OsiClpSolverInterface::saveBaseModel | ( |  | ) | `[virtual]`

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Implements OsiSolverInterface.

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.

Implements OsiSolverInterface.

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

Implements OsiSolverInterface.

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.

Implements OsiSolverInterface.

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.

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

Implements OsiSolverInterface.

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

Implements OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

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

Read an mps file.

Reimplemented from OsiSolverInterface.

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

Implements OsiSolverInterface.

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

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

Read file in LP format (with names).

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

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

Reimplemented from OsiSolverInterface.

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.

Reimplemented from OsiSolverInterface.

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

Set language.

Reimplemented from OsiSolverInterface.

void OsiClpSolverInterface::setLanguage | ( | CoinMessages::Language | language | ) | `[inline]`

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.

Reimplemented from OsiSolverInterface.

Definition at line 1018 of file OsiClpSolverInterface.hpp.

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

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

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

Create C++ lines to get to current state.

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

Get pointer to Clp model.

ClpSimplex* OsiClpSolverInterface::swapModelPtr | ( | ClpSimplex * | newModel | ) | `[inline]`

Set pointer to Clp model and return old.

Definition at line 1032 of file OsiClpSolverInterface.hpp.

unsigned int OsiClpSolverInterface::specialOptions | ( |  | ) | const`[inline]`

Get special options.

Definition at line 1035 of file OsiClpSolverInterface.hpp.

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

Get pointer to Clp model.

int OsiClpSolverInterface::lastAlgorithm | ( |  | ) | const`[inline]`

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

Definition at line 1039 of file OsiClpSolverInterface.hpp.

void OsiClpSolverInterface::setLastAlgorithm | ( | int | value | ) | `[inline]`

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

Definition at line 1042 of file OsiClpSolverInterface.hpp.

int OsiClpSolverInterface::cleanupScaling | ( |  | ) | const`[inline]`

Get scaling action option.

Definition at line 1045 of file OsiClpSolverInterface.hpp.

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

double OsiClpSolverInterface::smallestElementInCut | ( |  | ) | const`[inline]`

Get smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1063 of file OsiClpSolverInterface.hpp.

void OsiClpSolverInterface::setSmallestElementInCut | ( | double | value | ) | `[inline]`

Set smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1067 of file OsiClpSolverInterface.hpp.

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

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

void OsiClpSolverInterface::setSolveOptions | ( | const ClpSolve & | options | ) | `[inline]`

Pass in initial solve options.

Definition at line 1086 of file OsiClpSolverInterface.hpp.

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.

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

See if any integer variables make infeasible other way.

virtual CoinBigIndex OsiClpSolverInterface::getSizeL | ( |  | ) | const`[virtual]`

Return number of entries in L part of current factorization.

virtual CoinBigIndex OsiClpSolverInterface::getSizeU | ( |  | ) | const`[virtual]`

Return number of entries in U part of current factorization.

const OsiClpDisasterHandler* OsiClpSolverInterface::disasterHandler | ( |  | ) | const`[inline]`

Get disaster handler.

Definition at line 1099 of file OsiClpSolverInterface.hpp.

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

Pass in disaster handler.

ClpLinearObjective* OsiClpSolverInterface::fakeObjective | ( |  | ) | const`[inline]`

Get fake objective.

Definition at line 1104 of file OsiClpSolverInterface.hpp.

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

Set fake objective (and take ownership).

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

Set fake objective.

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

virtual void OsiClpSolverInterface::synchronizeModel | ( |  | ) | `[virtual]`

Synchronize model (really if no cuts in tree).

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

Set special options in underlying clp solver.

Safe as const because modelPtr_ is mutable.

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

Clone.

Implements OsiSolverInterface.

void OsiClpSolverInterface::releaseClp | ( |  | ) |

Releases so won't error.

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

Assignment operator.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::reset | ( |  | ) | `[virtual]`

Resets as if default constructor.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::applyRowCut | ( | const OsiRowCut & | rc | ) | `[protected, virtual]`

Apply a row cut (append to constraint matrix).

Implements OsiSolverInterface.

virtual void OsiClpSolverInterface::applyColCut | ( | const OsiColCut & | cc | ) | `[protected, virtual]`

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

Implements OsiSolverInterface.

void OsiClpSolverInterface::gutsOfDestructor | ( |  | ) | `[protected]`

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

void OsiClpSolverInterface::freeCachedResults | ( |  | ) | const`[protected]`

Deletes all mutable stuff.

void OsiClpSolverInterface::freeCachedResults0 | ( |  | ) | const`[protected]`

Deletes all mutable stuff for row ranges etc.

void OsiClpSolverInterface::freeCachedResults1 | ( |  | ) | const`[protected]`

Deletes all mutable stuff for matrix etc.

void OsiClpSolverInterface::extractSenseRhsRange | ( |  | ) | const`[protected]`

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

void OsiClpSolverInterface::fillParamMaps | ( |  | ) | `[protected]`

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

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

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

void OsiClpSolverInterface::crunch | ( |  | ) | `[protected]`

Crunch down problem a bit.

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

Extend scale factors.

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

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

void OsiClpSolverInterface::setBasis | ( |  | ) | `[inline]`

Just puts current basis_ into ClpSimplex model.

Definition at line 1231 of file OsiClpSolverInterface.hpp.

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

Warm start difference from basis_ to statusArray.

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

Warm start from statusArray.

void OsiClpSolverInterface::deleteScaleFactors | ( |  | ) |

Delete all scale factor stuff and reset option.

const double* OsiClpSolverInterface::upRange | ( |  | ) | const`[inline]`

If doing fast hot start then ranges are computed.

Definition at line 1240 of file OsiClpSolverInterface.hpp.

const double* OsiClpSolverInterface::downRange | ( |  | ) | const`[inline]`

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

Definition at line 1242 of file OsiClpSolverInterface.hpp.

void OsiClpSolverInterface::passInRanges | ( | int * | array | ) | `[inline]`

Pass in range array.

Definition at line 1245 of file OsiClpSolverInterface.hpp.

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

Pass in sos stuff from AMPl.

void OsiClpSolverInterface::computeLargestAway | ( |  | ) |

Compute largest amount any at continuous away from bound.

double OsiClpSolverInterface::largestAway | ( |  | ) | const`[inline]`

Get largest amount continuous away from bound.

Definition at line 1253 of file OsiClpSolverInterface.hpp.

void OsiClpSolverInterface::setLargestAway | ( | double | value | ) | `[inline]`

Set largest amount continuous away from bound.

Definition at line 1256 of file OsiClpSolverInterface.hpp.

void OsiClpSolverInterface::lexSolve | ( |  | ) |

Sort of lexicographic resolve.

## Friends And Related Function Documentation

void OsiClpSolverInterfaceUnitTest | ( | const std::string & | mpsDir,
|  | const std::string & | netlibDir |
| ) |  |  | `[friend]`

A function that tests the methods in the OsiClpSolverInterface class.

## Member Data Documentation

ClpSimplex* OsiClpSolverInterface::modelPtr_`[mutable, protected]`

Clp model represented by this class instance.

Definition at line 1266 of file OsiClpSolverInterface.hpp.

char* OsiClpSolverInterface::rowsense_`[mutable, protected]`

Pointer to dense vector of row sense indicators.

Definition at line 1271 of file OsiClpSolverInterface.hpp.

double* OsiClpSolverInterface::rhs_`[mutable, protected]`

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

Definition at line 1274 of file OsiClpSolverInterface.hpp.

double* OsiClpSolverInterface::rowrange_`[mutable, protected]`

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

Definition at line 1279 of file OsiClpSolverInterface.hpp.

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

Reimplemented from OsiSolverInterface.

Definition at line 1283 of file OsiClpSolverInterface.hpp.

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

double* OsiClpSolverInterface::columnActivity_`[mutable, protected]`

Pointer to dense vector of row sense indicators.

Definition at line 1287 of file OsiClpSolverInterface.hpp.

ClpNodeStuff OsiClpSolverInterface::stuff_`[protected]`

Stuff for fast dual.

Definition at line 1289 of file OsiClpSolverInterface.hpp.

int OsiClpSolverInterface::numberSOS_`[protected]`

Number of SOS sets.

Definition at line 1291 of file OsiClpSolverInterface.hpp.

CoinSet* OsiClpSolverInterface::setInfo_`[protected]`

SOS set info.

Definition at line 1293 of file OsiClpSolverInterface.hpp.

ClpSimplex* OsiClpSolverInterface::smallModel_`[protected]`

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

Definition at line 1295 of file OsiClpSolverInterface.hpp.

ClpFactorization* OsiClpSolverInterface::factorization_`[protected]`

factorization for hot starts

Definition at line 1297 of file OsiClpSolverInterface.hpp.

double OsiClpSolverInterface::smallestElementInCut_`[protected]`

Smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1300 of file OsiClpSolverInterface.hpp.

double OsiClpSolverInterface::smallestChangeInCut_`[protected]`

Smallest change in cut.

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

Definition at line 1304 of file OsiClpSolverInterface.hpp.

double OsiClpSolverInterface::largestAway_`[protected]`

Largest amount continuous away from bound.

Definition at line 1306 of file OsiClpSolverInterface.hpp.

char* OsiClpSolverInterface::spareArrays_`[protected]`

Arrays for hot starts.

Definition at line 1308 of file OsiClpSolverInterface.hpp.

CoinWarmStartBasis OsiClpSolverInterface::basis_`[protected]`

Warmstart information to be used in resolves.

Definition at line 1310 of file OsiClpSolverInterface.hpp.

int OsiClpSolverInterface::itlimOrig_`[protected]`

The original iteration limit before hotstarts started.

Definition at line 1312 of file OsiClpSolverInterface.hpp.

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

bool OsiClpSolverInterface::notOwned_`[protected]`

To say if destructor should delete underlying model.

Definition at line 1327 of file OsiClpSolverInterface.hpp.

CoinPackedMatrix* OsiClpSolverInterface::matrixByRow_`[mutable, protected]`

Pointer to row-wise copy of problem matrix coefficients.

Definition at line 1330 of file OsiClpSolverInterface.hpp.

CoinPackedMatrix* OsiClpSolverInterface::matrixByRowAtContinuous_`[protected]`

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

Definition at line 1333 of file OsiClpSolverInterface.hpp.

char* OsiClpSolverInterface::integerInformation_`[protected]`

Pointer to integer information.

Definition at line 1336 of file OsiClpSolverInterface.hpp.

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

bool OsiClpSolverInterface::fakeMinInSimplex_`[mutable, protected]`

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

Definition at line 1349 of file OsiClpSolverInterface.hpp.

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

ClpDataSave OsiClpSolverInterface::saveData_`[mutable, protected]`

To save data in OsiSimplex stuff.

Definition at line 1359 of file OsiClpSolverInterface.hpp.

ClpSolve OsiClpSolverInterface::solveOptions_`[protected]`

Options for initialSolve.

Definition at line 1361 of file OsiClpSolverInterface.hpp.

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

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

Definition at line 1402 of file OsiClpSolverInterface.hpp.

ClpSimplex* OsiClpSolverInterface::baseModel_`[protected]`

Copy of model when option 131072 set.

Definition at line 1404 of file OsiClpSolverInterface.hpp.

int OsiClpSolverInterface::lastNumberRows_`[protected]`

Number of rows when last "scaled".

Definition at line 1406 of file OsiClpSolverInterface.hpp.

ClpSimplex* OsiClpSolverInterface::continuousModel_`[protected]`

Continuous model.

Definition at line 1408 of file OsiClpSolverInterface.hpp.

OsiClpDisasterHandler* OsiClpSolverInterface::disasterHandler_`[protected]`

Possible disaster handler.

Definition at line 1410 of file OsiClpSolverInterface.hpp.

ClpLinearObjective* OsiClpSolverInterface::fakeObjective_`[protected]`

Fake objective.

Definition at line 1412 of file OsiClpSolverInterface.hpp.

CoinDoubleArrayWithLength OsiClpSolverInterface::rowScale_`[protected]`

Row scale factors (has inverse at end).

Definition at line 1414 of file OsiClpSolverInterface.hpp.

CoinDoubleArrayWithLength OsiClpSolverInterface::columnScale_`[protected]`

Column scale factors (has inverse at end).

Definition at line 1416 of file OsiClpSolverInterface.hpp.

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

- /home/coin/svn-release/Alps-1.5.0/Clp/src/OsiClp/OsiClpSolverInterface.hpp