6 #ifndef OsiClpSolverInterface_H 7 #define OsiClpSolverInterface_H 15 #include "CoinPackedMatrix.hpp" 16 #include "OsiSolverInterface.hpp" 17 #include "CoinWarmStartBasis.hpp" 20 #include "CoinIndexedVector.hpp" 21 #include "CoinFinite.hpp" 24 class OsiClpUserSolver;
134 const double *c)
const;
137 virtual void getBInvARow(
int row,
double *z,
double *slack = NULL)
const;
143 virtual void getBInvARow(
int row, CoinIndexedVector *z, CoinIndexedVector *slack = NULL,
144 bool keepScaled =
false)
const;
147 virtual void getBInvRow(
int row,
double *z)
const;
150 virtual void getBInvACol(
int col,
double *vec)
const;
153 virtual void getBInvACol(
int col, CoinIndexedVector *vec)
const;
159 virtual void getBInvACol(CoinIndexedVector *vec)
const;
162 virtual void getBInvCol(
int col,
double *vec)
const;
168 virtual void getBasics(
int *index)
const;
188 virtual int pivot(
int colIn,
int colOut,
int outStatus);
202 int &colOut,
int &outStatus,
203 double &t, CoinPackedVector *dx);
212 int colOut,
int outStatus,
213 double &t, CoinPackedVector *dx);
237 bool setStrParam(OsiStrParam key,
const std::string &value);
239 bool getIntParam(OsiIntParam key,
int &value)
const;
241 bool getDblParam(OsiDblParam key,
double &value)
const;
243 bool getStrParam(OsiStrParam key, std::string &value)
const;
245 virtual bool setHintParam(OsiHintParam key,
bool yesNo =
true,
246 OsiHintStrength strength = OsiHintTry,
247 void *otherInformation = NULL);
296 virtual bool setWarmStart(
const CoinWarmStart *warmstart);
338 void setStuff(
double tolerance,
double increment);
340 OsiRowCut *
smallModelCut(
const double *originalLower,
const double *originalUpper,
341 int numberRowsAtContinuous,
const int *whichGenerator,
346 OsiRowCut *
modelCut(
const double *originalLower,
const double *originalUpper,
347 int numberRowsAtContinuous,
const int *whichGenerator,
381 CoinBigIndex retVal = 0;
384 retVal = matrix->getNumElements();
391 unsigned maxLen = static_cast< unsigned >(std::string::npos))
const;
396 unsigned maxLen = static_cast< unsigned >(std::string::npos))
const;
459 virtual bool isBinary(
int colIndex)
const;
465 virtual bool isInteger(
int colIndex)
const;
477 virtual const char *
getColType(
bool refresh =
false)
const;
557 virtual std::vector< double * >
getDualRays(
int maxNumRays,
558 bool fullRay =
false)
const;
570 virtual std::vector< double * >
getPrimalRays(
int maxNumRays)
const;
583 virtual void setObjCoeff(
int elementIndex,
double elementValue);
587 virtual void setColLower(
int elementIndex,
double elementValue);
591 virtual void setColUpper(
int elementIndex,
double elementValue);
595 double lower,
double upper);
606 const int *indexLast,
607 const double *boundList);
611 virtual void setRowLower(
int elementIndex,
double elementValue);
615 virtual void setRowUpper(
int elementIndex,
double elementValue);
619 double lower,
double upper);
622 virtual void setRowType(
int index,
char sense,
double rightHandSide,
634 const int *indexLast,
635 const double *boundList);
648 const int *indexLast,
649 const char *senseList,
650 const double *rhsList,
651 const double *rangeList);
673 virtual void setRowName(
int rowIndex, std::string name);
678 virtual void setColName(
int colIndex, std::string name);
694 virtual void setInteger(
const int *indices,
int len);
758 virtual void addCol(
const CoinPackedVectorBase &vec,
759 const double collb,
const double colub,
763 virtual void addCol(
const CoinPackedVectorBase &vec,
764 const double collb,
const double colub,
765 const double obj, std::string name);
767 virtual void addCol(
int numberElements,
const int *rows,
const double *elements,
768 const double collb,
const double colub,
772 virtual void addCol(
int numberElements,
773 const int *rows,
const double *elements,
774 const double collb,
const double colub,
775 const double obj, std::string name);
777 virtual void addCols(
const int numcols,
778 const CoinPackedVectorBase *
const *cols,
779 const double *collb,
const double *colub,
782 virtual void addCols(
const int numcols,
783 const CoinBigIndex *columnStarts,
const int *rows,
const double *elements,
784 const double *collb,
const double *colub,
787 virtual void deleteCols(
const int num,
const int *colIndices);
790 virtual void addRow(
const CoinPackedVectorBase &vec,
791 const double rowlb,
const double rowub);
798 virtual void addRow(
const CoinPackedVectorBase &vec,
799 const double rowlb,
const double rowub,
801 virtual void addRow(
const CoinPackedVectorBase &vec,
802 const char rowsen,
const double rowrhs,
803 const double rowrng);
805 virtual void addRow(
int numberElements,
const int *columns,
const double *element,
806 const double rowlb,
const double rowub);
809 virtual void addRow(
const CoinPackedVectorBase &vec,
810 const char rowsen,
const double rowrhs,
811 const double rowrng, std::string name);
813 virtual void addRows(
const int numrows,
814 const CoinPackedVectorBase *
const *rows,
815 const double *rowlb,
const double *rowub);
817 virtual void addRows(
const int numrows,
818 const CoinPackedVectorBase *
const *rows,
819 const char *rowsen,
const double *rowrhs,
820 const double *rowrng);
823 virtual void addRows(
const int numrows,
824 const CoinBigIndex *rowStarts,
const int *columns,
const double *element,
825 const double *rowlb,
const double *rowub);
828 bool keepZero =
false)
834 virtual void deleteRows(
const int num,
const int *rowIndices);
847 virtual void applyRowCuts(
int numberCuts,
const OsiRowCut *cuts);
852 virtual void applyRowCuts(
int numberCuts,
const OsiRowCut **cuts);
875 virtual ApplyCutsReturnCode
applyCuts(
const OsiCuts &cs,
876 double effectivenessLb = 0.0);
897 virtual void loadProblem(
const CoinPackedMatrix &matrix,
898 const double *collb,
const double *colub,
900 const double *rowlb,
const double *rowub);
910 double *&collb,
double *&colub,
double *&obj,
911 double *&rowlb,
double *&rowub);
925 virtual void loadProblem(
const CoinPackedMatrix &matrix,
926 const double *collb,
const double *colub,
928 const char *rowsen,
const double *rowrhs,
929 const double *rowrng);
939 double *&collb,
double *&colub,
double *&obj,
940 char *&rowsen,
double *&rowrhs,
946 const double *collb,
const double *colub,
948 const double *rowlb,
const double *rowub);
952 virtual void loadProblem(
const int numcols,
const int numrows,
953 const CoinBigIndex *start,
const int *index,
955 const double *collb,
const double *colub,
957 const double *rowlb,
const double *rowub);
961 virtual void loadProblem(
const int numcols,
const int numrows,
962 const CoinBigIndex *start,
const int *index,
964 const double *collb,
const double *colub,
966 const char *rowsen,
const double *rowrhs,
967 const double *rowrng);
969 virtual int loadFromCoinModel(CoinModel &modelObject,
bool keepSolution =
false);
973 virtual int readMps(
const char *filename,
974 const char *extension =
"mps");
977 int readMps(
const char *filename,
bool keepNames,
bool allowErrors);
979 virtual int readMps(
const char *filename,
const char *extension,
980 int &numberSets, CoinSet **&sets);
986 virtual void writeMps(
const char *filename,
987 const char *extension =
"mps",
988 double objSense = 0.0)
const;
998 const char **rowNames,
const char **columnNames,
999 int formatType = 0,
int numberAcross = 2,
1000 double objSense = 0.0)
const;
1002 virtual int readLp(
const char *filename,
const double epsilon = 1e-5);
1008 virtual void writeLp(
const char *filename,
1009 const char *extension =
"lp",
1010 double epsilon = 1e-5,
1011 int numberAcross = 10,
1013 double objSense = 0.0,
1014 bool useRowNames =
true)
const;
1019 virtual void writeLp(FILE *fp,
1020 double epsilon = 1e-5,
1021 int numberAcross = 10,
1023 double objSense = 0.0,
1024 bool useRowNames =
true)
const;
1047 void newLanguage(CoinMessages::Language language);
1151 virtual CoinBigIndex
getSizeL()
const;
1153 virtual CoinBigIndex
getSizeU()
const;
1226 virtual void reset();
1285 const int *indices,
const double *elements);
1290 void setBasis(
const CoinWarmStartBasis &basis);
1297 CoinWarmStartDiff *
getBasisDiff(
const unsigned char *statusArray)
const;
1299 CoinWarmStartBasis *
getBasis(
const unsigned char *statusArray)
const;
1318 const int *start,
const int *indices,
const double *weights = NULL);
1366 mutable CoinWarmStartBasis *
ws_;
1512 virtual bool check()
const;
ClpLinearObjective * fakeObjective() const
Get fake objective.
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 int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
void setStuff(double tolerance, double increment)
Sets integer tolerance and increment.
This is a very simple class to guide algorithms.
char * integerInformation_
Pointer to integer information.
unsigned int specialOptions_
Special options 0x80000000 off 0 simple stuff for branch and bound 1 try and keep work regions as muc...
int numberSOS_
Number of SOS sets.
int phase_
phase 0 initial 1 trying continuing with back in and maybe different perturb 2 trying continuing with...
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
int integerType(int colIndex) const
Return integer type (0,1,2=optional,3=sc,4=scint)
virtual void initialSolve()
Solve initial LP relaxation.
virtual void markHotStart()
Create a hotstart point of the optimization process.
double smallestElementInCut_
Smallest allowed element in cut.
void redoScaleFactors(int numberRows, const CoinBigIndex *starts, const int *indices, const double *elements)
Extend scale factors.
Status
enums for status of various sorts.
void lexSolve()
Sort of lexicographic resolve.
bool getDblParam(OsiDblParam key, double &value) const
int lastAlgorithm_
Last algorithm used.
double * linearObjective_
Linear objective.
const CoinWarmStartBasis * getConstPointerToWarmStart() const
Get warmstarting information.
void setLargestAway(double value)
Set largest amount continuous away from bound.
virtual ClpDisasterHandler * clone() const
Clone.
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 disableFactorization() const
Undo any setting changes made by enableFactorization.
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
virtual bool isProvenOptimal() const
Is optimality proven?
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
Abstract base class for Clp Matrices.
bool getStrParam(OsiStrParam key, std::string &value) const
void setWhereFrom(int value)
Set where from.
double * rowActivity_
also save row and column information for hot starts only used in hotstarts so can be casual ...
int numberColumns() const
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 applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
double * objective() const
Objective.
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...
friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format (with names)
virtual void enableSimplexInterface(bool doingPrimal)
Enables simplex mode 2 (individual pivot control)
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
virtual ~OsiClpSolverInterface()
Destructor.
void newLanguage(CoinMessages::Language language)
Set language.
virtual CoinBigIndex getNumElements() const
Get number of nonzero elements.
int phase() const
Get phase.
ClpSimplex * continuousModel_
Continuous model.
void freeCachedResults0() const
Deletes all mutable stuff for row ranges etc.
void setSpecialOptions(unsigned int value)
void replaceSetInfo(int numberSOS, CoinSet *setInfo)
Replace setInfo (takes over ownership)
ClpSimplex * modelPtr_
Clp model represented by this class instance.
void freeCachedResults() const
Deletes all mutable stuff.
bool setDblParam(OsiDblParam key, double value)
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
virtual bool isInteger(int colIndex) const
Return true if column is integer.
Base class for Clp disaster handling.
virtual void synchronizeModel()
Synchronize model (really if no cuts in tree)
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
double * rowLower() const
Row lower.
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
double * columnLower() const
Column Lower.
ClpSimplex * smallModel_
Alternate model (hot starts) - but also could be permanent and used for crunch.
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust one or more bounds).
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.
ClpSimplex * swapModelPtr(ClpSimplex *newModel)
Set pointer to Clp model and return old.
bool isHeuristicInteger(int colIndex) const
Return true only if integer and not optional.
CoinDoubleArrayWithLength columnScale_
Column scale factors (has inverse at end)
virtual int typeOfDisaster()
Type of disaster 0 can fix, 1 abort.
int cleanupScaling() const
Get scaling action option.
void setPhase(int value)
Set phase.
This just implements CoinFactorization when an ClpMatrixBase object is passed.
int lastNumberRows_
Number of rows when last "scaled".
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 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()...
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
void setSmallestElementInCut(double value)
Set smallest allowed element in cut.
double * columnUpper() const
Column Upper.
unsigned int specialOptions() const
Get special options.
void setLogLevel(int value)
Set log level (will also set underlying solver's log level)
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
virtual std::vector< double *> getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver...
ClpSimplex * baseModel_
Copy of model when option 131072 set.
virtual void getBasics(int *index) const
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBI...
virtual void disableSimplexInterface()
Undo setting changes made by enableSimplexInterface.
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
virtual bool check() const
Checks if disaster.
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
virtual void solveFromHotStart()
Optimize starting from the hotstart.
double largestAway() const
Get largest amount continuous away from bound.
OsiClpDisasterHandler * disasterHandler_
Possible disaster handler.
void crossover(int options, int basis)
Solve when primal column and dual row solutions are near-optimal options - 0 no presolve (use primal ...
ClpFactorization * factorization_
factorization for hot starts
void setIntegerType(int colIndex, int value)
Set integer type (0,1,2=optional,3=sc,4=scint)
OsiClpSolverInterface()
Default Constructor.
virtual void restoreBaseModel(int numberRows)
Strip off rows to get to this number of rows.
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...
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 findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
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...
double smallestElementInCut() const
Get smallest allowed element in cut.
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...
char * spareArrays_
Arrays for hot starts.
void setBasis()
Just puts current basis_ into ClpSimplex model.
virtual void deleteRows(const int num, const int *rowIndices)
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
virtual void setObjective(const double *array)
Set the objective coefficients for all columns array [getNumCols()] is an array of values for the obj...
double smallestChangeInCut_
Smallest change in cut.
int cleanupScaling_
Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled...
bool setStrParam(OsiStrParam key, const std::string &value)
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
double * rhs_
Pointer to dense vector of row right-hand side values.
double smallestChangeInCut() const
Get smallest change in cut.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
int numberSOS() const
Number of SOS sets.
void setCleanupScaling(int value)
Set Scaling option When scaling is on it is possible that the scaled problem is feasible but the unsc...
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
bool notOwned_
To say if destructor should delete underlying model.
This solves LPs using the simplex method.
virtual CoinBigIndex getSizeL() const
Return number of entries in L part of current factorization.
void setOptimizationDirection(double value)
ClpDataSave saveData_
To save data in OsiSimplex stuff.
void setSolveOptions(const ClpSolve &options)
Pass in initial solve options.
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
void gutsOfDestructor()
The real work of a copy constructor (used by copy and assignment)
int infeasibleOtherWay(char *whichWay)
See if any integer variables make infeasible other way.
virtual void setColName(int colIndex, std::string name)
Set name of column.
void freeCachedResults1() const
Deletes all mutable stuff for matrix etc.
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
void passInRanges(int *array)
Pass in range array.
virtual void intoSimplex()
Into simplex.
OsiClpDisasterHandler(OsiClpSolverInterface *model=NULL)
Default constructor.
void crunch()
Crunch down problem a bit.
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
int * whichRange_
Pointer to variables for which we want range information The number is in [0] memory is not owned by ...
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
virtual double getInfinity() const
Get solver's value for infinity.
virtual CoinBigIndex getSizeU() const
Return number of entries in U part of current factorization.
CoinSet * setInfo_
SOS set info.
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
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...
virtual ~OsiClpDisasterHandler()
Destructor.
virtual void replaceMatrix(const CoinPackedMatrix &matrix)
And if it does matter (not used at present)
virtual void setRowName(int rowIndex, std::string name)
Set name of row.
void setFakeObjective(ClpLinearObjective *fakeObjective)
Set fake objective (and take ownership)
int itlimOrig_
The original iteration limit before hotstarts started.
This is a tiny class where data can be saved round calls.
void setLastAlgorithm(int value)
Set last algorithm used , 1 = primal, 2 = dual other unknown.
void stopFastDual()
Stop fast dual.
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL)
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...
OsiClpSolverInterface & operator=(const OsiClpSolverInterface &rhs)
Assignment operator.
virtual int setBasisStatus(const int *cstat, const int *rstat)
Set the status of structural/artificial variables and factorize, update solution etc.
bool inTrouble_
Are we in trouble.
virtual void reset()
Resets as if default constructor.
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
bool isOptionalInteger(int colIndex) const
Return true if column is integer but does not have to be declared as such.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
CoinWarmStartBasis getBasis(ClpSimplex *model) const
Warm start.
ClpNodeStuff stuff_
Stuff for fast dual.
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
double * rowUpper() const
Row upper.
int lastAlgorithm() const
Last algorithm used , 1 = primal, 2 = dual other unknown.
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to constraint matrix).
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
CoinPackedMatrix * matrixByRowAtContinuous_
Pointer to row-wise copy of continuous problem matrix coefficients.
const CoinSet * setInfo() const
SOS set info.
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
virtual bool isIterationLimitReached() const
Iteration limit reached?
bool fakeMinInSimplex_
Faking min to get proper dual solution signs in simplex API.
static const double OsiClpInfinity
ClpLinearObjective * fakeObjective_
Fake objective.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
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 void addCols(const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj)
CoinWarmStartBasis * getPointerToWarmStart()
Get warmstarting information.
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
ClpSolve solveOptions_
Options for initialSolve.
void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
bool getIntParam(OsiIntParam key, int &value) const
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
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...
void setOsiModel(OsiClpSolverInterface *model)
set model.
virtual void resolveGub(int needed)
Resolve an LP relaxation after problem modification (try GUB)
ClpSimplex * getContinuousModel() const
Get continuous model.
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
double largestAway_
Largest amount continuous away from bound.
void extractSenseRhsRange() const
A method that fills up the rowsense_, rhs_ and rowrange_ arrays.
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiClpSolverInterface * osiModel() const
Get model.
void setSpecialOptionsMutable(unsigned int value) const
Set special options in underlying clp solver.
virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix)
I (JJF) am getting annoyed because I can't just replace a matrix.
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
CoinWarmStartBasis basis_
Warmstart information to be used in resolves.
void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0)
Set up solver for repeated use by Osi interface.
OsiRowCut * smallModelCut(const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
Return a conflict analysis cut from small model.
int numberIterations() const
Number of iterations.
int numberRows() const
Number of rows.
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 double getObjValue() const
Get objective function value.
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
void setSOSData(int numberSOS, const char *type, const int *start, const int *indices, const double *weights=NULL)
Pass in sos stuff from AMPl.
int whereFrom_
Where from 0 dual (resolve) 1 crunch 2 primal (resolve) 4 dual (initialSolve) 6 primal (initialSolve)...
virtual void resolve()
Resolve an LP relaxation after problem modification.
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Get the reduced gradient for the cost vector c.
virtual void unmarkHotStart()
Delete the snapshot.
virtual void getBasisStatus(int *cstat, int *rstat) const
The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasi...
virtual bool isIntegerNonBinary(int colIndex) const
Return true if variable is general integer.
void setContinuousModel(ClpSimplex *model)
Set continuous model.
void setSmallestChangeInCut(double value)
Set smallest change in cut.
const double * upRange() const
If doing fast hot start then ranges are computed.
void passInDisasterHandler(OsiClpDisasterHandler *handler)
Pass in disaster handler.
virtual int tightenBounds(int lightweight=0)
Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers...
CoinWarmStartBasis * ws_
A pointer to the warmstart information to be used in the hotstarts.
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
virtual int canDoSimplexInterface() const
Simplex API capability.
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
void setLanguage(CoinMessages::Language language)
virtual void deleteCols(const int num, const int *colIndices)
virtual bool isAbandoned() const
Are there a numerical difficulties?
void deleteScaleFactors()
Delete all scale factor stuff and reset option.
OsiClpDisasterHandler & operator=(const OsiClpDisasterHandler &)
int whereFrom() const
Get where from.
void computeLargestAway()
Compute largest amount any at continuous away from bound.
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
void setColumnStatus(int iColumn, ClpSimplex::Status status)
Set column status in ClpSimplex and warmStart.
const OsiClpDisasterHandler * disasterHandler() const
Get disaster handler.
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
virtual void enableFactorization() const
Enables simplex mode 1 (tableau access)
virtual int getNumCols() const
Get number of columns.
bool setIntParam(OsiIntParam key, int value)
CoinDoubleArrayWithLength rowScale_
Row scale factors (has inverse at end)
#define OsiSolverInterface
virtual bool basisIsAvailable() const
Returns true if a basis is available AND problem is optimal.
virtual void saveInfo()
saves information for next attempt
void setOptionalInteger(int index)
Set the index-th variable to be an optional integer variable.
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
virtual bool isBinary(int colIndex) const
Return true if variable is binary.
bool inTrouble() const
are we in trouble
virtual int getNumRows() const
Get number of rows.
ClpSimplex * getModelPtr() const
Get pointer to Clp model.
const double * downRange() const
char * rowsense_
Pointer to dense vector of row sense indicators.
OsiClpSolverInterface * osiModel_
Pointer to model.
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
This loads a model from a coinModel object - returns number of errors.
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
int startFastDual(int options)
Start faster dual - returns negative if problems 1 if infeasible, Options to pass to solver 1 - creat...
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
void releaseClp()
Releases so won't error.
CoinWarmStartDiff * getBasisDiff(const unsigned char *statusArray) const
Warm start difference from basis_ to statusArray.
virtual std::vector< double *> getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get pointer to mutable column-wise copy of matrix.
virtual void saveBaseModel()
If solver wants it can save a copy of "base" (continuous) model here.