Go to the documentation of this file.
7 #ifndef OsiClpSolverInterface_H
8 #define OsiClpSolverInterface_H
16 #include "CoinPackedMatrix.hpp"
17 #include "OsiSolverInterface.hpp"
18 #include "CoinWarmStartBasis.hpp"
21 #include "CoinIndexedVector.hpp"
22 #include "CoinFinite.hpp"
25 class OsiClpUserSolver;
136 const double * c)
const ;
139 virtual void getBInvARow(
int row,
double* z,
double * slack=NULL)
const;
145 virtual void getBInvARow(
int row, CoinIndexedVector * z, CoinIndexedVector * slack=NULL,
146 bool keepScaled=
false)
const;
155 virtual void getBInvACol(
int col, CoinIndexedVector * vec)
const ;
194 virtual int pivot(
int colIn,
int colOut,
int outStatus);
208 int& colOut,
int& outStatus,
209 double& t, CoinPackedVector* dx);
218 int colOut,
int outStatus,
219 double& t, CoinPackedVector* dx);
253 OsiHintStrength strength=OsiHintTry,
254 void * otherInformation=NULL);
343 OsiRowCut *
smallModelCut(
const double * originalLower,
const double * originalUpper,
344 int numberRowsAtContinuous,
const int * whichGenerator,
349 OsiRowCut *
modelCut(
const double * originalLower,
const double * originalUpper,
350 int numberRowsAtContinuous,
const int * whichGenerator,
381 if ( matrix != NULL ) retVal=matrix->getNumElements();
387 unsigned maxLen =
static_cast<unsigned>(std::string::npos))
const;
392 unsigned maxLen =
static_cast<unsigned>(std::string::npos))
const;
536 bool fullRay =
false)
const;
561 virtual void setObjCoeff(
int elementIndex,
double elementValue );
565 virtual void setColLower(
int elementIndex,
double elementValue );
569 virtual void setColUpper(
int elementIndex,
double elementValue );
573 double lower,
double upper );
584 const int* indexLast,
585 const double* boundList);
589 virtual void setRowLower(
int elementIndex,
double elementValue );
593 virtual void setRowUpper(
int elementIndex,
double elementValue ) ;
597 double lower,
double upper ) ;
600 virtual void setRowType(
int index,
char sense,
double rightHandSide,
612 const int* indexLast,
613 const double* boundList);
626 const int* indexLast,
627 const char* senseList,
628 const double* rhsList,
629 const double* rangeList);
728 virtual void addCol(
const CoinPackedVectorBase& vec,
729 const double collb,
const double colub,
733 virtual void addCol(
const CoinPackedVectorBase& vec,
734 const double collb,
const double colub,
735 const double obj, std::string name) ;
737 virtual void addCol(
int numberElements,
const int * rows,
const double * elements,
738 const double collb,
const double colub,
743 const int* rows,
const double* elements,
744 const double collb,
const double colub,
745 const double obj, std::string name) ;
748 const CoinPackedVectorBase *
const * cols,
749 const double* collb,
const double* colub,
753 const int * columnStarts,
const int * rows,
const double * elements,
754 const double* collb,
const double* colub,
757 virtual void deleteCols(
const int num,
const int * colIndices);
760 virtual void addRow(
const CoinPackedVectorBase& vec,
761 const double rowlb,
const double rowub);
768 virtual void addRow(
const CoinPackedVectorBase& vec,
769 const double rowlb,
const double rowub,
771 virtual void addRow(
const CoinPackedVectorBase& vec,
772 const char rowsen,
const double rowrhs,
773 const double rowrng);
775 virtual void addRow(
int numberElements,
const int * columns,
const double * element,
776 const double rowlb,
const double rowub) ;
779 virtual void addRow(
const CoinPackedVectorBase& vec,
780 const char rowsen,
const double rowrhs,
781 const double rowrng, std::string name) ;
784 const CoinPackedVectorBase *
const * rows,
785 const double* rowlb,
const double* rowub);
788 const CoinPackedVectorBase *
const * rows,
789 const char* rowsen,
const double* rowrhs,
790 const double* rowrng);
794 const int * rowStarts,
const int * columns,
const double * element,
795 const double* rowlb,
const double* rowub);
802 virtual void deleteRows(
const int num,
const int * rowIndices);
843 virtual ApplyCutsReturnCode
applyCuts(
const OsiCuts & cs,
844 double effectivenessLb = 0.0);
867 const double* collb,
const double* colub,
869 const double* rowlb,
const double* rowub);
879 double*& collb,
double*& colub,
double*& obj,
880 double*& rowlb,
double*& rowub);
895 const double* collb,
const double* colub,
897 const char* rowsen,
const double* rowrhs,
898 const double* rowrng);
908 double*& collb,
double*& colub,
double*& obj,
909 char*& rowsen,
double*& rowrhs,
915 const double* collb,
const double* colub,
917 const double* rowlb,
const double* rowub) ;
922 const CoinBigIndex * start,
const int* index,
924 const double* collb,
const double* colub,
926 const double* rowlb,
const double* rowub);
931 const CoinBigIndex * start,
const int* index,
933 const double* collb,
const double* colub,
935 const char* rowsen,
const double* rowrhs,
936 const double* rowrng);
940 using OsiSolverInterface::readMps ;
944 const char *extension =
"mps") ;
947 int readMps(
const char *filename,
bool keepNames,
bool allowErrors);
949 virtual int readMps (
const char *filename,
const char*extension,
950 int & numberSets, CoinSet ** & sets);
957 const char *extension =
"mps",
958 double objSense=0.0)
const;
968 const char ** rowNames,
const char ** columnNames,
969 int formatType=0,
int numberAcross=2,
970 double objSense=0.0)
const ;
972 virtual int readLp(
const char *filename,
const double epsilon = 1e-5);
979 const char *extension =
"lp",
980 double epsilon = 1e-5,
981 int numberAcross = 10,
983 double objSense = 0.0,
984 bool useRowNames =
true)
const;
990 double epsilon = 1e-5,
991 int numberAcross = 10,
993 double objSense = 0.0,
994 bool useRowNames =
true)
const;
1225 const int * indices,
const double * elements);
1234 CoinWarmStartDiff *
getBasisDiff(
const unsigned char * statusArray)
const ;
1236 CoinWarmStartBasis *
getBasis(
const unsigned char * statusArray)
const ;
1249 const int * start,
const int * indices,
const double * weights=NULL);
1283 mutable CoinWarmStartBasis*
ws_;
double * columnLower() const
Column Lower.
This solves LPs using the simplex method.
This just implements CoinFactorization when an ClpMatrixBase object is passed.
bool setDblParam(OsiDblParam key, double value)
virtual int findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
CoinWarmStartBasis * ws_
A pointer to the warmstart information to be used in the hotstarts.
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
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 l...
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
CoinSet * setInfo_
SOS set info.
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 setColL...
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
int whereFrom() const
Get where from.
int itlimOrig_
The original iteration limit before hotstarts started.
OsiClpSolverInterface()
Default Constructor.
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 t...
int phase_
phase 0 initial 1 trying continuing with back in and maybe different perturb 2 trying continuing with...
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.
void setOsiModel(OsiClpSolverInterface *model)
set model.
ClpSimplex * smallModel_
Alternate model (hot starts) - but also could be permanent and used for crunch.
virtual CoinWarmStart * getPointerToWarmStart(bool &mustDelete)
Get warm start information.
unsigned int specialOptions() const
Get special options.
ClpSimplex * modelPtr_
Clp model represented by this class instance.
This is a very simple class to guide algorithms.
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()...
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
ClpSimplex * baseModel_
Copy of model when option 131072 set.
virtual int typeOfDisaster()
Type of disaster 0 can fix, 1 abort.
void setCleanupScaling(int value)
Set Scaling option When scaling is on it is possible that the scaled problem is feasible but the unsc...
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
void copyEnabledStuff(ClpSimplex &rhs)
Copy across enabled stuff from one solver to another.
void passInDisasterHandler(OsiClpDisasterHandler *handler)
Pass in disaster handler.
CoinWarmStartBasis getBasis(ClpSimplex *model) const
Warm start.
void releaseClp()
Releases so won't error.
double largestAway_
Largest amount continuous away from bound.
int numberSOS_
Number of SOS sets.
virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts)
Apply a collection of row cuts which are all effective.
virtual bool basisIsAvailable() const
Returns true if a basis is available AND problem is optimal.
virtual void addCols(const int numcols, const int *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
void setLanguage(CoinMessages::Language language)
virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix)
I (JJF) am getting annoyed because I can't just replace a matrix.
double * rowLower() const
Row lower.
OsiRowCut * smallModelCut(const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
Return a conflict analysis cut from small model.
void setFakeObjective(ClpLinearObjective *fakeObjective)
Set fake objective (and take ownership)
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...
virtual void getBasics(int *index) const
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBI...
static const double OsiClpInfinity
const CoinWarmStartBasis * getConstPointerToWarmStart() const
Get warmstarting information.
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Get the reduced gradient for the cost vector c.
virtual void getBasisStatus(int *cstat, int *rstat) const
The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasi...
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
const double * downRange() const
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
This is a tiny class where data can be saved round calls.
OsiClpSolverInterface(const OsiClpSolverInterface &)
Copy constructor.
virtual void unmarkHotStart()
Delete the snapshot.
virtual void addCols(const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj)
void freeCachedResults1() const
Deletes all mutable stuff for matrix etc.
ClpSolve solveOptions_
Options for initialSolve.
void setWhereFrom(int value)
Set where from.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub, std::string name)
Add a named row (constraint) to the problem.
int cleanupScaling() const
Get scaling action option.
CoinPackedMatrix * matrixByRowAtContinuous_
Pointer to row-wise copy of continuous problem matrix coefficients.
void setFakeObjective(double *fakeObjective)
Set fake objective.
virtual void saveBaseModel()
If solver wants it can save a copy of "base" (continuous) model here.
virtual void setObjective(const double *array)
Set the objective coefficients for all columns array [getNumCols()] is an array of values for the obj...
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
const OsiClpDisasterHandler * disasterHandler() const
Get disaster handler.
void setLogLevel(int value)
Set log level (will also set underlying solver's log level)
virtual bool isAbandoned() const
Are there a numerical difficulties?
bool setStrParam(OsiStrParam key, const std::string &value)
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
virtual int tightenBounds(int lightweight=0)
Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers,...
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
double smallestChangeInCut() const
Get smallest change in cut.
void deleteScaleFactors()
Delete all scale factor stuff and reset option.
virtual bool isIterationLimitReached() const
Iteration limit reached?
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.
bool notOwned_
To say if destructor should delete underlying model.
void setPhase(int value)
Set phase.
void setBasis(const CoinWarmStartBasis &basis, ClpSimplex *model)
Sets up working basis as a copy of input.
virtual void setColLower(const double *array)
Set the lower bounds for all columns array [getNumCols()] is an array of values for the objective.
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
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.
void setStuff(double tolerance, double increment)
Sets integer tolerance and increment.
virtual int getNumElements() const
Get number of nonzero elements.
void copyEnabledSuff(OsiClpSolverInterface &rhs)
Copy across enabled stuff from one solver to another.
ClpSimplex * getModelPtr() const
Get pointer to Clp model.
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
virtual CoinBigIndex getSizeL() const
Return number of entries in L part of current factorization.
CoinWarmStartDiff * getBasisDiff(const unsigned char *statusArray) const
Warm start difference from basis_ to statusArray.
double * rowActivity_
also save row and column information for hot starts only used in hotstarts so can be casual
virtual void restoreBaseModel(int numberRows)
Strip off rows to get to this number of rows.
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
OsiClpSolverInterface & operator=(const OsiClpSolverInterface &rhs)
Assignment operator.
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 setRowPrice(const double *rowprice)
Set dual solution vector.
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0)
Set up solver for repeated use by Osi interface.
virtual void setRowName(int rowIndex, std::string name)
Set name of row.
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 n...
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
void extractSenseRhsRange() const
A method that fills up the rowsense_, rhs_ and rowrange_ arrays.
virtual int readMps(const char *filename, const char *extension, int &numberSets, CoinSet **&sets)
Read an mps file.
virtual void enableFactorization() const
Enables simplex mode 1 (tableau access)
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.
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
int cleanupScaling_
Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled...
virtual int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
int lastAlgorithm() const
Last algorithm used , 1 = primal, 2 = dual other unknown.
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
void setBasis(const CoinWarmStartBasis &basis)
Sets up working basis as a copy of input and puts in as basis.
virtual bool check() const
Checks if disaster.
char * integerInformation_
Pointer to integer information.
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
unsigned int specialOptions_
Special options 0x80000000 off 0 simple stuff for branch and bound 1 try and keep work regions as muc...
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
void freeCachedResults0() const
Deletes all mutable stuff for row ranges etc.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiClpSolverInterface * osiModel_
Pointer to model.
OsiClpDisasterHandler * disasterHandler_
Possible disaster handler.
double * rowUpper() const
Row upper.
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
Base class for Clp disaster handling.
void freeCachedResults() const
Deletes all mutable stuff.
virtual bool isInteger(int colIndex) const
Return true if column is integer.
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...
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
double largestAway() const
Get largest amount continuous away from bound.
double * rhs_
Pointer to dense vector of row right-hand side values.
void setBasis()
Just puts current basis_ into ClpSimplex model.
void setSpecialOptionsMutable(unsigned int value) const
Set special options in underlying clp solver.
bool getIntParam(OsiIntParam key, int &value) const
CoinDoubleArrayWithLength columnScale_
Column scale factors (has inverse at end)
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
This loads a model from a coinModel object - returns number of errors.
void redoScaleFactors(int numberRows, const CoinBigIndex *starts, const int *indices, const double *elements)
Extend scale factors.
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
CoinWarmStartBasis basis_
Warmstart information to be used in resolves.
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
virtual void setColName(int colIndex, std::string name)
Set name of column.
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 ...
virtual void resolveGub(int needed)
Resolve an LP relaxation after problem modification (try GUB)
Abstract base class for Clp Matrices.
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL)
virtual void intoSimplex()
Into simplex.
void setSpecialOptions(unsigned int value)
virtual void solveFromHotStart()
Optimize starting from the hotstart.
virtual const char * getColType(bool refresh=false) const
Return array of column length 0 - continuous 1 - binary (may get fixed later) 2 - general integer (ma...
void lexSolve()
Sort of lexicographic resolve.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
bool inTrouble_
Are we in trouble.
bool isOptionalInteger(int colIndex) const
Return true if column is integer but does not have to be declared as such.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
int phase() const
Get phase.
OsiClpSolverInterface * osiModel() const
Get model.
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 s...
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 ...
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
void setSmallestChangeInCut(double value)
Set smallest change in cut.
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...
const double * upRange() const
If doing fast hot start then ranges are computed.
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiClpDisasterHandler(OsiClpSolverInterface *model=NULL)
Default constructor.
bool fakeMinInSimplex_
Faking min to get proper dual solution signs in simplex API.
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 setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously The default implementation just invokes setRowLowe...
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
virtual void deleteCols(const int num, const int *colIndices)
virtual bool isProvenOptimal() const
Is optimality proven?
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 Osi...
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
CoinDoubleArrayWithLength rowScale_
Row scale factors (has inverse at end)
int lastAlgorithm_
Last algorithm used.
void stopFastDual()
Stop fast dual.
virtual void deleteRows(const int num, const int *rowIndices)
virtual void resolve()
Resolve an LP relaxation after problem modification.
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format (with names)
void setSmallestElementInCut(double value)
Set smallest allowed element in cut.
void setColumnStatus(int iColumn, ClpSimplex::Status status)
Set column status in ClpSimplex and warmStart.
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
virtual void reset()
Resets as if default constructor.
void setOptimizationDirection(double value)
virtual void getBInvACol(int col, CoinIndexedVector *vec) const
Get a column of the tableau.
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
virtual void saveInfo()
saves information for next attempt
void setSolveOptions(const ClpSolve &options)
Pass in initial solve options.
double * linearObjective_
Linear objective.
void setSOSData(int numberSOS, const char *type, const int *start, const int *indices, const double *weights=NULL)
Pass in sos stuff from AMPl.
int numberIterations() const
Number of iterations.
virtual void disableFactorization() const
Undo any setting changes made by enableFactorization.
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
virtual bool isIntegerNonBinary(int colIndex) const
Return true if variable is general integer.
int readMps(const char *filename, bool keepNames, bool allowErrors)
Read an mps file from the given filename returns number of errors (see OsiMpsReader class)
bool inTrouble() const
are we in trouble
double * objective() const
Objective.
void setLargestAway(double value)
Set largest amount continuous away from bound.
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 ...
void newLanguage(CoinMessages::Language language)
Set language.
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
virtual void synchronizeModel()
Synchronize model (really if no cuts in tree)
virtual void disableSimplexInterface()
Undo setting changes made by enableSimplexInterface.
virtual void setInteger(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be integer variables.
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get pointer to mutable column-wise copy of matrix.
virtual bool isBinary(int colIndex) const
Return true if variable is binary.
virtual CoinBigIndex getSizeU() const
Return number of entries in U part of current factorization.
virtual bool isFreeBinary(int colIndex) const
Return true if variable is binary and not fixed at either bound.
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 pro...
virtual ~OsiClpDisasterHandler()
Destructor.
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 applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to constraint matrix).
bool getStrParam(OsiStrParam key, std::string &value) const
#define OsiSolverInterface
virtual void setContinuous(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be continuous variables.
double * columnUpper() const
Column Upper.
void passInRanges(int *array)
Pass in range array.
int whereFrom_
Where from 0 dual (resolve) 1 crunch 2 primal (resolve) 4 dual (initialSolve) 6 primal (initialSolve)
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
const CoinSet * setInfo() const
SOS set info.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
virtual void getBInvACol(CoinIndexedVector *vec) const
Update (i.e.
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,...
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.
CoinWarmStartBasis * getBasis(const unsigned char *statusArray) const
Warm start from statusArray.
virtual void initialSolve()
Solve initial LP relaxation.
int numberColumns() const
ClpLinearObjective * fakeObjective() const
Get fake objective.
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.
int startFastDual(int options)
Start faster dual - returns negative if problems 1 if infeasible, Options to pass to solver 1 - creat...
bool setIntParam(OsiIntParam key, int value)
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
void computeLargestAway()
Compute largest amount any at continuous away from bound.
virtual void addRows(const int numrows, const int *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub)
ClpSimplex * swapModelPtr(ClpSimplex *newModel)
Set pointer to Clp model and return old.
ClpLinearObjective * fakeObjective_
Fake objective.
void setOptionalInteger(int index)
Set the index-th variable to be an optional integer variable.
virtual int getNumRows() const
Get number of rows.
double smallestElementInCut_
Smallest allowed element in cut.
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
bool getDblParam(OsiDblParam key, double &value) const
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
ClpDataSave saveData_
To save data in OsiSimplex stuff.
ClpNodeStuff stuff_
Stuff for fast dual.
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust one or more bounds).
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
int * whichRange_
Pointer to variables for which we want range information The number is in [0] memory is not owned by ...
OsiClpDisasterHandler(const OsiClpDisasterHandler &)
OsiClpDisasterHandler & operator=(const OsiClpDisasterHandler &)
virtual double getInfinity() const
Get solver's value for infinity.
int numberSOS() const
Number of SOS sets.
int infeasibleOtherWay(char *whichWay)
See if any integer variables make infeasible other way.
int lastNumberRows_
Number of rows when last "scaled".
virtual ClpDisasterHandler * clone() const
Clone.
virtual ~OsiClpSolverInterface()
Destructor.
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
ClpSimplex * continuousModel_
Continuous model.
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
virtual void enableSimplexInterface(bool doingPrimal)
Enables simplex mode 2 (individual pivot control)
void gutsOfDestructor()
The real work of a copy constructor (used by copy and assignment)
virtual void setColUpper(const double *array)
Set the upper bounds for all columns array [getNumCols()] is an array of values for the objective.
char * rowsense_
Pointer to dense vector of row sense indicators.
virtual int getNumCols() const
Get number of columns.
virtual int setBasisStatus(const int *cstat, const int *rstat)
Set the status of structural/artificial variables and factorize, update solution etc.
virtual double getObjValue() const
Get objective function value.
int numberRows() const
Number of rows.
void setLastAlgorithm(int value)
Set last algorithm used , 1 = primal, 2 = dual other unknown.
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 void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
void crunch()
Crunch down problem a bit.
double smallestElementInCut() const
Get smallest allowed element in cut.
virtual int canDoSimplexInterface() const
Simplex API capability.
OsiClpSolverInterface(ClpSimplex *rhs, bool reallyOwn=false)
Borrow constructor - only delete one copy.
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
void crossover(int options, int basis)
Solve when primal column and dual row solutions are near-optimal options - 0 no presolve (use primal ...
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
double smallestChangeInCut_
Smallest change in cut.
virtual void markHotStart()
Create a hotstart point of the optimization process.
char * spareArrays_
Arrays for hot starts.
ClpFactorization * factorization_
factorization for hot starts
Status
enums for status of various sorts.
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows)
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
CoinWarmStartBasis * getPointerToWarmStart()
Get warmstarting information.
virtual void replaceMatrix(const CoinPackedMatrix &matrix)
And if it does matter (not used at present)