15#ifndef OsiSpxSolverInterface_H
16#define OsiSpxSolverInterface_H
20#include "CoinWarmStartBasis.hpp"
101 return (
dynamic_cast< CoinWarmStart *
>(
new CoinWarmStartBasis()));
203 virtual bool isBinary(
int columnNumber)
const;
209 virtual bool isInteger(
int columnNumber)
const;
268 bool fullRay =
false)
const;
313 double lower,
double upper);
324 virtual void setColSetBounds(const int* indexFirst,
325 const int* indexLast,
326 const double* boundList);
341 double lower,
double upper);
344 virtual void setRowType(
int index,
char sense,
double rightHandSide,
355 virtual void setRowSetBounds(const int* indexFirst,
356 const int* indexLast,
357 const double* boundList);
369 const int* indexLast,
370 const char* senseList,
371 const double* rhsList,
372 const double* rangeList);
386 virtual void setContinuous(const int* indices, int len);
389 virtual void setInteger(
const int* indices,
int len);
427 virtual void addCol(
const CoinPackedVectorBase &vec,
428 const double collb,
const double colub,
433 virtual void addCols(const int numcols,
434 const CoinPackedVectorBase *
const * cols,
435 const double* collb,
const double* colub,
440 virtual void deleteCols(
const int num,
const int *colIndices);
443 virtual void addRow(
const CoinPackedVectorBase &vec,
444 const double rowlb,
const double rowub);
446 virtual void addRow(
const CoinPackedVectorBase &vec,
447 const char rowsen,
const double rowrhs,
448 const double rowrng);
452 virtual void addRows(const int numrows,
453 const CoinPackedVectorBase *
const * rows,
454 const double* rowlb,
const double* rowub);
456 virtual void addRows(
const int numrows,
457 const CoinPackedVectorBase *
const * rows,
458 const char* rowsen,
const double* rowrhs,
459 const double* rowrng);
463 virtual void deleteRows(
const int num,
const int *rowIndices);
489 double effectivenessLb = 0.0);
510 const double *collb,
const double *colub,
512 const double *rowlb,
const double *rowub);
522 double *&collb,
double *&colub,
double *&obj,
523 double *&rowlb,
double *&rowub);
538 const double *collb,
const double *colub,
540 const char *rowsen,
const double *rowrhs,
541 const double *rowrng);
551 double *&collb,
double *&colub,
double *&obj,
552 char *&rowsen,
double *&rowrhs,
558 const int *start,
const int *index,
560 const double *collb,
const double *colub,
562 const double *rowlb,
const double *rowub);
567 const int *start,
const int *index,
569 const double *collb,
const double *colub,
571 const char *rowsen,
const double *rowrhs,
572 const double *rowrng);
576 const char *extension =
"mps");
583 const char *extension =
"mps",
584 double objSense = 0.0)
const;
693#if SOPLEX_VERSION < 200
696 mutable soplex::Vector *
obj_;
708#if SOPLEX_VERSION < 200
722 mutable soplex::Vector *
colsol_;
725 mutable soplex::Vector *
rowsol_;
731 mutable soplex::Vector *
rowact_;
740#if SOPLEX_VERSION >= 200
742 mutable soplex::Vector *lower_;
745 mutable soplex::Vector *upper_;
748 mutable soplex::Vector *lhsVector_;
751 mutable soplex::Vector *rhsVector_;
std::vector< int > OsiVectorInt
Vector of int.
Collections of row cuts and column cuts.
Internal class for obtaining status from the applyCuts method.
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 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 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 ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
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 isInteger(int colIndex) const
Return true if the variable is integer.
SoPlex Solver Interface Instantiation of OsiSpxSolverInterface for SoPlex.
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
double getTimeLimit() const
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
virtual void loadProblem(const int numcols, const int numrows, const int *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)
Just like the other loadProblem() methods except that the matrix is given in a standard column major ...
virtual bool isTimeLimitReached() const
Time limit reached?
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row 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...
OsiSpxSolverInterface()
Default Constructor.
virtual int getNumRows() const
Get number of rows.
friend void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range...
soplex::DVector * rowsol_
Pointer to dual solution vector.
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
int hotStartMaxIteration_
void freeCachedRowRim()
free cached row rim vectors
virtual bool isIterationLimitReached() const
Iteration limit reached?
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
virtual void markHotStart()
Create a hotstart point of the optimization process.
virtual bool isAbandoned() const
Are there a numerical difficulties?
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
OsiSpxSolverInterface(const OsiSpxSolverInterface &)
Copy constructor.
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
soplex::SoPlex * getLpPtr(int keepCached=KEEPCACHED_NONE)
void freeCachedColRim()
free cached column rim vectors
double * rhs_
Pointer to dense vector of row right-hand side values.
soplex::DVector * rowact_
Pointer to row activity (slack) vector.
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiSpxSolverInterface & operator=(const OsiSpxSolverInterface &rhs)
Assignment operator.
CoinWarmStart * getEmptyWarmStart() const
Get empty warm start object.
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
soplex::SoPlex * soplex_
SoPlex solver object.
soplex::DVector * obj_
Pointer to objective Vector.
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
void setTimeLimit(double value)
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
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...
char * rowsense_
Pointer to dense vector of row sense indicators.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
soplex::SPxOut * getSPxOut()
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows)
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
virtual double getInfinity() const
Get solver's value for infinity.
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
virtual void initialSolve()
Solve initial LP relaxation.
virtual int getNumCols() const
Get number of columns.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
virtual void unmarkHotStart()
Delete the snapshot.
void freeCachedResults()
free cached result vectors
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
soplex::DVector * redcost_
Pointer to reduced cost vector.
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
Add a row (constraint) to the problem.
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
soplex::SPxOut * spxout_
SoPlex output object.
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
void freeAllMemory()
free all allocated memory
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
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 std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
virtual void resolve()
Resolve an LP relaxation after problem modification.
soplex::DVector * colsol_
Pointer to primal solution vector.
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
void * hotStartCStat_
Hotstart information.
void freeCachedMatrix()
free cached matrices
@ KEEPCACHED_MATRIX
problem matrix: matrix ordered by column and by row
@ KEEPCACHED_ALL
keep all cached data (similar to getMutableLpPtr())
@ FREECACHED_COLUMN
free only cached column and LP solution information
@ FREECACHED_RESULTS
free only cached LP solution information
@ FREECACHED_MATRIX
free only cached matrix and LP solution information
@ KEEPCACHED_PROBLEM
only discard cached LP solution
@ KEEPCACHED_NONE
discard all cached data (default)
@ FREECACHED_ROW
free only cached row and LP solution information
@ KEEPCACHED_ROW
row information: right hand sides, ranges and senses, lower and upper bounds for row
@ KEEPCACHED_RESULTS
LP solution: primal and dual solution, reduced costs, row activities.
@ KEEPCACHED_COLUMN
column information: objective values, lower and upper bounds, variable types
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng)
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by s...
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...
virtual bool isProvenOptimal() const
Is optimality proven?
virtual int getNumElements() const
Get number of nonzero elements.
virtual void solveFromHotStart()
Optimize starting from the hotstart.
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
virtual double getObjValue() const
Get objective function value.
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
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 loadProblem(const int numcols, const int numrows, const int *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Just like the other loadProblem() methods except that the matrix is given in a standard column major ...
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
soplex::DIdxSet * spxintvars_
indices of integer variables
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
virtual ~OsiSpxSolverInterface()
Destructor.
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.