- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OsiClpSolverInterface Class Reference

Clp Solver Interface. More...

`#include <OsiClpSolverInterface.hpp>`

Inheritance diagram for OsiClpSolverInterface:

[legend]
Collaboration diagram for OsiClpSolverInterface:

[legend]
List of all members.

## 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.
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 | 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.
## Public Member Functions
virtual void | setObjSense (double s)
| Set objective function sense (1 for min (default), -1 for max,).
virtual void | setColSolution (const double *colsol)
| Set the primal solution column values.
virtual void | setRowPrice (const double *rowprice)
| Set dual solution vector.
Solve methods
virtual void | initialSolve ()
| Solve initial LP relaxation.
virtual void | resolve ()
| Resolve an LP relaxation after problem modification.
virtual void | branchAndBound ()
| Invoke solver's built-in enumeration algorithm.
OsiSimplexInterface methods
virtual void | enableSimplexInterface (bool doingPrimal)
| Enables normal operation of subsequent functions.
virtual void | disableSimplexInterface ()
| Undo whatever setting changes the above method had to make.
virtual int | canDoSimplexInterface () const
| Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none.
virtual void | enableFactorization () const
| Tells solver that calls to getBInv etc are about to take place.
virtual void | disableFactorization () const
| and stop
void | setupForRepeatedUse (int senseOfAdventure=0, int printOut=0)
| Sets up solver for repeated use by Osi interface.
virtual void | synchronizeModel ()
| Synchronize model (really if no cuts in tree).
void | setSpecialOptionsMutable (unsigned int value) const
| Enables normal operation of subsequent functions.
virtual bool | basisIsAvailable () const
| Returns true if a basis is available AND problem is optimal.
virtual void | getBasisStatus (int *cstat, int *rstat) const
| The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasis if: 1.
virtual int | setBasisStatus (const int *cstat, const int *rstat)
| Set the status of structural/artificial variables and factorize, update solution etc.
virtual int | pivot (int colIn, int colOut, int outStatus)
| Perform a pivot by substituting a colIn for colOut in the basis.
virtual int | primalPivotResult (int colIn, int sign, int &colOut, int &outStatus, double &t, CoinPackedVector *dx)
| Obtain a result of the primal pivot Outputs: colOut -- leaving column, outStatus -- its status, t -- step size, and, if dx!=NULL, *dx -- primal ray direction.
virtual int | dualPivotResult (int &colIn, int &sign, int colOut, int outStatus, double &t, CoinPackedVector *dx)
| Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and a sign of its change are now the outputs, the leaving variable and its statuts -- the inputs If dx!=NULL, then *dx contains dual ray Return code: same.
virtual void | getReducedGradient (double *columnReducedCosts, double *duals, const double *c)
| Get the reduced gradient for the cost vector c.
virtual void | setObjectiveAndRefresh (double *c)
| Set a new objective and apply the old basis so that the reduced costs are properly updated.
virtual void | getBInvARow (int row, double *z, double *slack=NULL) const
| Get a row of the tableau (slack part in slack if not NULL).
virtual void | 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()).
Parameter set/get methods
The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the clp algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver. The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false.
bool | setIntParam (OsiIntParam key, int value)
bool | setDblParam (OsiDblParam key, double value)
bool | setStrParam (OsiStrParam key, const std::string &value)
bool | getIntParam (OsiIntParam key, int &value) const
bool | getDblParam (OsiDblParam key, double &value) const
bool | getStrParam (OsiStrParam key, std::string &value) const
virtual bool | setHintParam (OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL)
Methods returning info on how the solution process terminated
virtual bool | isAbandoned () const
| Are there a numerical difficulties?
virtual bool | isProvenOptimal () const
| Is optimality proven?
virtual bool | isProvenPrimalInfeasible () const
| Is primal infeasiblity proven?
virtual bool | isProvenDualInfeasible () const
| Is dual infeasiblity proven?
virtual bool | isPrimalObjectiveLimitReached () const
| Is the given primal objective limit reached?
virtual bool | isDualObjectiveLimitReached () const
| Is the given dual objective limit reached?
virtual bool | isIterationLimitReached () const
| Iteration limit reached?
WarmStart related methods
virtual CoinWarmStart * | getEmptyWarmStart () const
| Get an empty warm start object.
virtual CoinWarmStart * | getWarmStart () const
| Get warmstarting information.
virtual bool | setWarmStart (const CoinWarmStart *warmstart)
| Set warmstarting information.
virtual CoinWarmStart * | getPointerToWarmStart (bool &mustDelete)
| Get warm start information.
Hotstart related methods (primarily used in strong branching). <br>
The user can create a hotstart (a snapshot) of the optimization process then reoptimize over and over again always starting from there. NOTE: between hotstarted optimizations only bound changes are allowed.
virtual void | markHotStart ()
| Create a hotstart point of the optimization process.
virtual void | solveFromHotStart ()
| Optimize starting from the hotstart.
virtual void | unmarkHotStart ()
| Delete the snapshot.
Methods related to querying the input data
virtual int | getNumCols () const
| Get number of columns.
virtual int | getNumRows () const
| Get number of rows.
virtual int | getNumElements () const
| Get number of nonzero elements.
virtual std::string | getRowName (int rowIndex, unsigned maxLen=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=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).
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) 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 column (primal variable) to the problem.
virtual void | addCol (int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj)
| Add a column (primal variable) to the problem.
virtual void | addCols (const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj)
| Add a set of columns (primal variables) to the problem.
virtual void | addCols (const int numcols, const int *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
| Add a set of columns (primal variables) to the problem.
virtual void | deleteCols (const int num, const int *colIndices)
| Remove a set of columns (primal variables) from the problem.
virtual void | addRow (const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
| Add a row (constraint) to the problem.
virtual void | addRow (const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
| Add a row (constraint) 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 | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
virtual void | addRows (const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
| Add a set of rows (constraints) 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 set of rows (constraints) to the problem.
void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
virtual void | deleteRows (const int num, const int *rowIndices)
| Delete a set of rows (constraints) from the problem.
virtual void | 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.
Methods to input a problem
virtual void | loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
| Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds).
virtual void | assignProblem (CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub)
| Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by lower and upper bounds).
virtual void | loadProblem (const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
| Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range triplets).
virtual void | assignProblem (CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng)
| Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by sense/rhs/range triplets).
virtual void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
| Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps).
virtual void | loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
| Just like the other loadProblem() methods except that the matrix is given in a standard column major ordered format (without gaps).
virtual int | loadFromCoinModel (CoinModel &modelObject, bool keepSolution=false)
| This loads a model from a coinModel object - returns number of errors.
virtual int | readMps (const char *filename, const char *extension="mps")
| Read an mps file from the given filename (defaults to Osi reader) - returns number of errors (see OsiMpsReader class).
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 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
void | newLanguage (CoinMessages::Language language)
| Set language.
void | setLanguage (CoinMessages::Language language)
| Set language.
void | generateCpp (FILE *fp)
| Create C++ lines to get to current state.
Clp specific public interfaces
ClpSimplex * | getModelPtr () const
| Get pointer to Clp model.
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 | 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.
int | tightenBounds ()
| Tighten bounds - lightweight.
Constructors and destructors
| OsiClpSolverInterface ()
| Default Constructor.
virtual OsiSolverInterface * | clone (bool copyData=true) const
| Clone.
| OsiClpSolverInterface (const OsiClpSolverInterface &)
| Copy constructor.
| OsiClpSolverInterface (ClpSimplex *rhs, bool reallyOwn=false)
| Borrow constructor - only delete one copy.
void | releaseClp ()
| Releases so won't error.
OsiClpSolverInterface & | operator= (const OsiClpSolverInterface &rhs)
| Assignment operator.
virtual | ~OsiClpSolverInterface ()
| Destructor.
virtual void | reset ()
| Resets as if default constructor.
## Protected Member Functions
Protected methods
virtual void | applyRowCut (const OsiRowCut &rc)
| Apply a row cut (append to constraint matrix).
virtual void | applyColCut (const OsiColCut &cc)
| Apply a column cut (adjust one or more bounds).
## Protected Attributes
Protected member data
ClpSimplex * | modelPtr_
| Clp model represented by this class instance.
double * | linearObjective_
| Linear objective - just points to ClpModel.
Cached information derived from the OSL model
char * | rowsense_
| Pointer to dense vector of row sense indicators.
double * | rhs_
| Pointer to dense vector of row right-hand side values.
double * | rowrange_
| Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows).
CoinWarmStartBasis * | ws_
| A pointer to the warmstart information to be used in the hotstarts.
double * | rowActivity_
| also save row and column information for hot starts only used in hotstarts so can be casual
double * | columnActivity_
| Pointer to dense vector of row sense indicators.
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.
char * | spareArrays_
| Arrays for hot starts.
CoinWarmStartBasis | basis_
| Warmstart information to be used in resolves.
int | itlimOrig_
| The original iteration limit before hotstarts started.
int | lastAlgorithm_
| Last algorithm used.
bool | notOwned_
| To say if destructor should delete underlying model.
CoinPackedMatrix * | matrixByRow_
| Pointer to row-wise copy of problem matrix coefficients.
char * | integerInformation_
| Pointer to integer information.
int * | whichRange_
| Pointer to variables for which we want range information The number is in [0] memory is not owned by OsiClp.
ClpDataSave | saveData_
| To save data in OsiSimplex stuff.
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 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.
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.

## Detailed Description

Clp Solver Interface.

Instantiation of OsiClpSolverInterface for the Model Algorithm.

Definition at line 35 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::branchAndBound | ( |  | ) | `[virtual]`

Invoke solver's built-in enumeration algorithm.

Implements OsiSolverInterface.

virtual void OsiClpSolverInterface::enableSimplexInterface | ( | bool | doingPrimal | ) | `[virtual]`

Enables normal operation of subsequent functions.

This method is supposed to ensure that all typical things (like reduced costs, etc.) are updated when individual pivots are executed and can be queried by other methods

Reimplemented from OsiSolverInterface.

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

Undo whatever setting changes the above method had to make.

Reimplemented from OsiSolverInterface.

virtual int OsiClpSolverInterface::canDoSimplexInterface | ( |  | ) | const`[virtual]`

Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none.

Reimplemented from OsiSolverInterface.

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

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]`

and stop

Reimplemented from OsiSolverInterface.

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

Sets up solver for repeated use by Osi interface.

The normal usage does things like keeping factorization around so can be used. Will also do things like keep scaling and row copy of matrix if matrix does not change. adventure: 0 - safe stuff as above 1 - will take more risks - if it does not work then bug which will be fixed 2 - don't bother doing most extreme termination checks e.g. don't bother re-factorizing if less than 20 iterations. 3 - Actually safer than 1 (mainly just keeps factorization)

printOut - -1 always skip round common messages instead of doing some work 0 skip if normal defaults 1 leaves

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

Synchronize model (really if no cuts in tree).

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

Enables normal operation of subsequent functions.

This method is supposed to ensure that all typical things (like reduced costs, etc.) are updated when individual pivots are executed and can be queried by other methods

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

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

Get the reduced gradient for the cost vector c.

Reimplemented from OsiSolverInterface.

virtual void OsiClpSolverInterface::setObjectiveAndRefresh | ( | double * | c | ) | `[virtual]`

Set a new objective and apply the old basis so that the reduced costs are properly updated.

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.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

Reimplemented from OsiSolverInterface.

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

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?

Implements OsiSolverInterface.

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

Is the given dual objective limit reached?

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

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.

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.

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

Get number of columns.

Implements OsiSolverInterface.

Definition at line 328 of file OsiClpSolverInterface.hpp.

References modelPtr_, and ClpModel::numberColumns().

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

Get number of rows.

Implements OsiSolverInterface.

Definition at line 332 of file OsiClpSolverInterface.hpp.

References modelPtr_, and ClpModel::numberRows().

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

Get number of nonzero elements.

Implements OsiSolverInterface.

Definition at line 336 of file OsiClpSolverInterface.hpp.

References CoinPackedMatrix::getNumElements(), ClpModel::matrix(), and modelPtr_.

virtual std::string OsiClpSolverInterface::getRowName | ( | int | rowIndex,
|  | unsigned | maxLen = `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 = `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 354 of file OsiClpSolverInterface.hpp.

References ClpModel::columnLower(), and modelPtr_.

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

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

Implements OsiSolverInterface.

Definition at line 357 of file OsiClpSolverInterface.hpp.

References ClpModel::columnUpper(), and modelPtr_.

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

References modelPtr_, and ClpModel::rowLower().

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

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

Implements OsiSolverInterface.

Definition at line 394 of file OsiClpSolverInterface.hpp.

References modelPtr_, and ClpModel::rowUpper().

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

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

Implements OsiSolverInterface.

Definition at line 397 of file OsiClpSolverInterface.hpp.

References modelPtr_, and ClpModel::objective().

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

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

Implements OsiSolverInterface.

Definition at line 401 of file OsiClpSolverInterface.hpp.

References modelPtr_, and ClpModel::optimizationDirection().

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.

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

References OsiClpInfinity.

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

References modelPtr_, and ClpModel::numberIterations().

virtual std::vector<double*> OsiClpSolverInterface::getDualRays | ( | int | maxNumRays | ) | const`[virtual]`

Get as many dual rays as the solver can provide.

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

NOTE for implementers of solver interfaces:
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 613 of file OsiClpSolverInterface.hpp.

References numberSOS_.

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

SOS set info.

Definition at line 616 of file OsiClpSolverInterface.hpp.

References setInfo_.

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

References modelPtr_, and ClpModel::setOptimizationDirection().

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 column (primal variable) to the problem.

Implements 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::addCols | ( | const int | numcols,
|  | const CoinPackedVectorBase *const * | cols,
|  | const double * | collb,
|  | const double * | colub,
|  | const double * | obj |
| ) |  |  | `[virtual]`

Add a set of columns (primal variables) to the problem.

The default implementation simply makes repeated calls to addCol().

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 set of columns (primal variables) to the problem.

The default implementation simply makes repeated calls to addCol().

Reimplemented from OsiSolverInterface.

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

Remove a set of columns (primal variables) from the problem.

The solver interface for a basis-oriented solver will maintain valid warm start information if all deleted variables are nonbasic.

Implements OsiSolverInterface.

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

Add a row (constraint) to the problem.

Implements OsiSolverInterface.

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

Add a row (constraint) 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::addRows | ( | const int | numrows,
|  | const CoinPackedVectorBase *const * | rows,
|  | const double * | rowlb,
|  | const double * | rowub |
| ) |  |  | `[virtual]`

Add a set of rows (constraints) to the problem.

The default implementation simply makes repeated calls to addRow().

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 set of rows (constraints) to the problem.

The default implementation simply makes repeated calls to addRow().

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 set of rows (constraints) to the problem.

The default implementation simply makes repeated calls to addRow().

Reimplemented from OsiSolverInterface.

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

Definition at line 713 of file OsiClpSolverInterface.hpp.

References modelPtr_, and ClpModel::modifyCoefficient().

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

Delete a set of rows (constraints) from the problem.

The solver interface for a basis-oriented solver will maintain valid warm start information if all deleted rows are loose.

Implements OsiSolverInterface.

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

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

Set language.

Reimplemented from OsiSolverInterface.

Referenced by setLanguage().

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

Set language.

Reimplemented from OsiSolverInterface.

Definition at line 892 of file OsiClpSolverInterface.hpp.

References newLanguage().

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

References modelPtr_.

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

Get special options.

Definition at line 907 of file OsiClpSolverInterface.hpp.

References specialOptions_.

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

Get pointer to Clp model.

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

Get scaling action option.

Definition at line 911 of file OsiClpSolverInterface.hpp.

References cleanupScaling_.

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

References cleanupScaling_.

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

Get smallest allowed element in cut.

If smaller than this then ignored

Definition at line 929 of file OsiClpSolverInterface.hpp.

References smallestElementInCut_.

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

Set smallest allowed element in cut.

If smaller than this then ignored

Definition at line 933 of file OsiClpSolverInterface.hpp.

References smallestElementInCut_.

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

References smallestChangeInCut_.

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

References smallestChangeInCut_.

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

Pass in initial solve options.

Definition at line 952 of file OsiClpSolverInterface.hpp.

References solveOptions_.

int OsiClpSolverInterface::tightenBounds | ( |  | ) |

Tighten bounds - lightweight.

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.

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

References basis_, and modelPtr_.

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

References rowActivity_.

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

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

Definition at line 1056 of file OsiClpSolverInterface.hpp.

References columnActivity_.

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

Pass in range array.

Definition at line 1059 of file OsiClpSolverInterface.hpp.

References whichRange_.

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

Pass in sos stuff from AMPl.

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

The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging. Also, if this method is compiled with optimization, the compilation takes 10-15 minutes and the machine pages (has 256M core memory!)...

## Member Data Documentation

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

Clp model represented by this class instance.

Definition at line 1070 of file OsiClpSolverInterface.hpp.

Referenced by getColLower(), getColUpper(), getIterationCount(), getNumCols(), getNumElements(), getNumRows(), getObjCoefficients(), getObjSense(), getRowLower(), getRowUpper(), modifyCoefficient(), setBasis(), setObjSense(), and swapModelPtr().

double* OsiClpSolverInterface::linearObjective_`[protected]`

Linear objective - just points to ClpModel.

Definition at line 1072 of file OsiClpSolverInterface.hpp.

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

Pointer to dense vector of row sense indicators.

Definition at line 1076 of file OsiClpSolverInterface.hpp.

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

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

Definition at line 1079 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 1084 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 1088 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 1091 of file OsiClpSolverInterface.hpp.

Referenced by upRange().

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

Pointer to dense vector of row sense indicators.

Definition at line 1092 of file OsiClpSolverInterface.hpp.

Referenced by downRange().

int OsiClpSolverInterface::numberSOS_`[protected]`

Number of SOS sets.

Definition at line 1094 of file OsiClpSolverInterface.hpp.

Referenced by numberSOS().

CoinSet* OsiClpSolverInterface::setInfo_`[protected]`

SOS set info.

Definition at line 1096 of file OsiClpSolverInterface.hpp.

Referenced by setInfo().

ClpSimplex* OsiClpSolverInterface::smallModel_`[protected]`

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

Definition at line 1098 of file OsiClpSolverInterface.hpp.

ClpFactorization* OsiClpSolverInterface::factorization_`[protected]`

factorization for hot starts

Definition at line 1100 of file OsiClpSolverInterface.hpp.

double OsiClpSolverInterface::smallestElementInCut_`[protected]`

Smallest allowed element in cut.

If smaller than this then ignored

Definition at line 1103 of file OsiClpSolverInterface.hpp.

Referenced by setSmallestElementInCut(), and smallestElementInCut().

double OsiClpSolverInterface::smallestChangeInCut_`[protected]`

Smallest change in cut.

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

Definition at line 1107 of file OsiClpSolverInterface.hpp.

Referenced by setSmallestChangeInCut(), and smallestChangeInCut().

char* OsiClpSolverInterface::spareArrays_`[protected]`

Arrays for hot starts.

Definition at line 1109 of file OsiClpSolverInterface.hpp.

CoinWarmStartBasis OsiClpSolverInterface::basis_`[protected]`

Warmstart information to be used in resolves.

Definition at line 1111 of file OsiClpSolverInterface.hpp.

Referenced by setBasis().

int OsiClpSolverInterface::itlimOrig_`[protected]`

The original iteration limit before hotstarts started.

Definition at line 1113 of file OsiClpSolverInterface.hpp.

int OsiClpSolverInterface::lastAlgorithm_`[mutable, protected]`

Last algorithm used.

Definition at line 1116 of file OsiClpSolverInterface.hpp.

bool OsiClpSolverInterface::notOwned_`[protected]`

To say if destructor should delete underlying model.

Definition at line 1119 of file OsiClpSolverInterface.hpp.

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

Pointer to row-wise copy of problem matrix coefficients.

Definition at line 1122 of file OsiClpSolverInterface.hpp.

char* OsiClpSolverInterface::integerInformation_`[protected]`

Pointer to integer information.

Definition at line 1125 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 1131 of file OsiClpSolverInterface.hpp.

Referenced by passInRanges().

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

To save data in OsiSimplex stuff.

Definition at line 1138 of file OsiClpSolverInterface.hpp.

ClpSolve OsiClpSolverInterface::solveOptions_`[protected]`

Options for initialSolve.

Definition at line 1140 of file OsiClpSolverInterface.hpp.

Referenced by setSolveOptions().

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

Referenced by cleanupScaling(), and setCleanupScaling().

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 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 auxiliary model or crunch etc 131072 Try and keep scaling factors around

Definition at line 1172 of file OsiClpSolverInterface.hpp.

Referenced by specialOptions().

ClpSimplex* OsiClpSolverInterface::baseModel_`[protected]`

Copy of model when option 131072 set.

Definition at line 1174 of file OsiClpSolverInterface.hpp.

int OsiClpSolverInterface::lastNumberRows_`[protected]`

Number of rows when last "scaled".

Definition at line 1176 of file OsiClpSolverInterface.hpp.

ClpSimplex* OsiClpSolverInterface::continuousModel_`[protected]`

Continuous model.

Definition at line 1178 of file OsiClpSolverInterface.hpp.

CoinDoubleArrayWithLength OsiClpSolverInterface::rowScale_`[protected]`

Row scale factors (has inverse at end).

Definition at line 1180 of file OsiClpSolverInterface.hpp.

CoinDoubleArrayWithLength OsiClpSolverInterface::columnScale_`[protected]`

Column scale factors (has inverse at end).

Definition at line 1182 of file OsiClpSolverInterface.hpp.

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

- /home/coin/SVN-release/Cgl-0.52.0/Osi/src/OsiClp/OsiClpSolverInterface.hpp