15 #ifndef OsiSpxSolverInterface_H 16 #define OsiSpxSolverInterface_H 20 #include "CoinWarmStartBasis.hpp" 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;
109 inline CoinWarmStart *getEmptyWarmStart ()
const 111 {
return (dynamic_cast<CoinWarmStart *>(
new CoinWarmStartBasis())) ; }
113 virtual CoinWarmStart* getWarmStart()
const;
116 virtual bool setWarmStart(
const CoinWarmStart* warmstart);
126 virtual void markHotStart();
129 virtual void solveFromHotStart();
131 virtual void unmarkHotStart();
149 virtual int getNumCols()
const;
153 virtual int getNumRows()
const;
156 virtual int getNumElements()
const;
159 virtual const double * getColLower()
const;
162 virtual const double * getColUpper()
const;
173 virtual const char * getRowSense()
const;
183 virtual const double * getRightHandSide()
const;
193 virtual const double * getRowRange()
const;
196 virtual const double * getRowLower()
const;
199 virtual const double * getRowUpper()
const;
202 virtual const double * getObjCoefficients()
const;
205 virtual double getObjSense()
const;
208 virtual bool isContinuous(
int colNumber)
const;
211 virtual bool isBinary(
int columnNumber)
const;
218 virtual bool isInteger(
int columnNumber)
const;
221 virtual bool isIntegerNonBinary(
int columnNumber)
const;
224 virtual bool isFreeBinary(
int columnNumber)
const;
228 virtual const CoinPackedMatrix * getMatrixByRow()
const;
231 virtual const CoinPackedMatrix * getMatrixByCol()
const;
234 virtual double getInfinity()
const;
239 virtual const double * getColSolution()
const;
243 virtual const double * getRowPrice()
const;
246 virtual const double * getReducedCost()
const;
250 virtual const double * getRowActivity()
const;
253 virtual double getObjValue()
const;
257 virtual int getIterationCount()
const;
276 virtual std::vector<double*> getDualRays(
int maxNumRays,
277 bool fullRay=
false)
const;
289 virtual std::vector<double*> getPrimalRays(
int maxNumRays)
const;
294 virtual OsiVectorInt getFractionalIndices(
const double etol=1.e-05)
308 virtual void setObjCoeff(
int elementIndex,
double elementValue );
312 virtual void setColLower(
int elementIndex,
double elementValue );
316 virtual void setColUpper(
int elementIndex,
double elementValue );
321 virtual void setColBounds(
int elementIndex,
322 double lower,
double upper );
324 #if 0 // we are using the default implementation of OsiSolverInterface 333 virtual void setColSetBounds(
const int* indexFirst,
334 const int* indexLast,
335 const double* boundList);
340 virtual void setRowLower(
int elementIndex,
double elementValue );
344 virtual void setRowUpper(
int elementIndex,
double elementValue );
349 virtual void setRowBounds(
int elementIndex,
350 double lower,
double upper );
353 virtual void setRowType(
int index,
char sense,
double rightHandSide,
356 #if 0 // we are using the default implementation of OsiSolverInterface 364 virtual void setRowSetBounds(
const int* indexFirst,
365 const int* indexLast,
366 const double* boundList);
377 virtual void setRowSetTypes(
const int* indexFirst,
378 const int* indexLast,
379 const char* senseList,
380 const double* rhsList,
381 const double* rangeList);
389 virtual void setContinuous(
int index);
391 virtual void setInteger(
int index);
392 #if 0 // we are using the default implementation of OsiSolverInterface 395 virtual void setContinuous(
const int* indices,
int len);
398 virtual void setInteger(
const int* indices,
int len);
404 virtual void setObjSense(
double s);
416 virtual void setColSolution(
const double * colsol);
428 virtual void setRowPrice(
const double * rowprice);
436 virtual void addCol(
const CoinPackedVectorBase& vec,
437 const double collb,
const double colub,
440 #if 0 // we are using the default implementation of OsiSolverInterface 442 virtual void addCols(
const int numcols,
443 const CoinPackedVectorBase *
const * cols,
444 const double* collb,
const double* colub,
449 virtual void deleteCols(
const int num,
const int * colIndices);
452 virtual void addRow(
const CoinPackedVectorBase& vec,
453 const double rowlb,
const double rowub);
455 virtual void addRow(
const CoinPackedVectorBase& vec,
456 const char rowsen,
const double rowrhs,
457 const double rowrng);
459 #if 0 // we are using the default implementation of OsiSolverInterface 461 virtual void addRows(
const int numrows,
462 const CoinPackedVectorBase *
const * rows,
463 const double* rowlb,
const double* rowub);
465 virtual void addRows(
const int numrows,
466 const CoinPackedVectorBase *
const * rows,
467 const char* rowsen,
const double* rowrhs,
468 const double* rowrng);
472 virtual void deleteRows(
const int num,
const int * rowIndices);
474 #if 0 // we are using the default implementation of OsiSolverInterface 498 double effectivenessLb = 0.0);
518 virtual void loadProblem(
const CoinPackedMatrix& matrix,
519 const double* collb,
const double* colub,
521 const double* rowlb,
const double* rowub);
530 virtual void assignProblem(CoinPackedMatrix*& matrix,
531 double*& collb,
double*& colub,
double*& obj,
532 double*& rowlb,
double*& rowub);
546 virtual void loadProblem(
const CoinPackedMatrix& matrix,
547 const double* collb,
const double* colub,
549 const char* rowsen,
const double* rowrhs,
550 const double* rowrng);
559 virtual void assignProblem(CoinPackedMatrix*& matrix,
560 double*& collb,
double*& colub,
double*& obj,
561 char*& rowsen,
double*& rowrhs,
566 virtual void loadProblem(
const int numcols,
const int numrows,
567 const int* start,
const int* index,
569 const double* collb,
const double* colub,
571 const double* rowlb,
const double* rowub);
575 virtual void loadProblem(
const int numcols,
const int numrows,
576 const int* start,
const int* index,
578 const double* collb,
const double* colub,
580 const char* rowsen,
const double* rowrhs,
581 const double* rowrng);
584 virtual int readMps(
const char *filename,
585 const char *extension =
"mps");
591 virtual void writeMps(
const char *filename,
592 const char *extension =
"mps",
593 double objSense=0.0)
const;
620 virtual void applyRowCut(
const OsiRowCut & rc );
626 virtual void applyColCut(
const OsiColCut & cc );
631 soplex::SoPlex *soplex_;
641 void freeCachedColRim();
644 void freeCachedRowRim();
647 void freeCachedResults();
650 void freeCachedMatrix();
657 KEEPCACHED_COLUMN = 1,
661 KEEPCACHED_MATRIX = 4,
663 KEEPCACHED_RESULTS = 8,
665 KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX,
667 KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS,
669 FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN,
671 FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW,
673 FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX,
675 FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS
679 void freeCachedData(
int keepCached = KEEPCACHED_NONE );
682 void freeAllMemory();
688 soplex::DIdxSet *spxintvars_;
700 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.
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.
std::vector< int > OsiVectorInt
Vector of int.
int hotStartMaxIteration_
soplex::DVector * colsol_
Pointer to primal solution vector.
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.
void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
Internal class for obtaining status from the applyCuts method.