15 #ifndef OsiSpxSolverInterface_H 16 #define OsiSpxSolverInterface_H 213 virtual bool isBinary(
int columnNumber)
const;
220 virtual bool isInteger(
int columnNumber)
const;
278 virtual std::vector< double * >
getDualRays(
int maxNumRays,
279 bool fullRay =
false)
const;
291 virtual std::vector< double * >
getPrimalRays(
int maxNumRays)
const;
310 virtual void setObjCoeff(
int elementIndex,
double elementValue);
314 virtual void setColLower(
int elementIndex,
double elementValue);
318 virtual void setColUpper(
int elementIndex,
double elementValue);
324 double lower,
double upper);
326 #if 0 // we are using the default implementation of OsiSolverInterface 336 const int* indexLast,
337 const double* boundList);
342 virtual void setRowLower(
int elementIndex,
double elementValue);
346 virtual void setRowUpper(
int elementIndex,
double elementValue);
352 double lower,
double upper);
355 virtual void setRowType(
int index,
char sense,
double rightHandSide,
358 #if 0 // we are using the default implementation of OsiSolverInterface 367 const int* indexLast,
368 const double* boundList);
380 const int* indexLast,
381 const char* senseList,
382 const double* rhsList,
383 const double* rangeList);
394 #if 0 // we are using the default implementation of OsiSolverInterface 400 virtual void setInteger(
const int* indices,
int len);
439 const double collb,
const double colub,
442 #if 0 // we are using the default implementation of OsiSolverInterface 444 virtual void addCols(
const int numcols,
446 const double* collb,
const double* colub,
451 virtual void deleteCols(
const int num,
const int *colIndices);
455 const double rowlb,
const double rowub);
458 const char rowsen,
const double rowrhs,
459 const double rowrng);
461 #if 0 // we are using the default implementation of OsiSolverInterface 463 virtual void addRows(
const int numrows,
465 const double* rowlb,
const double* rowub);
467 virtual void addRows(
const int numrows,
469 const char* rowsen,
const double* rowrhs,
470 const double* rowrng);
474 virtual void deleteRows(
const int num,
const int *rowIndices);
476 #if 0 // we are using the default implementation of OsiSolverInterface \ 477 //----------------------------------------------------------------------- 500 double effectivenessLb = 0.0);
521 const double *collb,
const double *colub,
523 const double *rowlb,
const double *rowub);
533 double *&collb,
double *&colub,
double *&obj,
534 double *&rowlb,
double *&rowub);
549 const double *collb,
const double *colub,
551 const char *rowsen,
const double *rowrhs,
552 const double *rowrng);
562 double *&collb,
double *&colub,
double *&obj,
563 char *&rowsen,
double *&rowrhs,
568 virtual void loadProblem(
const int numcols,
const int numrows,
569 const int *start,
const int *index,
571 const double *collb,
const double *colub,
573 const double *rowlb,
const double *rowub);
577 virtual void loadProblem(
const int numcols,
const int numrows,
578 const int *start,
const int *index,
580 const double *collb,
const double *colub,
582 const char *rowsen,
const double *rowrhs,
583 const double *rowrng);
586 virtual int readMps(
const char *filename,
587 const char *extension =
"mps");
593 virtual void writeMps(
const char *filename,
594 const char *extension =
"mps",
595 double objSense = 0.0)
const;
703 mutable soplex::DVector *
obj_;
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 isAbandoned() const
Are there a numerical difficulties?
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
SoPlex Solver Interface Instantiation of OsiSpxSolverInterface for SoPlex.
virtual bool isTimeLimitReached() const
Time limit reached?
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
char * rowsense_
Pointer to dense vector of row sense indicators.
column information: objective values, lower and upper bounds, variable types
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
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...
soplex::SoPlex * getLpPtr(int keepCached=KEEPCACHED_NONE)
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
virtual void unmarkHotStart()
Delete the snapshot.
virtual double getInfinity() const
Get solver's value for infinity.
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
virtual bool isIterationLimitReached() const
Iteration limit reached?
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the upper and lower bounds of a set of columns.
soplex::DVector * rowsol_
Pointer to dual solution vector.
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
Collections of row cuts and column cuts.
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
virtual void markHotStart()
Create a hotstart point of the optimization process.
virtual int getNumRows() const
Get number of rows.
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
free only cached row and LP solution information
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
virtual bool isProvenOptimal() const
Is optimality proven?
void freeCachedMatrix()
free cached matrices
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.
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
problem matrix: matrix ordered by column and by row
Abstract Base Class for describing an interface to a 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 bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
void freeAllMemory()
free all allocated memory
void * hotStartCStat_
Hotstart information.
OsiSpxSolverInterface()
Default Constructor.
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
discard all cached data (default)
double getTimeLimit() const
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
void freeCachedColRim()
free cached column rim vectors
CoinWarmStart * getEmptyWarmStart() const
Get empty warm start object.
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
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 bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver...
int hotStartMaxIteration_
soplex::DVector * obj_
Pointer to objective Vector.
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
soplex::SPxOut * spxout_
SoPlex output object.
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
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.
soplex::DVector * colsol_
Pointer to primal solution vector.
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
row information: right hand sides, ranges and senses, lower and upper bounds for row ...
void setTimeLimit(double value)
virtual void initialSolve()
Solve initial LP relaxation.
keep all cached data (similar to getMutableLpPtr())
void freeCachedRowRim()
free cached row rim vectors
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
free only cached LP solution information
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
void freeCachedResults()
free cached result vectors
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
virtual void solveFromHotStart()
Optimize starting from the hotstart.
virtual void resolve()
Resolve an LP relaxation after problem modification.
free only cached matrix and LP solution information
soplex::SPxOut * getSPxOut()
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a set of rows.
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
double * rhs_
Pointer to dense vector of row right-hand side values.
soplex::DIdxSet * spxintvars_
indices of integer variables
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
soplex::DVector * rowact_
Pointer to row activity (slack) vector.
virtual ~OsiSpxSolverInterface()
Destructor.
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
free only cached column and LP solution information
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound The default implementation just invokes setRowUower and setRo...
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
soplex::DVector * redcost_
Pointer to reduced cost vector.
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound The default implementation just invokes setColLower and se...
soplex::SoPlex * soplex_
SoPlex solver object.
void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
virtual int getNumElements() const
Get number of nonzero elements.
virtual std::vector< double *> getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
std::vector< int > OsiVectorInt
Vector of int.
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
Internal class for obtaining status from the applyCuts method.
virtual double getObjValue() const
Get objective function value.
LP solution: primal and dual solution, reduced costs, row activities.
virtual int getNumCols() const
Get number of columns.
friend void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
virtual std::vector< double *> getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
only discard cached LP solution
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiSpxSolverInterface & operator=(const OsiSpxSolverInterface &rhs)
Assignment operator.
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...