5 #ifndef OsiSolverInterface_H
6 #define OsiSolverInterface_H
65 const std::string & mpsDir,
66 const std::string & netlibDir);
68 const std::vector<OsiSolverInterface*> & vecSiP,
69 const std::string & mpsDir);
178 #ifdef CBC_NEXT_VERSION
202 int & numberSolves,
int & numberIterations,
203 bool forceBranch=
false);
303 "setHintParam",
"OsiSolverInterface");
335 void *& otherInformation)
const {
340 otherInformation=NULL;
575 virtual bool isBinary(
int colIndex)
const;
581 virtual bool isInteger(
int colIndex)
const;
607 virtual const char *
getColType(
bool refresh=
false)
const;
686 virtual std::vector<double*>
getDualRays(
int maxNumRays,
687 bool fullRay =
false)
const = 0;
704 virtual std::vector<double*>
getPrimalRays(
int maxNumRays)
const = 0;
725 virtual void setObjCoeff(
int elementIndex,
double elementValue ) = 0;
729 const int* indexLast,
730 const double* coeffList);
754 virtual void setColLower(
int elementIndex,
double elementValue ) = 0;
765 virtual void setColUpper(
int elementIndex,
double elementValue ) = 0;
779 double lower,
double upper ) {
791 const int* indexLast,
792 const double* boundList);
796 virtual void setRowLower(
int elementIndex,
double elementValue ) = 0;
800 virtual void setRowUpper(
int elementIndex,
double elementValue ) = 0;
806 double lower,
double upper ) {
818 const int* indexLast,
819 const double* boundList);
823 virtual void setRowType(
int index,
char sense,
double rightHandSide,
831 const int* indexLast,
832 const char* senseList,
833 const double* rhsList,
834 const double* rangeList);
856 virtual void setRowPrice(
const double * rowprice) = 0;
881 virtual void setInteger(
const int* indices,
int len);
921 int ndx,
unsigned digits = 7)
const ;
925 virtual std::string
getObjName (
unsigned maxLen = static_cast<unsigned>(std::string::npos))
const ;
939 unsigned maxLen = static_cast<unsigned>(std::string::npos))
const ;
959 virtual void setRowName(
int ndx, std::string name) ;
968 int srcStart,
int len,
int tgtStart) ;
984 unsigned maxLen = static_cast<unsigned>(std::string::npos))
const ;
1002 virtual void setColName(
int ndx, std::string name) ;
1011 int srcStart,
int len,
int tgtStart) ;
1056 const double collb,
const double colub,
1057 const double obj) = 0;
1065 const double collb,
const double colub,
1066 const double obj, std::string name) ;
1069 virtual void addCol(
int numberElements,
1070 const int* rows,
const double* elements,
1071 const double collb,
const double colub,
1079 virtual void addCol(
int numberElements,
1080 const int* rows,
const double* elements,
1081 const double collb,
const double colub,
1082 const double obj, std::string name) ;
1089 virtual void addCols(
const int numcols,
1091 const double* collb,
const double* colub,
1099 virtual void addCols(
const int numcols,
const int* columnStarts,
1100 const int* rows,
const double* elements,
1101 const double* collb,
const double* colub,
1117 const double* collb,
const double* colub,
1127 virtual void deleteCols(
const int num,
const int * colIndices) = 0;
1131 const double rowlb,
const double rowub) = 0;
1139 const double rowlb,
const double rowub,
1144 const char rowsen,
const double rowrhs,
1145 const double rowrng) = 0;
1153 const char rowsen,
const double rowrhs,
1154 const double rowrng, std::string name) ;
1160 virtual void addRow(
int numberElements,
1161 const int *columns,
const double *element,
1162 const double rowlb,
const double rowub) ;
1169 virtual void addRows(
const int numrows,
1171 const double* rowlb,
const double* rowub);
1178 virtual void addRows(
const int numrows,
1180 const char* rowsen,
const double* rowrhs,
1181 const double* rowrng);
1188 virtual void addRows(
const int numrows,
const int *rowStarts,
1189 const int *columns,
const double *element,
1190 const double *rowlb,
const double *rowub);
1208 const double* rowlb,
const double* rowub);
1211 const char* rowsen,
const double* rowrhs,
1212 const double* rowrng);
1220 virtual void deleteRows(
const int num,
const int * rowIndices) = 0;
1280 double effectivenessLb = 0.0);
1318 const double* collb,
const double* colub,
1320 const double* rowlb,
const double* rowub) = 0;
1332 double*& collb,
double*& colub,
double*& obj,
1333 double*& rowlb,
double*& rowub) = 0;
1352 const double* collb,
const double* colub,
1354 const char* rowsen,
const double* rowrhs,
1355 const double* rowrng) = 0;
1367 double*& collb,
double*& colub,
double*& obj,
1368 char*& rowsen,
double*& rowrhs,
1369 double*& rowrng) = 0;
1383 virtual void loadProblem (
const int numcols,
const int numrows,
1385 const double* value,
1386 const double* collb,
const double* colub,
1388 const double* rowlb,
const double* rowub) = 0;
1402 virtual void loadProblem (
const int numcols,
const int numrows,
1404 const double* value,
1405 const double* collb,
const double* colub,
1407 const char* rowsen,
const double* rowrhs,
1408 const double* rowrng) = 0;
1417 bool keepSolution=
false);
1424 virtual int readMps (
const char *filename,
1425 const char *extension =
"mps") ;
1433 virtual int readMps (
const char *filename,
const char*extension,
1434 int & numberSets,
CoinSet ** & sets);
1441 virtual int readGMPL (
const char *filename,
const char *dataname=NULL);
1449 virtual void writeMps (
const char *filename,
1450 const char *extension =
"mps",
1451 double objSense=0.0)
const = 0;
1467 const char ** rowNames,
const char ** columnNames,
1468 int formatType=0,
int numberAcross=2,
1469 double objSense=0.0,
int numberSOS=0,
1470 const CoinSet * setInfo=NULL)
const ;
1494 virtual void writeLp(
const char *filename,
1495 const char *extension =
"lp",
1496 double epsilon = 1e-5,
1497 int numberAcross = 10,
1499 double objSense = 0.0,
1500 bool useRowNames =
true)
const;
1506 virtual void writeLp(FILE *fp,
1507 double epsilon = 1e-5,
1508 int numberAcross = 10,
1510 double objSense = 0.0,
1511 bool useRowNames =
true)
const;
1532 char const *
const *
const rowNames,
1533 char const *
const *
const columnNames,
1534 const double epsilon = 1.0e-5,
1535 const int numberAcross = 10,
1536 const int decimals = 5,
1537 const double objSense = 0.0,
1538 const bool useRowNames =
true)
const;
1545 char const *
const *
const rowNames,
1546 char const *
const *
const columnNames,
1547 const double epsilon = 1.0e-5,
1548 const int numberAcross = 10,
1549 const int decimals = 5,
1550 const double objSense = 0.0,
1551 const bool useRowNames =
true)
const;
1555 virtual int readLp(
const char *filename,
const double epsilon = 1e-5);
1559 int readLp(FILE *fp,
const double epsilon = 1e-5);
1573 bool ignoreNames=
true);
1574 #ifdef COIN_SNAPSHOT
1575 virtual CoinSnapshot * snapshot(
bool createArrays=
true)
const;
1578 #ifdef COIN_FACTORIZATION_INFO
1728 bool enforceOptimality =
true);
1858 double* duals,
const double* c)
const ;
1865 virtual void getBInvARow(
int row,
double* z,
double* slack = NULL)
const ;
1868 virtual void getBInvRow(
int row,
double* z)
const ;
1871 virtual void getBInvACol(
int col,
double* vec)
const ;
1874 virtual void getBInvCol(
int col,
double* vec)
const ;
1883 virtual void getBasics(
int* index)
const ;
1912 virtual int pivot(
int colIn,
int colOut,
int outStatus) ;
1926 int& colOut,
int& outStatus,
1936 int colOut,
int outStatus,
1969 virtual void reset();
1987 char& sense,
double& right,
double& range)
const;
1993 double& lower,
double& upper)
const;
1996 template <
class T>
inline T
1998 return value < lower ? lower : (value > upper ? upper : value);
2082 char& sense,
double& right,
2083 double& range)
const
2094 range = upper - lower;
2117 double& lower,
double& upper)
const
2122 lower = upper = right;
2133 lower = right - range;
virtual void setColSolution(const double *colsol)=0
Set the primal solution variable values.
OsiObject ** objects() const
Get the array of objects.
virtual void setRowName(int ndx, std::string name)
Set a row name.
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
Load a model from a CoinModel object. Return the number of errors encountered.
virtual CoinWarmStart * getPointerToWarmStart(bool &mustDelete)
Get warm start information.
virtual void setObjSense(double s)=0
Set the objective function sense.
OsiAuxInfo * getAuxiliaryInfo() const
Get pointer to auxiliary info object.
std::vector< double > strictColSolution_
Column solution satisfying lower and upper column bounds.
~ApplyCutsReturnCode()
Destructor.
void setLanguage(CoinMessages::Language language)
Pass in a message handler.
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
virtual const char * getColType(bool refresh=false) const
Return an array[getNumCols()] of column types.
virtual const double * getReducedCost() const =0
Get a pointer to an array[getNumCols()] of reduced costs.
virtual const char * getRowSense() const =0
Get a pointer to an array[getNumRows()] of row constraint senses.
virtual const OsiNameVec & getColNames()
Return a pointer to a vector of column names.
void convertSenseToBound(const char sense, const double right, const double range, double &lower, double &upper) const
A quick inlined function to convert from the sense/rhs/range style of constraint definition to the lb...
virtual CoinWarmStart * getWarmStart() const =0
Get warm start information.
Primal feasibility tolerance.
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
virtual const OsiNameVec & getRowNames()
Return a pointer to a vector of row names.
Base class for message handling.
virtual const double * getRowLower() const =0
Get a pointer to an array[getNumRows()] of row lower bounds.
OsiSolverInterface & operator=(const OsiSolverInterface &rhs)
Assignment operator.
virtual void solveFromHotStart()
Optimize starting from the hot start snapshot.
int ineffective_
Counter for ineffective cuts.
virtual bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
int numberIntegers_
Number of integers.
virtual const double * getRowUpper() const =0
Get a pointer to an array[getNumRows()] of row upper bounds.
void incrementExternallyInconsistent()
Increment model-inconsistent counter.
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a set of rows.
virtual bool isProvenOptimal() const =0
Is optimality proven?
virtual void setObjCoeff(int elementIndex, double elementValue)=0
Set an objective function coefficient.
virtual void getBInvARow(int row, double *z, double *slack=NULL) const
Get a row of the tableau.
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)=0
Add a column (primal variable) to the problem.
virtual void setContinuous(int index)=0
Set the index-th variable to be a continuous variable.
virtual void setColName(int ndx, std::string name)
Set a column name.
const OsiObject * object(int which) const
Get the specified object.
virtual const CoinPackedMatrix * getMatrixByRow() const =0
Get a pointer to a row-wise copy of the matrix.
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const =0
Get as many dual rays as the solver can provide.
virtual const double * getRightHandSide() const =0
Get a pointer to an array[getNumRows()] of row right-hand sides.
Class to read and write Lp files.
void addObjects(int numberObjects, OsiObject **objects)
Add in object information.
char * columnType_
Column type 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later)...
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
virtual const double * getRowActivity() const =0
Get a pointer to array[getNumRows()] of row activity levels.
virtual std::vector< double * > getPrimalRays(int maxNumRays) const =0
Get as many primal rays as the solver can provide.
std::string strParam_[OsiLastStrParam]
Array of string parameters.
virtual void setObjName(std::string name)
Set the name of the objective function.
CoinWarmStart * ws_
Warm start information used for hot starts when the default hot start implementation is used...
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
virtual const double * getColUpper() const =0
Get a pointer to an array[getNumCols()] of column upper bounds.
virtual void applyColCut(const OsiColCut &cc)=0
Apply a column cut (adjust the bounds of one or more variables).
virtual int getNumCols() const =0
Get the number of columns.
virtual void setRowNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart)
Set multiple row names.
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...
OsiNameVec colNames_
Column names.
virtual int reducedCostFix(double gap, bool justInteger=true)
Fix variables at bound based on reduced cost.
virtual bool getHintParam(OsiHintParam key, bool &yesNo, OsiHintStrength &strength) const
Get a hint parameter (sense and strength only)
This class allows for a more structured use of algorithmic tweaking to an OsiSolverInterface.
virtual bool basisIsAvailable() const
Check if an optimal basis is available.
bool defaultHandler() const
Return true if default handler.
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the upper and lower bounds of a set of columns.
double forceFeasible()
Use current solution to set bounds so current integer feasible solution will stay feasible...
virtual const double * getStrictColSolution()
Get a pointer to an array[getNumCols()] of primal variable values guaranteed to be between the column...
int getNumApplied() const
Number of cuts applied.
OsiObject ** object_
Integer and ... information (integer info normally at beginning)
virtual const double * getObjCoefficients() const =0
Get a pointer to an array[getNumCols()] of objective function coefficients.
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Calculate duals and reduced costs for the given objective coefficients.
virtual void saveBaseModel()
Save a copy of the base model.
int getNumIneffective() const
Number of redundant or ineffective cuts.
friend void OsiSolverInterfaceCommonUnitTest(const OsiSolverInterface *emptySi, const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSolverInterface class.
Sparse Matrix Base Class.
virtual const double * getRowRange() const =0
Get a pointer to an array[getNumRows()] of row ranges.
virtual void enableSimplexInterface(bool doingPrimal)
Enables normal operation of subsequent functions.
OsiSolverInterface()
Default Constructor.
bool defaultHandler_
Flag to say if the currrent handler is the default handler.
virtual void getBasisStatus(int *cstat, int *rstat) const
Retrieve status information for column and row variables.
CoinMessages messages()
Return the current set of messages.
virtual void applyRowCut(const OsiRowCut &rc)=0
Apply a row cut (append to the constraint matrix).
virtual double getObjSense() const =0
Get the objective function sense.
virtual void setRowPrice(const double *rowprice)=0
Set dual solution variable values.
double getIntegerTolerance() const
Return the integrality tolerance of the underlying solver.
Collections of row cuts and column cuts.
virtual void writeMps(const char *filename, const char *extension="mps", double objSense=0.0) const =0
Write the problem in MPS format to the specified file.
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
virtual int getNumElements() const =0
Get the number of nonzero elements.
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
virtual void setColUpper(int elementIndex, double elementValue)=0
Set a single column upper bound.
OsiHintStrength hintStrength_[OsiLastHintParam]
Array of hint strengths.
void setRowColNames(const CoinMpsIO &mps)
Set row and column names from a CoinMpsIO object.
OsiRowCutDebugger * getRowCutDebuggerAlways() const
Get the row cut debugger object.
virtual bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
int numberObjects() const
Get the number of objects.
void deleteBranchingInfo(int numberDeleted, const int *which)
Deletes branching information before columns deleted.
Just a marker, so that OsiSolverInterface can allocate a static sized array to store parameters...
Abstract base class for various sparse vectors.
int applied_
Counter for applied cuts.
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 with the specified extension.
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
std::vector< int > OsiVectorInt
Vector of int.
virtual double getObjValue() const =0
Get the objective function value.
virtual void replaceMatrixOptional(const CoinPackedMatrix &)
Replace the constraint matrix.
int writeMpsNative(const char *filename, const char **rowNames, const char **columnNames, int formatType=0, int numberAcross=2, double objSense=0.0, int numberSOS=0, const CoinSet *setInfo=NULL) const
Write the problem in MPS format to the specified file with more control over the output.
virtual void setRowSetTypes(const int *indexFirst, const int *indexLast, const char *senseList, const double *rhsList, const double *rangeList)
Set the type of a set of rows.
int getNumInconsistent() const
Number of logically inconsistent cuts.
virtual void setObjCoeffSet(const int *indexFirst, const int *indexLast, const double *coeffList)
Set a set of objective function coefficients.
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *=NULL)
Set a hint parameter.
virtual void deleteRowNames(int tgtStart, int len)
Delete len row names starting at index tgtStart.
virtual bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
ApplyCutsReturnCode & operator=(const ApplyCutsReturnCode &rhs)
Assignment operator.
virtual int getIterationCount() const =0
Get the number of iterations it took to solve the problem (whatever `iteration' means to the solver)...
virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const
Get vector of indices of primal variables which are integer variables but have fractional values in t...
virtual void setRowType(int index, char sense, double rightHandSide, double range)=0
Set the type of a single row.
virtual std::string getObjName(unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the objective function.
void setApplicationData(void *appData)
Set application data.
friend void OsiSolverInterfaceMpsUnitTest(const std::vector< OsiSolverInterface * > &vecSiP, const std::string &mpsDir)
A function that tests that a lot of problems given in MPS files (mostly the NETLIB problems) solve pr...
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
CoinMessageHandler * handler_
Message handler.
OsiObject * modifiableObject(int which) const
Get the specified object.
Declaration of the generic simplex (basis-oriented) warm start class. Also contains a basis diff clas...
virtual int getNumRows() const =0
Get the number of rows.
const char * columnType(bool refresh=false) const
Return an array[getNumCols()] of column types.
Very simple class for containing data on set.
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 bool isContinuous(int colIndex) const =0
Return true if the variable is continuous.
virtual void getBasics(int *index) const
Get indices of basic variables.
virtual const double * getColLower() const =0
Get a pointer to an array[getNumCols()] of column lower bounds.
virtual void setInteger(int index)=0
Set the index-th variable to be an integer variable.
virtual int setBasisStatus(const int *cstat, const int *rstat)
Set the status of column and row variables and update the basis factorization and solution...
virtual const CoinPackedMatrix * getMatrixByCol() const =0
Get a pointer to a column-wise copy of the matrix.
virtual std::string getColName(int colIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the column.
virtual bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
virtual CoinPackedMatrix * getMutableMatrixByRow() const
Get a pointer to a mutable row-wise copy of the matrix.
void * getApplicationData() const
Get application data.
virtual void activateRowCutDebugger(const char *modelName)
Activate the row cut debugger.
virtual const double * getColSolution() const =0
Get a pointer to an array[getNumCols()] of primal variable values.
virtual bool getHintParam(OsiHintParam key, bool &yesNo) const
Get a hint parameter (sense only)
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get a pointer to a mutable column-wise copy of the matrix.
void convertBoundToSense(const double lower, const double upper, char &sense, double &right, double &range) const
A quick inlined function to convert from the lb/ub style of constraint definition to the sense/rhs/ra...
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
virtual void deleteCols(const int num, const int *colIndices)=0
Remove a set of columns (primal variables) from the problem.
virtual void setRowLower(int elementIndex, double elementValue)=0
Set a single row lower bound.
void incrementInternallyInconsistent()
Increment logically inconsistent cut counter.
virtual void setColNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart)
Set multiple column names.
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
OsiAuxInfo * appDataEtc_
Pointer to user-defined data structure - and more if user wants.
And this means throw an exception if not possible.
virtual ~OsiSolverInterface()
Destructor.
This is a first attempt at a message handler.
void findIntegers(bool justCount)
Identify integer variables and create corresponding objects.
CoinMessageHandler * messageHandler() const
Return a pointer to the current message handler.
virtual int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
Abstract Base Class for describing an interface to a solver.
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
virtual void markHotStart()
Create a hot start snapshot of the optimization process.
double dblParam_[OsiLastDblParam]
Array of double parameters.
T forceIntoRange(const T value, const T lower, const T upper) const
A quick inlined function to force a value to be between a minimum and a maximum value.
void incrementApplied()
Increment applied cut counter.
void setAuxiliaryInfo(OsiAuxInfo *auxiliaryInfo)
Create a clone of an Auxiliary Information object.
void setInitialData()
Set OsiSolverInterface object state for default constructor.
virtual bool setWarmStart(const CoinWarmStart *warmstart)=0
Set warm start information.
virtual std::string dfltRowColName(char rc, int ndx, unsigned digits=7) const
Generate a standard name of the form Rnnnnnnn or Cnnnnnnn.
int infeasible_
Counter for infeasible cuts.
std::string objName_
Objective name.
virtual void setObjective(const double *array)
Set the objective coefficients for all columns.
Class to hold and manipulate an array of massaged messages.
virtual int findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
Validate cuts against a known solution.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)=0
Add a row (constraint) to the problem.
Abstract base class for warm start information.
NON Abstract Base Class for interfacing with cut generators or branching code or .
void newLanguage(CoinMessages::Language language)
Set language.
virtual bool isProvenPrimalInfeasible() const =0
Is primal infeasibility proven?
Error Class thrown by an exception.
OsiRowCutDebugger * rowCutDebugger_
Pointer to row cut debugger object.
virtual void enableFactorization() const
Prepare the solver for the use of tableau access methods.
virtual double getInfinity() const =0
Get the solver's value for infinity.
int intInconsistent_
Counter for logically inconsistent cuts.
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub)=0
Load in a problem by assuming ownership of the arguments. The constraints on the rows are given by lo...
ApplyCutsReturnCode()
Default constructor.
virtual bool getHintParam(OsiHintParam key, bool &yesNo, OsiHintStrength &strength, void *&otherInformation) const
Get a hint parameter (all information)
ApplyCutsReturnCode(const ApplyCutsReturnCode &rhs)
Copy constructor.
int getNumInconsistentWrtIntegerModel() const
Number of cuts inconsistent with the current model.
virtual OsiSolverInterface * clone(bool copyData=true) const =0
Clone.
virtual int canDoSimplexInterface() const
Return the simplex implementation level.
virtual int readGMPL(const char *filename, const char *dataname=NULL)
Read a problem in GMPL format from the given filenames.
virtual void deleteRows(const int num, const int *rowIndices)=0
Delete a set of rows (constraints) from the problem.
In many cases it is natural to build a model by adding one row at a time.
virtual void initialSolve()=0
Solve initial LP relaxation.
int intParam_[OsiLastIntParam]
Array of integer parameters.
virtual void deleteColNames(int tgtStart, int len)
Delete len column names starting at index tgtStart.
Internal class for obtaining status from the applyCuts method.
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
virtual const double * getRowPrice() const =0
Get pointer to array[getNumRows()] of dual variable values.
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)=0
Load in a problem by copying the arguments. The constraints on the rows are given by lower and upper ...
const OsiRowCutDebugger * getRowCutDebugger() const
Get the row cut debugger provided the solution known to the debugger is within the feasible region he...
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
bool optimalBasisIsAvailable() const
Synonym for basisIsAvailable.
CoinMessages messages_
Messages.
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiNameVec rowNames_
Row names.
virtual bool isProvenDualInfeasible() const =0
Is dual infeasibility proven?
virtual void resolve()=0
Resolve an LP relaxation after problem modification.
virtual bool isIterationLimitReached() const =0
Iteration limit reached?
CoinMessages * messagesPointer()
Return a pointer to the current set of messages.
void setNumberObjects(int number)
Set the number of objects.
virtual void disableSimplexInterface()
Undo whatever setting changes the above method had to make.
virtual void reset()
Reset the solver interface.
void incrementIneffective()
Increment ineffective cut counter.
bool hintParam_[OsiLastHintParam]
Array of hint parameters.
int differentModel(OsiSolverInterface &other, bool ignoreNames=true)
Check two models against each other.
virtual int getNumIntegers() const
Get the number of integer variables.
void copyParameters(OsiSolverInterface &rhs)
Copy all parameters in this section from one solver to another.
virtual bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
This means it is only a hint.
virtual CoinWarmStart * getEmptyWarmStart() const =0
Get an empty warm start object.
Abstract base class for `objects'.
int getNumInfeasible() const
Number of cuts that cause obvious infeasibility.
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
int writeLpNative(const char *filename, char const *const *const rowNames, char const *const *const columnNames, const double epsilon=1.0e-5, const int numberAcross=10, const int decimals=5, const double objSense=0.0, const bool useRowNames=true) const
Write the problem into an Lp file.
virtual bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
virtual void setRowUpper(int elementIndex, double elementValue)=0
Set a single row upper bound.
virtual void disableFactorization() const
Undo the effects of enableFactorization.
void deleteObjects()
Delete all object information.
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
Language
Supported languages.
virtual void restoreBaseModel(int numberRows)
Reduce the constraint system to the specified number of constraints.
virtual std::string getRowName(int rowIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the row.
virtual void unmarkHotStart()
Delete the hot start snapshot.
std::vector< std::string > OsiNameVec
Data type for name vectors.
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 replaceMatrix(const CoinPackedMatrix &)
Replace the constraint matrix.
void incrementInfeasible()
Increment infeasible cut counter.
virtual void branchAndBound()=0
Invoke solver's built-in enumeration algorithm.
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format from file with name filename.
int numberObjects_
Total number of objects.
int extInconsistent_
Counter for model-inconsistent cuts.
virtual bool isAbandoned() const =0
Are there numerical difficulties?