19 #ifndef OsiSymSolverInterface_hpp
20 #define OsiSymSolverInterface_hpp
78 virtual double getLbForNewObj(
int cnt,
int *index,
112 virtual bool setSymParam(
const std::string key,
int value);
122 virtual bool setSymParam(
const std::string key,
double value);
133 virtual bool setSymParam(
const std::string key,
const std::string value);
144 virtual bool getSymParam(
const std::string key,
int& value)
const;
154 virtual bool getSymParam(
const std::string key,
double& value)
const;
165 virtual bool getSymParam(
const std::string key, std::string& value)
const;
183 throw CoinError(
"Error: Function not implemented",
184 "isProvenDualInfeasible",
"OsiSymSolverInterface");
216 throw CoinError(
"Error: Function not implemented",
217 "getEmptyWarmStart",
"OsiSymSolverInterface");
324 virtual bool isBinary(
int colIndex)
const;
330 virtual bool isInteger(
int colIndex)
const;
388 bool fullRay =
false)
const{
389 throw CoinError(
"Error: Function not implemented",
390 "getDualRays",
"OsiSymSolverInterface");
404 throw CoinError(
"Error: Function not implemented",
405 "getPrimalRays",
"OsiSymSolverInterface");
423 virtual void setObjCoeff(
int elementIndex,
double elementValue );
426 virtual void setObj2Coeff(
int elementIndex,
double elementValue );
431 virtual void setColLower(
int elementIndex,
double elementValue );
436 virtual void setColUpper(
int elementIndex,
double elementValue );
440 virtual void setRowLower(
int elementIndex,
double elementValue );
444 virtual void setRowUpper(
int elementIndex,
double elementValue );
447 virtual void setRowType(
int index,
char sense,
double rightHandSide,
513 const double collb,
const double colub,
517 virtual void deleteCols(
const int num,
const int * colIndices);
522 const double rowlb,
const double rowub);
525 const char rowsen,
const double rowrhs,
526 const double rowrng);
529 virtual void deleteRows(
const int num,
const int * rowIndices);
552 const double* collb,
const double* colub,
554 const double* rowlb,
const double* rowub);
566 double*& collb,
double*& colub,
double*& obj,
567 double*& rowlb,
double*& rowub);
582 const double* collb,
const double* colub,
584 const char* rowsen,
const double* rowrhs,
585 const double* rowrng);
597 double*& collb,
double*& colub,
double*& obj,
598 char*& rowsen,
double*& rowrhs,
603 virtual void loadProblem(
const int numcols,
const int numrows,
606 const double* collb,
const double* colub,
608 const double* rowlb,
const double* rowub);
612 virtual void loadProblem(
const int numcols,
const int numrows,
615 const double* collb,
const double* colub,
617 const char* rowsen,
const double* rowrhs,
618 const double* rowrng);
626 virtual void writeMps(
const char *filename,
627 const char *extension =
"mps",
628 double objSense=0.0)
const;
633 virtual int readMps(
const char * infile,
const char *extension =
"mps");
635 virtual int readGMPL(
const char * modelFile,
const char * dataFile=NULL);
697 virtual void reset();
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
keep all cached data (similar to getMutableLpPtr())
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
virtual int readGMPL(const char *modelFile, const char *dataFile=NULL)
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
double * obj2_
Pointer to second objective vector to be used in bicriteria solver.
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
virtual CoinWarmStart * getWarmStart() const
Get warm start information.
virtual bool isAbandoned() const
Are there numerical difficulties?
virtual void loadProblem()
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
virtual const double * getObj2Coefficients() const
Get pointer to array[getNumCols()] of second objective function coefficients if loaded before...
virtual bool isInteger(int colIndex) const
Return true if column is integer.
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to the constraint matrix).
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
virtual bool getSymParam(OsiSymIntParam key, int &value) const
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
double * rowupper_
Pointer to dense vector of row upper bounds.
void freeAllMemory()
free all allocated memory
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal variable values.
OSI Solver Interface for SYMPHONY.
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
virtual bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiSymSolverInterface & operator=(const OsiSymSolverInterface &rhs)
Assignment operator.
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
virtual int getNumRows() const
Get number of rows.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
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.
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution ve...
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row.
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
virtual bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
virtual ~OsiSymSolverInterface()
Destructor.
void gutsOfDestructor()
The real work of the destructor.
char * rowsense_
Pointer to dense vector of row sense indicators.
virtual void reset()
Reset the solver interface.
virtual void initialSolve()
Solve initial LP relaxation.
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
virtual double getLbForNewRhs(int cnt, int *index, double *value)
Get a lower bound for the new rhs problem using the warm start tree.
virtual void multiCriteriaBranchAndBound()
Invoke solver's multi-criteria enumeration algorithm.
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
virtual bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
free only cached LP solution information
Sparse Matrix Base Class.
problem matrix: matrix ordered by column and by row
virtual double getUbForNewRhs(int cnt, int *index, double *value)
Get an upper bound for the new rhs problem using the warm start tree.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
free only cached matrix and LP solution information
only discard cached LP solution
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
void freeCachedResults()
free cached result vectors
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
double * rowlower_
Pointer to dense vector of row lower bounds.
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
virtual void setColUpper(int elementIndex, double elementValue)=0
Set a single column upper bound.
virtual bool isTimeLimitReached() const
Time limit reached?
virtual bool isContinuous(int colIndex) const
Return true if variable is continuous.
void findInitialBounds()
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
row information: right hand sides, ranges and senses, lower and upper bounds for row ...
Abstract base class for various sparse vectors.
virtual bool isIntegerNonBinary(int colIndex) const
Return true if variable is general integer.
virtual bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
virtual double getInfinity() const
Get solver's value for infinity.
virtual int readMps(const char *infile, const char *extension="mps")
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
virtual double getUbForNewObj(int cnt, int *index, double *value)
Solve initial LP relaxation.
int createPermanentCutPools()
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub)
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by l...
virtual void setObjSense(double s)
Set the objective function sense.
sym_environment * getSymphonyEnvironment() const
Get pointer to SYMPHONY environment (eventually we won't need this)
virtual bool isTargetGapReached() const
Target gap achieved?
void freeCachedColRim()
free cached column rim vectors
free only cached column and LP solution information
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust the bounds of one or more variables).
sym_environment * env_
The pointer to the SYMPHONY problem environment.
virtual bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
virtual int getNumElements() const
Get number of nonzero elements.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
column information: objective values, lower and upper bounds, variable types
double * colredcost_
Pointer to dense vector of variable lower bounds.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual variable values.
free only cached row and LP solution information
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound.
virtual void setInteger(int index)=0
Set the index-th variable to be an integer variable.
double * collower_
Pointer to dense vector of variable lower bounds.
double * rowprice_
Pointer to dense vector of row prices.
virtual double getObjValue() const
Get objective function value.
double * obj_
Pointer to objective vector.
LP solution: primal and dual solution, reduced costs, row activities.
virtual void setColSolution(const double *colsol)
Set the primal solution variable values.
friend void OsiSymSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSymSolverInterface class.
virtual bool isBinary(int colIndex) const
Return true if variable is binary.
double * colsol_
Pointer to primal solution vector.
Abstract Base Class for describing an interface to a solver.
virtual void setPrimalBound(const double bound)
Set the a priori upper/lower bound.
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
virtual int getIterationCount() const
Get the number of iterations it took to solve the problem (whatever ``iteration'' means to the solve...
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
discard all cached data (default)
virtual bool isIterationLimitReached() const
Is the given primal objective limit reached?
void gutsOfConstructor()
The real work of the constructor.
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.
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
virtual void setRowPrice(const double *rowprice)
Set dual solution variable values.
Error Class thrown by an exception.
void parseCommandLine(int argc, char **argv)
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound.
virtual bool isFreeBinary(int colIndex) const
Return true if variable is binary and not fixed at either bound.
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of row right-hand sides.
void OsiSymSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSymSolverInterface class.
double * rowact_
Pointer to row activity (slack) vector.
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
void freeCachedMatrix()
free cached matrices
virtual bool setSymParam(OsiSymIntParam key, int value)
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warm start information.
virtual bool isProvenOptimal() const
Is optimality proven?
virtual void setColName(char **colname)
Set the index-th variable to be a continuous variable.
double * rhs_
Pointer to dense vector of row right-hand side values.
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound.
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
virtual void writeMps(const char *filename, const char *extension="mps", double objSense=0.0) const
Write the problem in MPS format to the specified file.
virtual bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiSymSolverInterface()
Default Constructor.
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
virtual int getNumCols() const
Get number of columns.
double * colupper_
Pointer to dense vector of variable lower bounds.
virtual void setObj2Coeff(int elementIndex, double elementValue)
Set an objective function coefficient for the second objective.
virtual void resolve()
Resolve an IP problem modification.
void setInitialData()
Set OsiSolverInterface object state for default constructor.
void freeCachedRowRim()
free cached row rim vectors
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound.
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
virtual double getPrimalBound() const
Get the current upper/lower bound.