15 #ifndef OsiSpxSolverInterface_H 16 #define OsiSpxSolverInterface_H 20 #include "CoinWarmStartBasis.hpp" 45 virtual void initialSolve();
49 virtual void resolve();
52 virtual void branchAndBound();
76 bool getIntParam(
OsiIntParam key,
int& value)
const;
78 bool getDblParam(
OsiDblParam key,
double& value)
const;
80 bool getStrParam(
OsiStrParam key, std::string& value)
const;
82 void setTimeLimit(
double value);
84 double getTimeLimit()
const;
90 virtual bool isAbandoned()
const;
93 virtual bool isProvenOptimal()
const;
95 virtual bool isProvenPrimalInfeasible()
const;
97 virtual bool isProvenDualInfeasible()
const;
100 virtual bool isDualObjectiveLimitReached()
const;
102 virtual bool isIterationLimitReached()
const;
104 virtual bool isTimeLimitReached()
const;
110 inline CoinWarmStart *getEmptyWarmStart ()
const 112 {
return (dynamic_cast<CoinWarmStart *>(
new CoinWarmStartBasis())) ; }
114 virtual CoinWarmStart* getWarmStart()
const;
117 virtual bool setWarmStart(
const CoinWarmStart* warmstart);
127 virtual void markHotStart();
130 virtual void solveFromHotStart();
132 virtual void unmarkHotStart();
150 virtual int getNumCols()
const;
154 virtual int getNumRows()
const;
157 virtual int getNumElements()
const;
160 virtual const double * getColLower()
const;
163 virtual const double * getColUpper()
const;
174 virtual const char * getRowSense()
const;
184 virtual const double * getRightHandSide()
const;
194 virtual const double * getRowRange()
const;
197 virtual const double * getRowLower()
const;
200 virtual const double * getRowUpper()
const;
203 virtual const double * getObjCoefficients()
const;
206 virtual double getObjSense()
const;
209 virtual bool isContinuous(
int colNumber)
const;
212 virtual bool isBinary(
int columnNumber)
const;
219 virtual bool isInteger(
int columnNumber)
const;
222 virtual bool isIntegerNonBinary(
int columnNumber)
const;
225 virtual bool isFreeBinary(
int columnNumber)
const;
229 virtual const CoinPackedMatrix * getMatrixByRow()
const;
232 virtual const CoinPackedMatrix * getMatrixByCol()
const;
235 virtual double getInfinity()
const;
240 virtual const double * getColSolution()
const;
244 virtual const double * getRowPrice()
const;
247 virtual const double * getReducedCost()
const;
251 virtual const double * getRowActivity()
const;
254 virtual double getObjValue()
const;
258 virtual int getIterationCount()
const;
277 virtual std::vector<double*> getDualRays(
int maxNumRays,
278 bool fullRay=
false)
const;
290 virtual std::vector<double*> getPrimalRays(
int maxNumRays)
const;
295 virtual OsiVectorInt getFractionalIndices(
const double etol=1.e-05)
309 virtual void setObjCoeff(
int elementIndex,
double elementValue );
313 virtual void setColLower(
int elementIndex,
double elementValue );
317 virtual void setColUpper(
int elementIndex,
double elementValue );
322 virtual void setColBounds(
int elementIndex,
323 double lower,
double upper );
325 #if 0 // we are using the default implementation of OsiSolverInterface 334 virtual void setColSetBounds(
const int* indexFirst,
335 const int* indexLast,
336 const double* boundList);
341 virtual void setRowLower(
int elementIndex,
double elementValue );
345 virtual void setRowUpper(
int elementIndex,
double elementValue );
350 virtual void setRowBounds(
int elementIndex,
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 365 virtual void setRowSetBounds(
const int* indexFirst,
366 const int* indexLast,
367 const double* boundList);
378 virtual void setRowSetTypes(
const int* indexFirst,
379 const int* indexLast,
380 const char* senseList,
381 const double* rhsList,
382 const double* rangeList);
390 virtual void setContinuous(
int index);
392 virtual void setInteger(
int index);
393 #if 0 // we are using the default implementation of OsiSolverInterface 396 virtual void setContinuous(
const int* indices,
int len);
399 virtual void setInteger(
const int* indices,
int len);
405 virtual void setObjSense(
double s);
417 virtual void setColSolution(
const double * colsol);
429 virtual void setRowPrice(
const double * rowprice);
437 virtual void addCol(
const CoinPackedVectorBase& vec,
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,
444 const CoinPackedVectorBase *
const * cols,
445 const double* collb,
const double* colub,
450 virtual void deleteCols(
const int num,
const int * colIndices);
453 virtual void addRow(
const CoinPackedVectorBase& vec,
454 const double rowlb,
const double rowub);
456 virtual void addRow(
const CoinPackedVectorBase& vec,
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,
463 const CoinPackedVectorBase *
const * rows,
464 const double* rowlb,
const double* rowub);
466 virtual void addRows(
const int numrows,
467 const CoinPackedVectorBase *
const * rows,
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);
519 virtual void loadProblem(
const CoinPackedMatrix& matrix,
520 const double* collb,
const double* colub,
522 const double* rowlb,
const double* rowub);
531 virtual void assignProblem(CoinPackedMatrix*& matrix,
532 double*& collb,
double*& colub,
double*& obj,
533 double*& rowlb,
double*& rowub);
547 virtual void loadProblem(
const CoinPackedMatrix& matrix,
548 const double* collb,
const double* colub,
550 const char* rowsen,
const double* rowrhs,
551 const double* rowrng);
560 virtual void assignProblem(CoinPackedMatrix*& matrix,
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;
623 KEEPCACHED_COLUMN = 1,
627 KEEPCACHED_MATRIX = 4,
629 KEEPCACHED_RESULTS = 8,
631 KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX,
633 KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS,
635 FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN,
637 FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW,
639 FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX,
641 FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS
643 soplex::SoPlex* getLpPtr(
int keepCached = KEEPCACHED_NONE );
651 virtual void applyRowCut(
const OsiRowCut & rc );
657 virtual void applyColCut(
const OsiColCut & cc );
662 soplex::SPxOut *spxout_;
674 void freeCachedColRim();
677 void freeCachedRowRim();
680 void freeCachedResults();
683 void freeCachedMatrix();
686 void freeCachedData(
int keepCached = KEEPCACHED_NONE );
689 void freeAllMemory();
695 soplex::DIdxSet *spxintvars_;
707 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.
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.
Internal class for obtaining status from the applyCuts method.