15 #ifndef OsiSpxSolverInterface_H 16 #define OsiSpxSolverInterface_H 44 virtual void initialSolve();
48 virtual void resolve();
51 virtual void branchAndBound();
75 bool getIntParam(
OsiIntParam key,
int &value)
const;
77 bool getDblParam(
OsiDblParam key,
double &value)
const;
79 bool getStrParam(
OsiStrParam key, std::string &value)
const;
81 void setTimeLimit(
double value);
83 double getTimeLimit()
const;
89 virtual bool isAbandoned()
const;
92 virtual bool isProvenOptimal()
const;
94 virtual bool isProvenPrimalInfeasible()
const;
96 virtual bool isProvenDualInfeasible()
const;
99 virtual bool isDualObjectiveLimitReached()
const;
101 virtual bool isIterationLimitReached()
const;
103 virtual bool isTimeLimitReached()
const;
128 virtual void markHotStart();
131 virtual void solveFromHotStart();
133 virtual void unmarkHotStart();
151 virtual int getNumCols()
const;
155 virtual int getNumRows()
const;
158 virtual int getNumElements()
const;
161 virtual const double *getColLower()
const;
164 virtual const double *getColUpper()
const;
175 virtual const char *getRowSense()
const;
185 virtual const double *getRightHandSide()
const;
195 virtual const double *getRowRange()
const;
198 virtual const double *getRowLower()
const;
201 virtual const double *getRowUpper()
const;
204 virtual const double *getObjCoefficients()
const;
207 virtual double getObjSense()
const;
210 virtual bool isContinuous(
int colNumber)
const;
213 virtual bool isBinary(
int columnNumber)
const;
220 virtual bool isInteger(
int columnNumber)
const;
223 virtual bool isIntegerNonBinary(
int columnNumber)
const;
226 virtual bool isFreeBinary(
int columnNumber)
const;
236 virtual double getInfinity()
const;
241 virtual const double *getColSolution()
const;
245 virtual const double *getRowPrice()
const;
248 virtual const double *getReducedCost()
const;
252 virtual const double *getRowActivity()
const;
255 virtual double getObjValue()
const;
259 virtual int getIterationCount()
const;
278 virtual std::vector< double * > getDualRays(
int maxNumRays,
279 bool fullRay =
false)
const;
291 virtual std::vector< double * > getPrimalRays(
int maxNumRays)
const;
296 virtual OsiVectorInt getFractionalIndices(
const double etol=1.e-05)
310 virtual void setObjCoeff(
int elementIndex,
double elementValue);
314 virtual void setColLower(
int elementIndex,
double elementValue);
318 virtual void setColUpper(
int elementIndex,
double elementValue);
323 virtual void setColBounds(
int elementIndex,
324 double lower,
double upper);
326 #if 0 // we are using the default implementation of OsiSolverInterface 335 virtual void setColSetBounds(
const int* indexFirst,
336 const int* indexLast,
337 const double* boundList);
342 virtual void setRowLower(
int elementIndex,
double elementValue);
346 virtual void setRowUpper(
int elementIndex,
double elementValue);
351 virtual void setRowBounds(
int elementIndex,
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 366 virtual void setRowSetBounds(
const int* indexFirst,
367 const int* indexLast,
368 const double* boundList);
379 virtual void setRowSetTypes(
const int* indexFirst,
380 const int* indexLast,
381 const char* senseList,
382 const double* rhsList,
383 const double* rangeList);
391 virtual void setContinuous(
int index);
393 virtual void setInteger(
int index);
394 #if 0 // we are using the default implementation of OsiSolverInterface 397 virtual void setContinuous(
const int* indices,
int len);
400 virtual void setInteger(
const int* indices,
int len);
406 virtual void setObjSense(
double s);
418 virtual void setColSolution(
const double *colsol);
430 virtual void setRowPrice(
const double *rowprice);
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;
622 KEEPCACHED_COLUMN = 1,
626 KEEPCACHED_MATRIX = 4,
628 KEEPCACHED_RESULTS = 8,
630 KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX,
632 KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS,
634 FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN,
636 FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW,
638 FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX,
640 FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS
642 soplex::SoPlex *getLpPtr(
int keepCached = KEEPCACHED_NONE);
649 virtual void applyRowCut(
const OsiRowCut &rc);
655 virtual void applyColCut(
const OsiColCut &cc);
660 soplex::SPxOut *spxout_;
671 void freeCachedColRim();
674 void freeCachedRowRim();
677 void freeCachedResults();
680 void freeCachedMatrix();
683 void freeCachedData(
int keepCached = KEEPCACHED_NONE);
686 void freeAllMemory();
691 soplex::DIdxSet *spxintvars_;
703 mutable soplex::DVector *obj_;
SoPlex Solver Interface Instantiation of OsiSpxSolverInterface for SoPlex.
char * rowsense_
Pointer to dense vector of row sense indicators.
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
soplex::DVector * rowsol_
Pointer to dual solution vector.
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.
The default COIN simplex (basis-oriented) warm start class.
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
Abstract Base Class for describing an interface to a solver.
void * hotStartCStat_
Hotstart information.
Abstract base class for various sparse vectors.
int hotStartMaxIteration_
soplex::DVector * colsol_
Pointer to primal solution vector.
Sparse Matrix Base Class.
soplex::SPxOut * getSPxOut()
double * rhs_
Pointer to dense vector of row right-hand side values.
soplex::DVector * rowact_
Pointer to row activity (slack) vector.
soplex::DVector * redcost_
Pointer to reduced cost vector.
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.
std::vector< int > OsiVectorInt
Vector of int.
Internal class for obtaining status from the applyCuts method.
Abstract base class for warm start information.