15 #ifndef OsiSpxSolverInterface_H
16 #define OsiSpxSolverInterface_H
212 virtual bool isBinary(
int columnNumber)
const;
219 virtual bool isInteger(
int columnNumber)
const;
277 virtual std::vector<double*>
getDualRays(
int maxNumRays,
278 bool fullRay=
false)
const;
290 virtual std::vector<double*>
getPrimalRays(
int maxNumRays)
const;
309 virtual void setObjCoeff(
int elementIndex,
double elementValue );
313 virtual void setColLower(
int elementIndex,
double elementValue );
317 virtual void setColUpper(
int elementIndex,
double elementValue );
323 double lower,
double upper );
325 #if 0 // we are using the default implementation of OsiSolverInterface
335 const int* indexLast,
336 const double* boundList);
341 virtual void setRowLower(
int elementIndex,
double elementValue );
345 virtual void setRowUpper(
int elementIndex,
double elementValue );
351 double lower,
double upper );
354 virtual void setRowType(
int index,
char sense,
double rightHandSide,
357 #if 0 // we are using the default implementation of OsiSolverInterface
366 const int* indexLast,
367 const double* boundList);
379 const int* indexLast,
380 const char* senseList,
381 const double* rhsList,
382 const double* rangeList);
393 #if 0 // we are using the default implementation of OsiSolverInterface
399 virtual void setInteger(
const int* indices,
int len);
438 const double collb,
const double colub,
441 #if 0 // we are using the default implementation of OsiSolverInterface
443 virtual void addCols(
const int numcols,
445 const double* collb,
const double* colub,
450 virtual void deleteCols(
const int num,
const int * colIndices);
454 const double rowlb,
const double rowub);
457 const char rowsen,
const double rowrhs,
458 const double rowrng);
460 #if 0 // we are using the default implementation of OsiSolverInterface
462 virtual void addRows(
const int numrows,
464 const double* rowlb,
const double* rowub);
466 virtual void addRows(
const int numrows,
468 const char* rowsen,
const double* rowrhs,
469 const double* rowrng);
473 virtual void deleteRows(
const int num,
const int * rowIndices);
475 #if 0 // we are using the default implementation of OsiSolverInterface
499 double effectivenessLb = 0.0);
520 const double* collb,
const double* colub,
522 const double* rowlb,
const double* rowub);
532 double*& collb,
double*& colub,
double*& obj,
533 double*& rowlb,
double*& rowub);
548 const double* collb,
const double* colub,
550 const char* rowsen,
const double* rowrhs,
551 const double* rowrng);
561 double*& collb,
double*& colub,
double*& obj,
562 char*& rowsen,
double*& rowrhs,
567 virtual void loadProblem(
const int numcols,
const int numrows,
568 const int* start,
const int* index,
570 const double* collb,
const double* colub,
572 const double* rowlb,
const double* rowub);
576 virtual void loadProblem(
const int numcols,
const int numrows,
577 const int* start,
const int* index,
579 const double* collb,
const double* colub,
581 const char* rowsen,
const double* rowrhs,
582 const double* rowrng);
585 virtual int readMps(
const char *filename,
586 const char *extension =
"mps");
592 virtual void writeMps(
const char *filename,
593 const char *extension =
"mps",
594 double objSense=0.0)
const;
707 mutable soplex::DVector *
obj_;
soplex::DVector * rowsol_
Pointer to dual solution vector.
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
soplex::DVector * colsol_
Pointer to primal solution vector.
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
virtual void solveFromHotStart()
Optimize starting from the hotstart.
virtual ~OsiSpxSolverInterface()
Destructor.
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
virtual void resolve()
Resolve an LP relaxation after problem modification.
void freeCachedColRim()
free cached column rim vectors
double * rhs_
Pointer to dense vector of row right-hand side values.
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a set of rows.
soplex::DIdxSet * spxintvars_
indices of integer variables
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
int hotStartCStatSize_
indices of integer variables
virtual int getNumCols() const
Get number of columns.
SoPlex Solver Interface Instantiation of OsiSpxSolverInterface for SoPlex.
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
discard all cached data (default)
soplex::SPxOut * spxout_
SoPlex output object.
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the upper and lower bounds of a set of columns.
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
int hotStartMaxIteration_
indices of integer variables
Sparse Matrix Base Class.
virtual bool isAbandoned() const
Are there a numerical difficulties?
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
row information: right hand sides, ranges and senses, lower and upper bounds for row ...
virtual int getNumElements() const
Get number of nonzero elements.
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
Collections of row cuts and column cuts.
soplex::DVector * rowact_
Pointer to row activity (slack) vector.
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
LP solution: primal and dual solution, reduced costs, row activities.
void freeCachedResults()
free cached result vectors
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
soplex::DVector * redcost_
Pointer to reduced cost vector.
Abstract base class for various sparse vectors.
OsiSpxSolverInterface & operator=(const OsiSpxSolverInterface &rhs)
Assignment operator.
CoinWarmStart * getEmptyWarmStart() const
Get empty warm start object.
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
std::vector< int > OsiVectorInt
Vector of int.
column information: objective values, lower and upper bounds, variable types
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
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 void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
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 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 setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound The default implementation just invokes setRowUower and setRo...
soplex::SoPlex * soplex_
SoPlex solver object.
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 const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
virtual void markHotStart()
Create a hotstart point of the optimization process.
friend void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
virtual bool isTimeLimitReached() const
Time limit reached?
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
only discard cached LP solution
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
Abstract Base Class for describing an interface to a solver.
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
virtual bool isProvenOptimal() const
Is optimality proven?
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver...
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
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.
free only cached matrix and LP solution information
char * rowsense_
Pointer to dense vector of row sense indicators.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
void setTimeLimit(double value)
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
virtual double getInfinity() const
Get solver's value for infinity.
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
Abstract base class for warm start information.
soplex::SPxOut * getSPxOut()
free only cached column and LP solution information
virtual double getObjValue() const
Get objective function value.
keep all cached data (similar to getMutableLpPtr())
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
void freeCachedMatrix()
free cached matrices
Internal class for obtaining status from the applyCuts method.
soplex::DVector * obj_
Pointer to objective Vector.
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
void freeAllMemory()
free all allocated memory
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
free only cached LP solution information
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
virtual void unmarkHotStart()
Delete the snapshot.
virtual int getNumRows() const
Get number of rows.
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...
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
double getTimeLimit() const
soplex::SoPlex * getLpPtr(int keepCached=KEEPCACHED_NONE)
OsiSpxSolverInterface()
Default Constructor.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
virtual void initialSolve()
Solve initial LP relaxation.
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
The default COIN simplex (basis-oriented) warm start class.
void * hotStartCStat_
Hotstart information.
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
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...
void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
free only cached row and LP solution information
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
void * hotStartRStat_
indices of integer variables
void freeCachedRowRim()
free cached row rim vectors
virtual bool isIterationLimitReached() const
Iteration limit reached?
int hotStartRStatSize_
indices of integer variables
problem matrix: matrix ordered by column and by row