Osi  0.107.9
OsiSpxSolverInterface.hpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // name: OSI Interface for SoPlex >= 1.4.2c
3 // authors: Tobias Pfender
4 // Ambros Gleixner
5 // Wei Huang
6 // Konrad-Zuse-Zentrum Berlin (Germany)
7 // email: pfender@zib.de
8 // date: 01/16/2002
9 // license: this file may be freely distributed under the terms of the EPL
10 //-----------------------------------------------------------------------------
11 // Copyright (C) 2002, Tobias Pfender, International Business Machines
12 // Corporation and others. All Rights Reserved.
13 // Last edit: $Id: OsiSpxSolverInterface.hpp 2019 2015-06-11 08:50:04Z stefan $
14 
15 #ifndef OsiSpxSolverInterface_H
16 #define OsiSpxSolverInterface_H
17 
18 #include <string>
19 #include "OsiSolverInterface.hpp"
20 #include "CoinWarmStartBasis.hpp"
21 
22 #ifndef _SOPLEX_H_
23 /* forward declarations so the header can be compiled without having to include soplex.h
24  * however, these declaration work only for SoPlex < 2.0, so we do them only if soplex.h hasn't been included already
25  */
26 namespace soplex {
27  class DIdxSet;
28  class DVector;
29  class SPxOut;
30  class SoPlex;
31 }
32 #endif
33 
37 class OsiSpxSolverInterface : virtual public OsiSolverInterface {
38  friend void OsiSpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
39 
40 public:
41 
42  //---------------------------------------------------------------------------
45  virtual void initialSolve();
47 
49  virtual void resolve();
50 
52  virtual void branchAndBound();
54 
55  //---------------------------------------------------------------------------
71  // Set an integer parameter
72  bool setIntParam(OsiIntParam key, int value);
73  // Set an double parameter
74  bool setDblParam(OsiDblParam key, double value);
75  // Get an integer parameter
76  bool getIntParam(OsiIntParam key, int& value) const;
77  // Get an double parameter
78  bool getDblParam(OsiDblParam key, double& value) const;
79  // Get a string parameter
80  bool getStrParam(OsiStrParam key, std::string& value) const;
81  // Set timelimit
82  void setTimeLimit(double value);
83  // Get timelimit
84  double getTimeLimit() const;
86 
87  //---------------------------------------------------------------------------
89 
90  virtual bool isAbandoned() const;
93  virtual bool isProvenOptimal() const;
95  virtual bool isProvenPrimalInfeasible() const;
97  virtual bool isProvenDualInfeasible() const;
98  // Is the given primal objective limit reached? - use implementation from OsiSolverInterface
100  virtual bool isDualObjectiveLimitReached() const;
102  virtual bool isIterationLimitReached() const;
104  virtual bool isTimeLimitReached() const;
106 
107  //---------------------------------------------------------------------------
110  inline CoinWarmStart *getEmptyWarmStart () const
112  { return (dynamic_cast<CoinWarmStart *>(new CoinWarmStartBasis())) ; }
114  virtual CoinWarmStart* getWarmStart() const;
117  virtual bool setWarmStart(const CoinWarmStart* warmstart);
119 
120  //---------------------------------------------------------------------------
127  virtual void markHotStart();
130  virtual void solveFromHotStart();
132  virtual void unmarkHotStart();
134 
135  //---------------------------------------------------------------------------
150  virtual int getNumCols() const;
152 
154  virtual int getNumRows() const;
155 
157  virtual int getNumElements() const;
158 
160  virtual const double * getColLower() const;
161 
163  virtual const double * getColUpper() const;
164 
174  virtual const char * getRowSense() const;
175 
184  virtual const double * getRightHandSide() const;
185 
194  virtual const double * getRowRange() const;
195 
197  virtual const double * getRowLower() const;
198 
200  virtual const double * getRowUpper() const;
201 
203  virtual const double * getObjCoefficients() const;
204 
206  virtual double getObjSense() const;
207 
209  virtual bool isContinuous(int colNumber) const;
210 
211 #if 0
212  virtual bool isBinary(int columnNumber) const;
214 
219  virtual bool isInteger(int columnNumber) const;
220 
222  virtual bool isIntegerNonBinary(int columnNumber) const;
223 
225  virtual bool isFreeBinary(int columnNumber) const;
226 #endif
227 
229  virtual const CoinPackedMatrix * getMatrixByRow() const;
230 
232  virtual const CoinPackedMatrix * getMatrixByCol() const;
233 
235  virtual double getInfinity() const;
237 
240  virtual const double * getColSolution() const;
242 
244  virtual const double * getRowPrice() const;
245 
247  virtual const double * getReducedCost() const;
248 
251  virtual const double * getRowActivity() const;
252 
254  virtual double getObjValue() const;
255 
258  virtual int getIterationCount() const;
259 
277  virtual std::vector<double*> getDualRays(int maxNumRays,
278  bool fullRay=false) const;
290  virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
291 
292 #if 0
293 
295  virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
296  const;
297 #endif
298 
299 
300 
301  //---------------------------------------------------------------------------
302 
305  //-------------------------------------------------------------------------
309  virtual void setObjCoeff( int elementIndex, double elementValue );
310 
313  virtual void setColLower( int elementIndex, double elementValue );
314 
317  virtual void setColUpper( int elementIndex, double elementValue );
318 
322  virtual void setColBounds( int elementIndex,
323  double lower, double upper );
324 
325 #if 0 // we are using the default implementation of OsiSolverInterface
326 
334  virtual void setColSetBounds(const int* indexFirst,
335  const int* indexLast,
336  const double* boundList);
337 #endif
338 
341  virtual void setRowLower( int elementIndex, double elementValue );
342 
345  virtual void setRowUpper( int elementIndex, double elementValue );
346 
350  virtual void setRowBounds( int elementIndex,
351  double lower, double upper );
352 
354  virtual void setRowType(int index, char sense, double rightHandSide,
355  double range);
356 
357 #if 0 // we are using the default implementation of OsiSolverInterface
358 
365  virtual void setRowSetBounds(const int* indexFirst,
366  const int* indexLast,
367  const double* boundList);
368 
378  virtual void setRowSetTypes(const int* indexFirst,
379  const int* indexLast,
380  const char* senseList,
381  const double* rhsList,
382  const double* rangeList);
383 #endif
384 
385 
386  //-------------------------------------------------------------------------
390  virtual void setContinuous(int index);
392  virtual void setInteger(int index);
393 #if 0 // we are using the default implementation of OsiSolverInterface
394 
396  virtual void setContinuous(const int* indices, int len);
399  virtual void setInteger(const int* indices, int len);
400 #endif
401 
402 
403  //-------------------------------------------------------------------------
405  virtual void setObjSense(double s);
406 
417  virtual void setColSolution(const double * colsol);
418 
429  virtual void setRowPrice(const double * rowprice);
430 
431  //-------------------------------------------------------------------------
437  virtual void addCol(const CoinPackedVectorBase& vec,
438  const double collb, const double colub,
439  const double obj);
440 
441 #if 0 // we are using the default implementation of OsiSolverInterface
442 
443  virtual void addCols(const int numcols,
444  const CoinPackedVectorBase * const * cols,
445  const double* collb, const double* colub,
446  const double* obj);
447 #endif
448 
450  virtual void deleteCols(const int num, const int * colIndices);
451 
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);
459 
460 #if 0 // we are using the default implementation of OsiSolverInterface
461 
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);
470 #endif
471 
473  virtual void deleteRows(const int num, const int * rowIndices);
474 
475 #if 0 // we are using the default implementation of OsiSolverInterface
476  //-----------------------------------------------------------------------
498  virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
499  double effectivenessLb = 0.0);
500 #endif
501 
502 
503 
504  //---------------------------------------------------------------------------
505 
519  virtual void loadProblem(const CoinPackedMatrix& matrix,
520  const double* collb, const double* colub,
521  const double* obj,
522  const double* rowlb, const double* rowub);
523 
531  virtual void assignProblem(CoinPackedMatrix*& matrix,
532  double*& collb, double*& colub, double*& obj,
533  double*& rowlb, double*& rowub);
534 
547  virtual void loadProblem(const CoinPackedMatrix& matrix,
548  const double* collb, const double* colub,
549  const double* obj,
550  const char* rowsen, const double* rowrhs,
551  const double* rowrng);
552 
560  virtual void assignProblem(CoinPackedMatrix*& matrix,
561  double*& collb, double*& colub, double*& obj,
562  char*& rowsen, double*& rowrhs,
563  double*& rowrng);
564 
567  virtual void loadProblem(const int numcols, const int numrows,
568  const int* start, const int* index,
569  const double* value,
570  const double* collb, const double* colub,
571  const double* obj,
572  const double* rowlb, const double* rowub);
573 
576  virtual void loadProblem(const int numcols, const int numrows,
577  const int* start, const int* index,
578  const double* value,
579  const double* collb, const double* colub,
580  const double* obj,
581  const char* rowsen, const double* rowrhs,
582  const double* rowrng);
583 
585  virtual int readMps(const char *filename,
586  const char *extension = "mps");
587 
592  virtual void writeMps(const char *filename,
593  const char *extension = "mps",
594  double objSense=0.0) const;
596 
597  //---------------------------------------------------------------------------
598 
603 
605  virtual OsiSolverInterface * clone(bool copyData = true) const;
606 
609 
612 
616 
617 
619  {
642  };
643  soplex::SoPlex* getLpPtr( int keepCached = KEEPCACHED_NONE );
644 
645  soplex::SPxOut* getSPxOut() { return spxout_; }
646 
647 protected:
648 
651  virtual void applyRowCut( const OsiRowCut & rc );
653 
657  virtual void applyColCut( const OsiColCut & cc );
659 
662  soplex::SPxOut *spxout_;
665  soplex::SoPlex *soplex_;
667 
668 
669 private:
672 
675 
678 
681 
684 
686  void freeCachedData( int keepCached = KEEPCACHED_NONE );
687 
691 
692 
695  soplex::DIdxSet *spxintvars_;
697 
704 
707  mutable soplex::DVector *obj_;
709 
711  mutable char *rowsense_;
712 
714  mutable double *rhs_;
715 
717  mutable double *rowrange_;
718 
720  mutable soplex::DVector *colsol_;
721 
723  mutable soplex::DVector *rowsol_;
724 
726  mutable soplex::DVector *redcost_;
727 
729  mutable soplex::DVector *rowact_;
730 
732  mutable CoinPackedMatrix *matrixByRow_;
733 
735  mutable CoinPackedMatrix *matrixByCol_;
737 
738 };
739 
740 //#############################################################################
742 void OsiSpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
743 
744 #endif
OsiSpxSolverInterface::writeMps
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.
OsiSpxSolverInterface::OsiSpxSolverInterface
OsiSpxSolverInterface()
Default Constructor.
OsiSpxSolverInterface::getEmptyWarmStart
CoinWarmStart * getEmptyWarmStart() const
Get empty warm start object.
Definition: OsiSpxSolverInterface.hpp:111
OsiSpxSolverInterface::rowact_
soplex::DVector * rowact_
Pointer to row activity (slack) vector.
Definition: OsiSpxSolverInterface.hpp:729
OsiSpxSolverInterface::redcost_
soplex::DVector * redcost_
Pointer to reduced cost vector.
Definition: OsiSpxSolverInterface.hpp:726
OsiSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
OsiSpxSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
OsiSpxSolverInterface::obj_
soplex::DVector * obj_
Pointer to objective Vector.
Definition: OsiSpxSolverInterface.hpp:708
OsiSpxSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiSpxSolverInterface::matrixByCol_
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiSpxSolverInterface.hpp:735
OsiSpxSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
OsiSpxSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
OsiSpxSolverInterface::FREECACHED_MATRIX
@ FREECACHED_MATRIX
free only cached matrix and LP solution information
Definition: OsiSpxSolverInterface.hpp:639
OsiSpxSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiSpxSolverInterface.hpp:711
OsiSpxSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiSpxSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
OsiSpxSolverInterface::KEEPCACHED_PROBLEM
@ KEEPCACHED_PROBLEM
only discard cached LP solution
Definition: OsiSpxSolverInterface.hpp:631
OsiSpxSolverInterface::hotStartCStat_
void * hotStartCStat_
Hotstart information.
Definition: OsiSpxSolverInterface.hpp:699
OsiSpxSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiSpxSolverInterface.hpp:714
OsiSpxSolverInterface::KEEPCACHED_NONE
@ KEEPCACHED_NONE
discard all cached data (default)
Definition: OsiSpxSolverInterface.hpp:621
OsiSpxSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiSpxSolverInterface::KEEPCACHED_COLUMN
@ KEEPCACHED_COLUMN
column information: objective values, lower and upper bounds, variable types
Definition: OsiSpxSolverInterface.hpp:623
OsiSpxSolverInterface::OsiSpxSolverInterface
OsiSpxSolverInterface(const OsiSpxSolverInterface &)
Copy constructor.
OsiSpxSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiSpxSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiSpxSolverInterface.hpp:732
OsiSpxSolverInterface::rowsol_
soplex::DVector * rowsol_
Pointer to dual solution vector.
Definition: OsiSpxSolverInterface.hpp:723
OsiSpxSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiSpxSolverInterface::getLpPtr
soplex::SoPlex * getLpPtr(int keepCached=KEEPCACHED_NONE)
OsiSolverInterface::setRowSetTypes
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.
OsiSpxSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
OsiSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiSpxSolverInterfaceUnitTest
void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
soplex
Definition: OsiSpxSolverInterface.hpp:26
OsiSpxSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
OsiSpxSolverInterface
SoPlex Solver Interface Instantiation of OsiSpxSolverInterface for SoPlex.
Definition: OsiSpxSolverInterface.hpp:37
OsiSpxSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows)
Definition: OsiSpxSolverInterface.hpp:717
OsiSpxSolverInterface::loadProblem
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::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
OsiSpxSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiSpxSolverInterface::getSPxOut
soplex::SPxOut * getSPxOut()
Definition: OsiSpxSolverInterface.hpp:645
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiSolverInterface::addRows
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.
OsiSpxSolverInterface::hotStartMaxIteration_
int hotStartMaxIteration_
Definition: OsiSpxSolverInterface.hpp:703
OsiSpxSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiSpxSolverInterface::getTimeLimit
double getTimeLimit() const
OsiSpxSolverInterface::freeCachedMatrix
void freeCachedMatrix()
free cached matrices
OsiSpxSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
OsiSpxSolverInterface::assignProblem
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...
OsiSpxSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiSpxSolverInterface::loadProblem
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 ...
OsiSpxSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
OsiSpxSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiSpxSolverInterface::setColBounds
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...
OsiSpxSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiSolverInterface::setColSetBounds
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the upper and lower bounds of a set of columns.
OsiSpxSolverInterface::getInfinity
virtual double getInfinity() const
Get solver's value for infinity.
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiSpxSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
OsiSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiSpxSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiSpxSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiSpxSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiSpxSolverInterface::operator=
OsiSpxSolverInterface & operator=(const OsiSpxSolverInterface &rhs)
Assignment operator.
OsiSpxSolverInterface::spxout_
soplex::SPxOut * spxout_
SoPlex output object.
Definition: OsiSpxSolverInterface.hpp:663
OsiSpxSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiSpxSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
OsiSpxSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
OsiSpxSolverInterface::KEEPCACHED_ALL
@ KEEPCACHED_ALL
keep all cached data (similar to getMutableLpPtr())
Definition: OsiSpxSolverInterface.hpp:633
OsiSpxSolverInterface::hotStartCStatSize_
int hotStartCStatSize_
Definition: OsiSpxSolverInterface.hpp:700
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiSpxSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiSpxSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiSpxSolverInterface::KEEPCACHED_MATRIX
@ KEEPCACHED_MATRIX
problem matrix: matrix ordered by column and by row
Definition: OsiSpxSolverInterface.hpp:627
OsiSpxSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
OsiSpxSolverInterface::freeCachedColRim
void freeCachedColRim()
free cached column rim vectors
OsiSpxSolverInterface::assignProblem
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...
OsiSpxSolverInterface::keepCachedFlag
keepCachedFlag
Definition: OsiSpxSolverInterface.hpp:619
OsiSpxSolverInterface::setTimeLimit
void setTimeLimit(double value)
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiSpxSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiSpxSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiSpxSolverInterface::FREECACHED_COLUMN
@ FREECACHED_COLUMN
free only cached column and LP solution information
Definition: OsiSpxSolverInterface.hpp:635
OsiSpxSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
OsiSpxSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
OsiSpxSolverInterface::loadProblem
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 ...
OsiSpxSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiSpxSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
Add a row (constraint) to the problem.
OsiSpxSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiSpxSolverInterface::hotStartRStat_
void * hotStartRStat_
Definition: OsiSpxSolverInterface.hpp:701
OsiSolverInterface::ApplyCutsReturnCode
Internal class for obtaining status from the applyCuts method.
Definition: OsiSolverInterface.hpp:74
OsiSpxSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiSpxSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiSpxSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
OsiSpxSolverInterface::KEEPCACHED_ROW
@ KEEPCACHED_ROW
row information: right hand sides, ranges and senses, lower and upper bounds for row
Definition: OsiSpxSolverInterface.hpp:625
OsiSpxSolverInterface::KEEPCACHED_RESULTS
@ KEEPCACHED_RESULTS
LP solution: primal and dual solution, reduced costs, row activities.
Definition: OsiSpxSolverInterface.hpp:629
OsiSpxSolverInterface::FREECACHED_RESULTS
@ FREECACHED_RESULTS
free only cached LP solution information
Definition: OsiSpxSolverInterface.hpp:641
OsiSpxSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiSpxSolverInterface::~OsiSpxSolverInterface
virtual ~OsiSpxSolverInterface()
Destructor.
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiSpxSolverInterface::freeCachedData
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
OsiSpxSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
OsiSpxSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiVectorInt
std::vector< int > OsiVectorInt
Vector of int.
Definition: OsiCollections.hpp:22
OsiSpxSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiSpxSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
OsiSolverInterface.hpp
OsiSpxSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
OsiSpxSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiSpxSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiSpxSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
OsiSpxSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiSpxSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
OsiSpxSolverInterface::freeCachedRowRim
void freeCachedRowRim()
free cached row rim vectors
OsiSpxSolverInterface::freeCachedResults
void freeCachedResults()
free cached result vectors
OsiSpxSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
OsiSpxSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
OsiSolverInterface::addCols
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.
OsiSpxSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiSpxSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiSpxSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
OsiSpxSolverInterface::hotStartRStatSize_
int hotStartRStatSize_
Definition: OsiSpxSolverInterface.hpp:702
OsiSpxSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiSpxSolverInterface::getNumElements
virtual int getNumElements() const
Get number of nonzero elements.
OsiSpxSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
OsiSpxSolverInterface::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiSpxSolverInterface::OsiSpxSolverInterfaceUnitTest
friend void OsiSpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSpxSolverInterface class.
OsiSolverInterface::setRowSetBounds
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a set of rows.
OsiSolverInterface::getFractionalIndices
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...
OsiSpxSolverInterface::spxintvars_
soplex::DIdxSet * spxintvars_
indices of integer variables
Definition: OsiSpxSolverInterface.hpp:696
OsiSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiSpxSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
OsiSpxSolverInterface::colsol_
soplex::DVector * colsol_
Pointer to primal solution vector.
Definition: OsiSpxSolverInterface.hpp:720
OsiSpxSolverInterface::FREECACHED_ROW
@ FREECACHED_ROW
free only cached row and LP solution information
Definition: OsiSpxSolverInterface.hpp:637
OsiSpxSolverInterface::soplex_
soplex::SoPlex * soplex_
SoPlex solver object.
Definition: OsiSpxSolverInterface.hpp:665
OsiSpxSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiSpxSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
OsiSpxSolverInterface::isTimeLimitReached
virtual bool isTimeLimitReached() const
Time limit reached?
OsiSpxSolverInterface::setRowBounds
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...
OsiSpxSolverInterface::loadProblem
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...
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:88
OsiSpxSolverInterface::freeAllMemory
void freeAllMemory()
free all allocated memory