5#ifndef OsiSolverInterface_H
6#define OsiSolverInterface_H
12#include "CoinTypes.hpp"
13#include "CoinMessageHandler.hpp"
14#include "CoinPackedVectorBase.hpp"
15#include "CoinPackedMatrix.hpp"
16#include "CoinWarmStart.hpp"
17#include "CoinFinite.hpp"
18#include "CoinError.hpp"
64 const std::string &mpsDir,
65 const std::string &netlibDir);
67 const std::vector< OsiSolverInterface * > &vecSiP,
68 const std::string &mpsDir);
190#ifdef CBC_NEXT_VERSION
214 int &numberSolves,
int &numberIterations,
215 bool forceBranch =
false);
321 throw CoinError(
"OsiForceDo illegal",
322 "setHintParam",
"OsiSolverInterface");
360 void *&otherInformation)
const
366 otherInformation = NULL;
729 bool fullRay =
false)
const = 0;
767 virtual void setObjCoeff(
int elementIndex,
double elementValue) = 0;
771 const int *indexLast,
772 const double *coeffList);
795 virtual void setColLower(
int elementIndex,
double elementValue) = 0;
806 virtual void setColUpper(
int elementIndex,
double elementValue) = 0;
819 double lower,
double upper)
832 const int *indexLast,
833 const double *boundList);
837 virtual void setRowLower(
int elementIndex,
double elementValue) = 0;
841 virtual void setRowUpper(
int elementIndex,
double elementValue) = 0;
847 double lower,
double upper)
860 const int *indexLast,
861 const double *boundList);
864 virtual void setRowType(
int index,
char sense,
double rightHandSide,
873 const int *indexLast,
874 const char *senseList,
875 const double *rhsList,
876 const double *rangeList);
963 int ndx,
unsigned digits = 7)
const;
967 virtual std::string
getObjName(
unsigned maxLen =
static_cast< unsigned >(std::string::npos))
const;
983 unsigned maxLen =
static_cast< unsigned >(std::string::npos))
const;
1012 int srcStart,
int len,
int tgtStart);
1028 unsigned maxLen =
static_cast< unsigned >(std::string::npos))
const;
1055 int srcStart,
int len,
int tgtStart);
1098 virtual void addCol(
const CoinPackedVectorBase &vec,
1099 const double collb,
const double colub,
1108 virtual void addCol(
const CoinPackedVectorBase &vec,
1109 const double collb,
const double colub,
1110 const double obj, std::string name);
1114 const int *rows,
const double *elements,
1115 const double collb,
const double colub,
1124 const int *rows,
const double *elements,
1125 const double collb,
const double colub,
1126 const double obj, std::string name);
1134 const CoinPackedVectorBase *
const *cols,
1135 const double *collb,
const double *colub,
1143 virtual void addCols(
const int numcols,
const CoinBigIndex *columnStarts,
1144 const int *rows,
const double *elements,
1145 const double *collb,
const double *colub,
1160 virtual void addCols(
const CoinPackedMatrix& matrix,
1161 const double* collb,
const double* colub,
1171 virtual void deleteCols(
const int num,
const int *colIndices) = 0;
1174 virtual void addRow(
const CoinPackedVectorBase &vec,
1175 const double rowlb,
const double rowub)
1183 virtual void addRow(
const CoinPackedVectorBase &vec,
1184 const double rowlb,
const double rowub,
1188 virtual void addRow(
const CoinPackedVectorBase &vec,
1189 const char rowsen,
const double rowrhs,
1190 const double rowrng)
1198 virtual void addRow(
const CoinPackedVectorBase &vec,
1199 const char rowsen,
const double rowrhs,
1200 const double rowrng, std::string name);
1207 const int *columns,
const double *element,
1208 const double rowlb,
const double rowub);
1216 const CoinPackedVectorBase *
const *rows,
1217 const double *rowlb,
const double *rowub);
1225 const CoinPackedVectorBase *
const *rows,
1226 const char *rowsen,
const double *rowrhs,
1227 const double *rowrng);
1234 virtual void addRows(
const int numrows,
const CoinBigIndex *rowStarts,
1235 const int *columns,
const double *element,
1236 const double *rowlb,
const double *rowub);
1253 virtual void addRows(
const CoinPackedMatrix& matrix,
1254 const double* rowlb,
const double* rowub);
1256 virtual void addRows(
const CoinPackedMatrix& matrix,
1257 const char* rowsen,
const double* rowrhs,
1258 const double* rowrng);
1266 virtual void deleteRows(
const int num,
const int *rowIndices) = 0;
1326 double effectivenessLb = 0.0);
1364 const double *collb,
const double *colub,
1366 const double *rowlb,
const double *rowub)
1379 double *&collb,
double *&colub,
double *&obj,
1380 double *&rowlb,
double *&rowub)
1400 const double *collb,
const double *colub,
1402 const char *rowsen,
const double *rowrhs,
1403 const double *rowrng)
1416 double *&collb,
double *&colub,
double *&obj,
1417 char *&rowsen,
double *&rowrhs,
1434 const CoinBigIndex *start,
const int *index,
1435 const double *value,
1436 const double *collb,
const double *colub,
1438 const double *rowlb,
const double *rowub)
1454 const CoinBigIndex *start,
const int *index,
1455 const double *value,
1456 const double *collb,
const double *colub,
1458 const char *rowsen,
const double *rowrhs,
1459 const double *rowrng)
1469 bool keepSolution =
false);
1477 const char *extension =
"mps");
1485 virtual int readMps(
const char *filename,
const char *extension,
1486 int &numberSets, CoinSet **&sets);
1493 virtual int readGMPL(
const char *filename,
const char *dataname = NULL);
1502 const char *extension =
"mps",
1503 double objSense = 0.0)
const = 0;
1519 const char **rowNames,
const char **columnNames,
1520 int formatType = 0,
int numberAcross = 2,
1521 double objSense = 0.0,
int numberSOS = 0,
1522 const CoinSet *setInfo = NULL)
const;
1547 const char *extension =
"lp",
1548 double epsilon = 1e-5,
1549 int numberAcross = 10,
1551 double objSense = 0.0,
1552 bool useRowNames =
true)
const;
1559 double epsilon = 1e-5,
1560 int numberAcross = 10,
1562 double objSense = 0.0,
1563 bool useRowNames =
true)
const;
1584 char const *
const *
const rowNames,
1585 char const *
const *
const columnNames,
1586 const double epsilon = 1.0e-5,
1587 const int numberAcross = 10,
1588 const int decimals = 5,
1589 const double objSense = 0.0,
1590 const bool useRowNames =
true)
const;
1597 char const *
const *
const rowNames,
1598 char const *
const *
const columnNames,
1599 const double epsilon = 1.0e-5,
1600 const int numberAcross = 10,
1601 const int decimals = 5,
1602 const double objSense = 0.0,
1603 const bool useRowNames =
true)
const;
1607 virtual int readLp(
const char *filename,
const double epsilon = 1e-5);
1611 int readLp(FILE *fp,
const double epsilon = 1e-5);
1625 bool ignoreNames =
true);
1630 void statistics(
double &minimumNegative,
double &maximumNegative,
1631 double &minimumPositive,
double &maximumPositive,
1632 int type = 3)
const;
1635 virtual CoinSnapshot *snapshot(
bool createArrays =
true)
const;
1637#ifdef COIN_FACTORIZATION_INFO
1639 virtual CoinBigIndex getSizeL()
const;
1641 virtual CoinBigIndex getSizeU()
const;
1799 bool enforceOptimality =
true);
1929 double *duals,
const double *c)
const;
1936 virtual void getBInvARow(
int row,
double *z,
double *slack = NULL)
const;
1983 virtual int pivot(
int colIn,
int colOut,
int outStatus);
1997 int &colOut,
int &outStatus,
1998 double &t, CoinPackedVector *dx);
2007 int colOut,
int outStatus,
2008 double &t, CoinPackedVector *dx);
2058 char &sense,
double &right,
double &range)
const;
2064 double &lower,
double &upper)
const;
2067 template <
class T >
2071 return value < lower ? lower : (value > upper ? upper : value);
2157 char &sense,
double &right,
2158 double &range)
const
2165 if (upper == lower) {
2169 range = upper - lower;
2192 double &lower,
double &upper)
const
2197 lower = upper = right;
2208 lower = right - range;
std::vector< int > OsiVectorInt
Vector of int.
@ OsiPrimalTolerance
Primal feasibility tolerance.
@ OsiLastDblParam
End marker.
@ OsiLastStrParam
End marker.
@ OsiForceDo
And this means throw an exception if not possible.
@ OsiHintTry
This means it is only a hint.
@ OsiLastHintParam
Just a marker, so that OsiSolverInterface can allocate a static sized array to store parameters.
@ OsiLastIntParam
End marker.
This class allows for a more structured use of algorithmic tweaking to an OsiSolverInterface.
Collections of row cuts and column cuts.
Abstract base class for ‘objects’.
Validate cuts against a known solution.
Internal class for obtaining status from the applyCuts method.
int infeasible_
Counter for infeasible cuts.
~ApplyCutsReturnCode()
Destructor.
int getNumInconsistentWrtIntegerModel() const
Number of cuts inconsistent with the current model.
void incrementApplied()
Increment applied cut counter.
int extInconsistent_
Counter for model-inconsistent cuts.
int getNumApplied() const
Number of cuts applied.
int getNumIneffective() const
Number of redundant or ineffective cuts.
friend class OsiClpSolverInterface
ApplyCutsReturnCode()
Default constructor.
ApplyCutsReturnCode(const ApplyCutsReturnCode &rhs)
Copy constructor.
void incrementInfeasible()
Increment infeasible cut counter.
int getNumInfeasible() const
Number of cuts that cause obvious infeasibility.
void incrementInternallyInconsistent()
Increment logically inconsistent cut counter.
int applied_
Counter for applied cuts.
ApplyCutsReturnCode & operator=(const ApplyCutsReturnCode &rhs)
Assignment operator.
void incrementExternallyInconsistent()
Increment model-inconsistent counter.
int intInconsistent_
Counter for logically inconsistent cuts.
void incrementIneffective()
Increment ineffective cut counter.
int getNumInconsistent() const
Number of logically inconsistent cuts.
int ineffective_
Counter for ineffective cuts.
Abstract Base Class for describing an interface to a solver.
const OsiObject * object(int which) const
Get the specified object.
int writeLpNative(FILE *fp, 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 the file pointed to by the parameter fp.
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 void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a set of rows.
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)=0
Add a column (primal variable) to the problem.
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 void resolve()=0
Resolve an LP relaxation after problem modification.
CoinMessages messages()
Return the current set of messages.
virtual std::string getObjName(unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the objective function.
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 numberIntegers_
Number of integers.
int numberObjects_
Total number of objects.
virtual CoinWarmStart * getPointerToWarmStart(bool &mustDelete)
Get warm start information.
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
virtual void deleteCols(const int num, const int *colIndices)=0
Remove a set of columns (primal variables) from the problem.
void setNumberObjects(int number)
Set the number of objects.
virtual void setObjName(std::string name)
Set the name of the objective function.
const OsiRowCutDebugger * getRowCutDebugger() const
Get the row cut debugger provided the solution known to the debugger is within the feasible region he...
CoinMessageHandler * handler_
Message handler.
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get a pointer to a mutable column-wise copy of the matrix.
void setRowColNames(CoinLpIO &mod)
Set row and column names from a CoinLpIO object.
virtual std::vector< double * > getPrimalRays(int maxNumRays) const =0
Get as many primal rays as the solver can provide.
virtual int getIterationCount() const =0
Get the number of iterations it took to solve the problem (whatever ‘iteration’ means to the solver).
OsiAuxInfo * appDataEtc_
Pointer to user-defined data structure - and more if user wants.
virtual void deleteColNames(int tgtStart, int len)
Delete len column names starting at index tgtStart.
virtual std::string getColName(int colIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the column.
virtual bool getHintParam(OsiHintParam key, bool &yesNo, OsiHintStrength &strength, void *&otherInformation) const
Get a hint parameter (all information)
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj, std::string name)
Add a named column (primal variable) to the problem.
virtual void disableFactorization() const
Undo the effects of enableFactorization.
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
bool defaultHandler() const
Return true if default handler.
virtual std::string dfltRowColName(char rc, int ndx, unsigned digits=7) const
Generate a standard name of the form Rnnnnnnn or Cnnnnnnn.
virtual void setInteger(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be integer variables.
OsiSolverInterface(const OsiSolverInterface &)
Copy constructor.
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...
void findIntegers(bool justCount)
Identify integer variables and create corresponding objects.
OsiNameVec colNames_
Column names.
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 OsiNameVec & getColNames()
Return a pointer to a vector of column names.
virtual const double * getObjCoefficients() const =0
Get a pointer to an array[getNumCols()] of objective function coefficients.
virtual double getInfinity() const =0
Get the solver's value for infinity.
OsiObject * modifiableObject(int which) const
Get the specified object.
virtual const double * getRightHandSide() const =0
Get a pointer to an array[getNumRows()] of row right-hand sides.
virtual bool isProvenPrimalInfeasible() const =0
Is primal infeasibility proven?
virtual const double * getColUpper() const =0
Get a pointer to an array[getNumCols()] of column upper bounds.
void statistics(double &minimumNegative, double &maximumNegative, double &minimumPositive, double &maximumPositive, int type=3) const
Get some statistics about model - min/max always computed type 0->4 , larger gives more information 0...
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the upper and lower bounds of a set of columns.
void setAuxiliaryInfo(OsiAuxInfo *auxiliaryInfo)
Create a clone of an Auxiliary Information object.
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const =0
Get as many dual rays as the solver can provide.
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 addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)=0
Add a row (constraint) to the problem.
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *=NULL)
Set a hint parameter.
void setApplicationData(void *appData)
Set application data.
virtual CoinBigIndex getNumElements() const =0
Get the number of nonzero elements.
virtual void unmarkHotStart()
Delete the hot start snapshot.
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
virtual void replaceMatrixOptional(const CoinPackedMatrix &)
Replace the constraint matrix.
virtual bool getHintParam(OsiHintParam key, bool &yesNo, OsiHintStrength &strength) const
Get a hint parameter (sense and strength only)
virtual bool isProvenOptimal() const =0
Is optimality proven?
virtual ~OsiSolverInterface()
Destructor.
virtual void setContinuous(int index)=0
Set the index-th variable to be a continuous variable.
virtual void getBInvARow(int row, double *z, double *slack=NULL) const
Get a row of the tableau.
bool optimalBasisIsAvailable() const
Synonym for basisIsAvailable.
OsiSolverInterface()
Default Constructor.
OsiRowCutDebugger * rowCutDebugger_
Pointer to row cut debugger object.
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)=0
Load in a problem by copying the arguments.
OsiHintStrength hintStrength_[OsiLastHintParam]
Array of hint strengths.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)=0
Add a row (constraint) to the problem.
virtual void setColSolution(const double *colsol)=0
Set the primal solution variable values.
friend void OsiSolverInterfaceCommonUnitTest(const OsiSolverInterface *emptySi, const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSolverInterface class.
virtual void writeLp(const char *filename, const char *extension="lp", double epsilon=1e-5, int numberAcross=10, int decimals=9, double objSense=0.0, bool useRowNames=true) const
Write the problem into an Lp file of the given filename with the specified extension.
virtual CoinPackedMatrix * getMutableMatrixByRow() const
Get a pointer to a mutable row-wise copy of the matrix.
OsiObject ** objects() const
Get the array of objects.
virtual void getBasisStatus(int *cstat, int *rstat) const
Retrieve status information for column and row variables.
int addCols(CoinModel &modelObject)
Add columns from a model object.
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
CoinMessageHandler * messageHandler() const
Return a pointer to the current message handler.
virtual void setRowPrice(const double *rowprice)=0
Set dual solution variable values.
int intParam_[OsiLastIntParam]
Array of integer parameters.
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
virtual void restoreBaseModel(int numberRows)
Reduce the constraint system to the specified number of constraints.
virtual bool isIterationLimitReached() const =0
Iteration limit reached?
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.
void setRowColNames(const CoinMpsIO &mps)
Set row and column names from a CoinMpsIO object.
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
const char * columnType(bool refresh=false) const
Return an array[getNumCols()] of column types.
void newLanguage(CoinMessages::Language language)
Set language.
int addRows(CoinModel &modelObject)
Add rows from a CoinModel object.
virtual void applyColCut(const OsiColCut &cc)=0
Apply a column cut (adjust the bounds of one or more variables).
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
Add a set of rows (constraints) to the problem.
virtual const double * getReducedCost() const =0
Get a pointer to an array[getNumCols()] of reduced costs.
virtual void setRowName(int ndx, std::string name)
Set a row name.
virtual void setColUpper(const double *array)
Set the upper bounds for all columns.
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 const double * getStrictColSolution()
Get a pointer to an array[getNumCols()] of primal variable values guaranteed to be between the column...
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
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.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub, std::string name)
Add a named row (constraint) to the problem.
virtual void disableSimplexInterface()
Undo whatever setting changes the above method had to make.
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
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)=0
Load in a problem by copying the arguments.
virtual const OsiNameVec & getRowNames()
Return a pointer to a vector of row names.
virtual const char * getColType(bool refresh=false) const
Return an array[getNumCols()] of column types.
virtual const double * getRowPrice() const =0
Get pointer to array[getNumRows()] of dual variable values.
virtual void addRows(const int numrows, const CoinBigIndex *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub)
Add a set of rows (constraints) to the problem.
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
virtual int findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
virtual int readGMPL(const char *filename, const char *dataname=NULL)
Read a problem in GMPL format from the given filenames.
void addObjects(int numberObjects, OsiObject **objects)
Add in object information.
void setInitialData()
Set OsiSolverInterface object state for default constructor.
virtual int canDoSimplexInterface() const
Return the simplex implementation level.
virtual bool isProvenDualInfeasible() const =0
Is dual infeasibility proven?
virtual void markHotStart()
Create a hot start snapshot of the optimization process.
virtual void getBasics(int *index) const
Get indices of basic variables.
virtual const double * getRowLower() const =0
Get a pointer to an array[getNumRows()] of row lower bounds.
void setLanguage(CoinMessages::Language language)
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
virtual void setRowUpper(int elementIndex, double elementValue)=0
Set a single row upper bound.
virtual bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
virtual int getNumRows() const =0
Get the number of rows.
virtual CoinWarmStart * getEmptyWarmStart() const =0
Get an empty warm start object.
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.
virtual bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
virtual int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
virtual bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
virtual void initialSolve()=0
Solve initial LP relaxation.
CoinMessages * messagesPointer()
Return a pointer to the current set of messages.
virtual void setObjective(const double *array)
Set the objective coefficients for all columns.
CoinMessages messages_
Messages.
virtual void setRowLower(int elementIndex, double elementValue)=0
Set a single row lower bound.
virtual void branchAndBound()=0
Invoke solver's built-in enumeration algorithm.
virtual const double * getColLower() const =0
Get a pointer to an array[getNumCols()] of column lower bounds.
virtual void setColName(int ndx, std::string name)
Set a column name.
virtual void setRowNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart)
Set multiple row names.
double forceFeasible()
Use current solution to set bounds so current integer feasible solution will stay feasible.
void setColumnType(int iColumn, char type)
Set column type.
virtual void applyRowCut(const OsiRowCut &rc)=0
Apply a row cut (append to the constraint matrix).
virtual void activateRowCutDebugger(const double *solution, bool enforceOptimality=true)
Activate the row cut debugger using a full solution array.
virtual int reducedCostFix(double gap, bool justInteger=true)
Fix variables at bound based on reduced cost.
virtual void setObjCoeffSet(const int *indexFirst, const int *indexLast, const double *coeffList)
Set a set of objective function coefficients.
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)=0
Load in a problem by copying the arguments.
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format from file with name filename.
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.
CoinWarmStart * ws_
Warm start information used for hot starts when the default hot start implementation is used.
virtual double getObjValue() const =0
Get the objective function value.
int readLp(FILE *fp, const double epsilon=1e-5)
Read file in LP format from the file pointed to by fp.
virtual void setColUpper(int elementIndex, double elementValue)=0
Set a single column upper bound.
void deleteObjects()
Delete all object information.
virtual void saveBaseModel()
Save a copy of the base model.
int numberObjects() const
Get the number of objects.
virtual bool isContinuous(int colIndex) const =0
Return true if the variable is continuous.
virtual const double * getColSolution() const =0
Get a pointer to an array[getNumCols()] of primal variable values.
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
std::vector< double > strictColSolution_
Column solution satisfying lower and upper column bounds.
char * columnType_
Column type 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later)...
virtual const char * getRowSense() const =0
Get a pointer to an array[getNumRows()] of row constraint senses.
virtual bool getHintParam(OsiHintParam key, bool &yesNo) const
Get a hint parameter (sense only)
virtual void setColNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart)
Set multiple column names.
void copyParameters(OsiSolverInterface &rhs)
Copy all parameters in this section from one solver to another.
void addRows(const CoinBuild &buildObject)
Add rows using a CoinBuild object.
OsiObject ** object_
Integer and ... information (integer info normally at beginning)
virtual double getObjSense() const =0
Get the objective function sense.
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 setDblParam(OsiDblParam key, double value)
Set a double parameter.
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
virtual bool isAbandoned() const =0
Are there numerical difficulties?
virtual int getNumIntegers() const
Get the number of integer variables.
virtual std::string getRowName(int rowIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the row.
virtual bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
virtual const CoinPackedMatrix * getMatrixByRow() const =0
Get a pointer to a row-wise copy of the matrix.
virtual const double * getRowUpper() const =0
Get a pointer to an array[getNumRows()] of row upper bounds.
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 void reset()
Reset the solver interface.
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
Add a set of rows (constraints) to the problem.
double getIntegerTolerance() const
Return the integrality tolerance of the underlying solver.
void addCols(const CoinBuild &buildObject)
Add columns using a CoinBuild object.
virtual const CoinPackedMatrix * getMatrixByCol() const =0
Get a pointer to a column-wise copy of the matrix.
virtual void deleteRowNames(int tgtStart, int len)
Delete len row names starting at index tgtStart.
int differentModel(OsiSolverInterface &other, bool ignoreNames=true)
Check two models against each other.
virtual void setInteger(int index)=0
Set the index-th variable to be an integer variable.
void setRowColNames(CoinModel &mod)
Set row and column names from a CoinModel object.
OsiSolverInterface & operator=(const OsiSolverInterface &rhs)
Assignment operator.
std::string objName_
Objective name.
virtual void addCols(const int numcols, const CoinBigIndex *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
Add a set of columns (primal variables) to the problem.
virtual void 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 addCol(int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj, std::string name)
Add a named column (primal variable) to the problem.
virtual void setRowType(int index, char sense, double rightHandSide, double range)=0
Set the type of a single row.
virtual const double * getRowActivity() const =0
Get a pointer to array[getNumRows()] of row activity levels.
virtual int getNumCols() const =0
Get the number of columns.
virtual void replaceMatrix(const CoinPackedMatrix &)
Replace the constraint matrix.
OsiNameVec rowNames_
Row names.
virtual void addRow(int numberElements, const int *columns, const double *element, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiAuxInfo * getAuxiliaryInfo() const
Get pointer to auxiliary info object.
virtual void solveFromHotStart()
Optimize starting from the hot start snapshot.
virtual void enableFactorization() const
Prepare the solver for the use of tableau access methods.
OsiRowCutDebugger * getRowCutDebuggerAlways() const
Get the row cut debugger object.
virtual const double * getRowRange() const =0
Get a pointer to an array[getNumRows()] of row ranges.
virtual void activateRowCutDebugger(const char *modelName)
Activate the row cut debugger.
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,...
void * getApplicationData() const
Get application data.
std::vector< std::string > OsiNameVec
Data type for name vectors.
virtual void writeLp(FILE *fp, double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
Write the problem into the file pointed to by the parameter fp.
virtual void setObjSense(double s)=0
Set the objective function sense.
virtual void setContinuous(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be continuous variables.
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
void deleteBranchingInfo(int numberDeleted, const int *which)
Deletes branching information before columns deleted.
virtual int readMps(const char *filename, const char *extension, int &numberSets, CoinSet **&sets)
Read a problem in MPS format from the given full filename.
virtual bool basisIsAvailable() const
Check if an optimal basis is available.
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.
virtual void deleteRows(const int num, const int *rowIndices)=0
Delete a set of rows (constraints) from the problem.
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
virtual CoinWarmStart * getWarmStart() const =0
Get warm start information.
virtual void enableSimplexInterface(bool doingPrimal)
Enables normal operation of subsequent functions.
virtual void setColLower(const double *array)
Set the lower bounds for all columns.
bool hintParam_[OsiLastHintParam]
Array of hint parameters.
double dblParam_[OsiLastDblParam]
Array of double parameters.
std::string strParam_[OsiLastStrParam]
Array of string parameters.
virtual OsiSolverInterface * clone(bool copyData=true) const =0
Clone.
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Calculate duals and reduced costs for the given objective coefficients.
virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts)
Apply a collection of row cuts which are all effective.
virtual bool setWarmStart(const CoinWarmStart *warmstart)=0
Set warm start information.
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng)=0
Load in a problem by assuming ownership of the arguments.
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 int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
Load a model from a CoinModel object.
bool defaultHandler_
Flag to say if the currrent handler is the default handler.
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
virtual void setObjCoeff(int elementIndex, double elementValue)=0
Set an objective function coefficient.
virtual bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.