Osi  0.107.9
OsiCpxSolverInterface.hpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // name: OSI Interface for CPLEX
3 // author: Tobias Pfender
4 // Konrad-Zuse-Zentrum Berlin (Germany)
5 // email: pfender@zib.de
6 // date: 09/25/2000
7 // license: this file may be freely distributed under the terms of EPL
8 // comments: please scan this file for '???' and read the comments
9 //-----------------------------------------------------------------------------
10 // Copyright (C) 2000, Tobias Pfender, International Business Machines
11 // Corporation and others. All Rights Reserved.
12 
13 #ifndef OsiCpxSolverInterface_H
14 #define OsiCpxSolverInterface_H
15 
16 #include "OsiSolverInterface.hpp"
17 #include "CoinWarmStartBasis.hpp"
18 #include "OsiColCut.hpp"
19 #include "OsiRowCut.hpp"
20 
21 typedef struct cpxlp* CPXLPptr;
22 typedef struct cpxenv* CPXENVptr;
23 
29 class OsiCpxSolverInterface : virtual public OsiSolverInterface {
30  friend void OsiCpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
31 
32 public:
33 
34  //---------------------------------------------------------------------------
37  virtual void initialSolve();
39 
41  virtual void resolve();
42 
44  virtual void branchAndBound();
46 
47  //---------------------------------------------------------------------------
63  // Set an integer parameter
64  bool setIntParam(OsiIntParam key, int value);
65  // Set an double parameter
66  bool setDblParam(OsiDblParam key, double value);
67  // Set a string parameter
68  bool setStrParam(OsiStrParam key, const std::string & value);
69  // Get an integer parameter
70  bool getIntParam(OsiIntParam key, int& value) const;
71  // Get an double parameter
72  bool getDblParam(OsiDblParam key, double& value) const;
73  // Get a string parameter
74  bool getStrParam(OsiStrParam key, std::string& value) const;
75  // Set mipstart option (pass column solution to CPLEX before MIP start)
76  void setMipStart(bool value) { domipstart = value; }
77  // Get mipstart option value
78  bool getMipStart() const { return domipstart; }
80 
81  //---------------------------------------------------------------------------
83 
84  virtual bool isAbandoned() const;
87  virtual bool isProvenOptimal() const;
89  virtual bool isProvenPrimalInfeasible() const;
91  virtual bool isProvenDualInfeasible() const;
93  virtual bool isPrimalObjectiveLimitReached() const;
95  virtual bool isDualObjectiveLimitReached() const;
97  virtual bool isIterationLimitReached() const;
99 
100  //---------------------------------------------------------------------------
103 
110  CoinWarmStart *getEmptyWarmStart () const;
111 
113  virtual CoinWarmStart* getWarmStart() const;
116  virtual bool setWarmStart(const CoinWarmStart* warmstart);
118 
119  //---------------------------------------------------------------------------
126  virtual void markHotStart();
129  virtual void solveFromHotStart();
131  virtual void unmarkHotStart();
133 
134  //---------------------------------------------------------------------------
149  virtual int getNumCols() const;
151 
153  virtual int getNumRows() const;
154 
156  virtual int getNumElements() const;
157 
159  virtual const double * getColLower() const;
160 
162  virtual const double * getColUpper() const;
163 
173  virtual const char * getRowSense() const;
174 
183  virtual const double * getRightHandSide() const;
184 
193  virtual const double * getRowRange() const;
194 
196  virtual const double * getRowLower() const;
197 
199  virtual const double * getRowUpper() const;
200 
202  virtual const double * getObjCoefficients() const;
203 
205  virtual double getObjSense() const;
206 
208  virtual bool isContinuous(int colNumber) const;
209 
210 #if 0
211  virtual bool isBinary(int columnNumber) const;
213 
218  virtual bool isInteger(int columnNumber) const;
219 
221  virtual bool isIntegerNonBinary(int columnNumber) const;
222 
224  virtual bool isFreeBinary(int columnNumber) const;
225 #endif
226 
228  virtual const CoinPackedMatrix * getMatrixByRow() const;
229 
231  virtual const CoinPackedMatrix * getMatrixByCol() const;
232 
234  virtual double getInfinity() const;
236 
239  virtual const double * getColSolution() const;
241 
243  virtual const double * getRowPrice() const;
244 
246  virtual const double * getReducedCost() const;
247 
250  virtual const double * getRowActivity() const;
251 
253  virtual double getObjValue() const;
254 
257  virtual int getIterationCount() const;
258 
276  virtual std::vector<double*> getDualRays(int maxNumRays,
277  bool fullRay = false) const;
289  virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
290 
291 #if 0
292 
294  virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
295  const;
296 #endif
297 
298 
299 
300  //---------------------------------------------------------------------------
301 
304  //-------------------------------------------------------------------------
308  virtual void setObjCoeff( int elementIndex, double elementValue );
309 
311  virtual void setObjCoeffSet(const int* indexFirst,
312  const int* indexLast,
313  const double* coeffList);
314 
318  virtual void setColLower( int elementIndex, double elementValue );
319 
323  virtual void setColUpper( int elementIndex, double elementValue );
324 
328  virtual void setColBounds( int elementIndex,
329  double lower, double upper );
330 
338  virtual void setColSetBounds(const int* indexFirst,
339  const int* indexLast,
340  const double* boundList);
341 
344  virtual void setRowLower( int elementIndex, double elementValue );
345 
348  virtual void setRowUpper( int elementIndex, double elementValue );
349 
353  virtual void setRowBounds( int elementIndex,
354  double lower, double upper );
355 
357  virtual void setRowType(int index, char sense, double rightHandSide,
358  double range);
359 
367  virtual void setRowSetBounds(const int* indexFirst,
368  const int* indexLast,
369  const double* boundList);
370 
380  virtual void setRowSetTypes(const int* indexFirst,
381  const int* indexLast,
382  const char* senseList,
383  const double* rhsList,
384  const double* rangeList);
386 
387  //-------------------------------------------------------------------------
391  virtual void setContinuous(int index);
393  virtual void setInteger(int index);
396  virtual void setContinuous(const int* indices, int len);
399  virtual void setInteger(const int* indices, int len);
401 
402  //-------------------------------------------------------------------------
404  virtual void setObjSense(double s);
405 
416  virtual void setColSolution(const double * colsol);
417 
428  virtual void setRowPrice(const double * rowprice);
429 
430  //-------------------------------------------------------------------------
437  virtual void addCol(const CoinPackedVectorBase& vec,
438  const double collb, const double colub,
439  const double obj);
440 
443  virtual void addCols(const int numcols,
444  const CoinPackedVectorBase * const * cols,
445  const double* collb, const double* colub,
446  const double* obj);
448  virtual void deleteCols(const int num, const int * colIndices);
449 
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);
458 
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);
470  virtual void deleteRows(const int num, const int * rowIndices);
471 
472 #if 0
473  // ??? implemented in OsiSolverInterface
474  //-----------------------------------------------------------------------
496  virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
497  double effectivenessLb = 0.0);
498 #endif
499 
500 
501 
502  //---------------------------------------------------------------------------
503 
517  virtual void loadProblem(const CoinPackedMatrix& matrix,
518  const double* collb, const double* colub,
519  const double* obj,
520  const double* rowlb, const double* rowub);
521 
529  virtual void assignProblem(CoinPackedMatrix*& matrix,
530  double*& collb, double*& colub, double*& obj,
531  double*& rowlb, double*& rowub);
532 
545  virtual void loadProblem(const CoinPackedMatrix& matrix,
546  const double* collb, const double* colub,
547  const double* obj,
548  const char* rowsen, const double* rowrhs,
549  const double* rowrng);
550 
558  virtual void assignProblem(CoinPackedMatrix*& matrix,
559  double*& collb, double*& colub, double*& obj,
560  char*& rowsen, double*& rowrhs,
561  double*& rowrng);
562 
565  virtual void loadProblem(const int numcols, const int numrows,
566  const int* start, const int* index,
567  const double* value,
568  const double* collb, const double* colub,
569  const double* obj,
570  const double* rowlb, const double* rowub);
571 
574  virtual void loadProblem(const int numcols, const int numrows,
575  const int* start, const int* index,
576  const double* value,
577  const double* collb, const double* colub,
578  const double* obj,
579  const char* rowsen, const double* rowrhs,
580  const double* rowrng);
581 
584  virtual int readMps(const char *filename,
585  const char *extension = "mps");
586 
591  virtual void writeMps(const char *filename,
592  const char *extension = "mps",
593  double objSense=0.0) const;
594 
596 
604  void passInMessageHandler(CoinMessageHandler * handler);
606 
607  //---------------------------------------------------------------------------
608 
615  {
638  };
639  CPXLPptr getLpPtr( int keepCached = KEEPCACHED_NONE );
640 
645 
647  const char* getCtype() const;
648 
653 
655  virtual OsiSolverInterface * clone(bool copyData = true) const;
656 
659 
662 
665 
667  virtual void reset();
669 
670 /***************************************************************************/
690 
694  virtual int canDoSimplexInterface() const;
695 
700  virtual void enableSimplexInterface(int doingPrimal) {};
701 
705  virtual void disableSimplexInterface() {};
706 
710  virtual void enableFactorization() const {};
711 
715  virtual void disableFactorization() const {};
716 
718  virtual bool basisIsAvailable() const;
719 
723  virtual void getBasisStatus(int* cstat, int* rstat) const;
724 
726  virtual void getBInvARow(int row, double* z, double * slack=NULL) const;
727 
729  virtual void getBInvRow(int row, double* z) const;
730 
732  virtual void getBInvACol(int col, double* vec) const;
733 
735  virtual void getBInvCol(int col, double* vec) const;
736 
742  virtual void getBasics(int* index) const;
744  void switchToLP();
745 
747  void switchToMIP();
748 
750 /***************************************************************************/
751 
752 protected:
753 
756 
759 
762  virtual void applyRowCut( const OsiRowCut & rc );
764 
768  virtual void applyColCut( const OsiColCut & cc );
770 
771 private:
774  void resizeColType( int minsize );
776 
778  void freeColType();
780 
781 
784 
786  void gutsOfCopy( const OsiCpxSolverInterface & source );
787 
790 
793 
796 
799 
802 
805 
807  void freeCachedData( int keepCached = KEEPCACHED_NONE );
808 
811 
813 
814 
817  mutable CPXENVptr env_;
820  mutable CPXLPptr lp_;
821 
828 
831  mutable double *obj_;
833 
835  mutable double *collower_;
836 
838  mutable double *colupper_;
839 
841  mutable char *rowsense_;
842 
844  mutable double *rhs_;
845 
847  mutable double *rowrange_;
848 
850  mutable double *rowlower_;
851 
853  mutable double *rowupper_;
854 
856  mutable double *colsol_;
857 
859  mutable double *rowsol_;
860 
862  mutable double *redcost_;
863 
865  mutable double *rowact_;
866 
868  mutable CoinPackedMatrix *matrixByRow_;
869 
871  mutable CoinPackedMatrix *matrixByCol_;
873 
876  char *coltype_;
878 
881 
883  mutable bool probtypemip_;
884 
887 
890 
892 };
893 
894 //#############################################################################
896 void OsiCpxSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
897 
898 #endif
OsiCpxSolverInterface::setObjCoeffSet
virtual void setObjCoeffSet(const int *indexFirst, const int *indexLast, const double *coeffList)
Set a a set of objective function coefficients.
OsiCpxSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiCpxSolverInterface.hpp:868
OsiCpxSolverInterface::KEEPCACHED_RESULTS
@ KEEPCACHED_RESULTS
LP solution: primal and dual solution, reduced costs, row activities.
Definition: OsiCpxSolverInterface.hpp:625
OsiCpxSolverInterface::KEEPCACHED_ROW
@ KEEPCACHED_ROW
row information: right hand sides, ranges and senses, lower and upper bounds for row
Definition: OsiCpxSolverInterface.hpp:621
OsiCpxSolverInterface::setContinuous
virtual void setContinuous(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be continuous variables.
OsiCpxSolverInterface::hotStartCStatSize_
int hotStartCStatSize_
Definition: OsiCpxSolverInterface.hpp:824
OsiCpxSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
OsiSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)=0
Set a single column upper bound.
OsiSolverInterface::enableSimplexInterface
virtual void enableSimplexInterface(bool doingPrimal)
Enables normal operation of subsequent functions.
OsiCpxSolverInterface::OsiCpxSolverInterfaceUnitTest
friend void OsiCpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiCpxSolverInterface class.
OsiCpxSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiCpxSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
OsiCpxSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiCpxSolverInterface::gutsOfDestructor
void gutsOfDestructor()
The real work of the destructor.
OsiCpxSolverInterface::disableFactorization
virtual void disableFactorization() const
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:715
OsiCpxSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
OsiCpxSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiCpxSolverInterface::freeCachedMatrix
void freeCachedMatrix()
free cached matrices
OsiCpxSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiCpxSolverInterface::OsiCpxSolverInterface
OsiCpxSolverInterface(const OsiCpxSolverInterface &)
Copy constructor.
OsiCpxSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiCpxSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
OsiCpxSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiCpxSolverInterface::switchToLP
void switchToLP()
switches CPLEX to prob type LP
OsiCpxSolverInterface::FREECACHED_RESULTS
@ FREECACHED_RESULTS
free only cached LP solution information
Definition: OsiCpxSolverInterface.hpp:637
OsiCpxSolverInterface::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 ...
OsiCpxSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiCpxSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
OsiSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
OsiCpxSolverInterface::getInfinity
virtual double getInfinity() const
Get solver's value for infinity.
OsiCpxSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiCpxSolverInterface::enableFactorization
virtual void enableFactorization() const
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:710
OsiCpxSolverInterface::operator=
OsiCpxSolverInterface & operator=(const OsiCpxSolverInterface &rhs)
Assignment operator.
OsiCpxSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
OsiCpxSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
OsiCpxSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
OsiCpxSolverInterface::getBasics
virtual void getBasics(int *index) const
Get indices of the pivot variable in each row (order of indices corresponds to the order of elements ...
OsiCpxSolverInterface::rowsol_
double * rowsol_
Pointer to dual solution vector.
Definition: OsiCpxSolverInterface.hpp:859
OsiCpxSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiCpxSolverInterface::freeCachedResults
void freeCachedResults()
free cached result vectors
OsiCpxSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
OsiCpxSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiCpxSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiCpxSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
OsiCpxSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
OsiCpxSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
OsiCpxSolverInterface::getBInvCol
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
OsiCpxSolverInterface::gutsOfCopy
void gutsOfCopy(const OsiCpxSolverInterface &source)
The real work of a copy constructor (used by copy and assignment)
OsiCpxSolverInterface::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...
OsiCpxSolverInterface::freeAllMemory
void freeAllMemory()
free all allocated memory
OsiCpxSolverInterface::canDoSimplexInterface
virtual int canDoSimplexInterface() const
Returns 1 if can just do getBInv etc 2 if has all OsiSimplex methods and 0 if it has none.
OsiCpxSolverInterface::freeCachedColRim
void freeCachedColRim()
free cached column rim vectors
OsiCpxSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiCpxSolverInterface.hpp:844
OsiCpxSolverInterface::resizeColType
void resizeColType(int minsize)
resizes coltype_ vector to be able to store at least minsize elements
OsiSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiCpxSolverInterface::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler It is the client's responsibility to destroy a message handler installed by...
OsiCpxSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
OsiCpxSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiCpxSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
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.
OsiCpxSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiCpxSolverInterface::enableSimplexInterface
virtual void enableSimplexInterface(int doingPrimal)
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:700
OsiCpxSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
OsiCpxSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiCpxSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
OsiCpxSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
OsiCpxSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiCpxSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
OsiCpxSolverInterface::setRowSetTypes
virtual void setRowSetTypes(const int *indexFirst, const int *indexLast, const char *senseList, const double *rhsList, const double *rangeList)
Set the type of a number of rows simultaneously The default implementation just invokes setRowType()...
OsiCpxSolverInterface::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 ...
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiCpxSolverInterface::reset
virtual void reset()
Resets as if default constructor.
OsiCpxSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiCpxSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiCpxSolverInterface::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...
OsiCpxSolverInterface::getEnvironmentPtr
CPXENVptr getEnvironmentPtr()
Method to access CPLEX environment pointer.
OsiCpxSolverInterface::getBInvACol
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
OsiCpxSolverInterface::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiCpxSolverInterface::FREECACHED_MATRIX
@ FREECACHED_MATRIX
free only cached matrix and LP solution information
Definition: OsiCpxSolverInterface.hpp:635
OsiCpxSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiCpxSolverInterface::getMipStart
bool getMipStart() const
Definition: OsiCpxSolverInterface.hpp:78
OsiSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)=0
Add a column (primal variable) to the problem.
OsiCpxSolverInterface::setInteger
virtual void setInteger(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be integer variables.
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiCpxSolverInterface::getCtype
const char * getCtype() const
return a vector of variable types (continous, binary, integer)
OsiCpxSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiCpxSolverInterface::disableSimplexInterface
virtual void disableSimplexInterface()
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:705
OsiCpxSolverInterface::getBasisStatus
virtual void getBasisStatus(int *cstat, int *rstat) const
Returns a basis status of the structural/artificial variables At present as warm start i....
OsiCpxSolverInterface::getMutableLpPtr
CPXLPptr getMutableLpPtr() const
Get LP Pointer for const methods.
OsiCpxSolverInterface::getNumElements
virtual int getNumElements() const
Get number of nonzero elements.
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiCpxSolverInterface::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...
OsiCpxSolverInterface::rowlower_
double * rowlower_
Pointer to dense vector of row lower bounds.
Definition: OsiCpxSolverInterface.hpp:850
OsiCpxSolverInterface::keepCachedFlag
keepCachedFlag
Get pointer to CPLEX model and free all specified cached data entries (combined with logical or-opera...
Definition: OsiCpxSolverInterface.hpp:615
OsiCpxSolverInterface::domipstart
bool domipstart
Whether to pass a column solution to CPLEX before starting MIP solve (copymipstart)
Definition: OsiCpxSolverInterface.hpp:886
OsiCpxSolverInterface::basisIsAvailable
virtual bool basisIsAvailable() const
Returns true if a basis is available.
OsiCpxSolverInterface::colupper_
double * colupper_
Pointer to dense vector of variable lower bounds.
Definition: OsiCpxSolverInterface.hpp:838
OsiCpxSolverInterface::setColSetBounds
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously The default implementation just invokes setColl...
OsiCpxSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
OsiCpxSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiCpxSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiCpxSolverInterface.hpp:841
OsiSolverInterface::ApplyCutsReturnCode
Internal class for obtaining status from the applyCuts method.
Definition: OsiSolverInterface.hpp:74
OsiCpxSolverInterface::~OsiCpxSolverInterface
virtual ~OsiCpxSolverInterface()
Destructor.
OsiCpxSolverInterface::switchToMIP
void switchToMIP()
switches CPLEX to prob type MIP
OsiCpxSolverInterface::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.
OsiCpxSolverInterface::hotStartCStat_
int * hotStartCStat_
Hotstart information.
Definition: OsiCpxSolverInterface.hpp:823
OsiCpxSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
OsiCpxSolverInterface::setRowSetBounds
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously The default implementation just invokes setRowLowe...
OsiCpxSolverInterface::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...
OsiCpxSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiCpxSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiCpxSolverInterface::FREECACHED_COLUMN
@ FREECACHED_COLUMN
free only cached column and LP solution information
Definition: OsiCpxSolverInterface.hpp:631
OsiCpxSolverInterface::addRows
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
Add a set of rows (constraints) to the problem.
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiCpxSolverInterface::probtypemip_
bool probtypemip_
Stores whether CPLEX' prob type is currently set to MIP.
Definition: OsiCpxSolverInterface.hpp:883
OsiCpxSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
OsiCpxSolverInterface::coltypesize_
int coltypesize_
Size of allocated memory for coltype_.
Definition: OsiCpxSolverInterface.hpp:880
OsiCpxSolverInterface::hotStartRStatSize_
int hotStartRStatSize_
Definition: OsiCpxSolverInterface.hpp:826
OsiVectorInt
std::vector< int > OsiVectorInt
Vector of int.
Definition: OsiCollections.hpp:22
OsiCpxSolverInterface::env_
CPXENVptr env_
CPLEX environment used in this class instance.
Definition: OsiCpxSolverInterface.hpp:818
OsiSolverInterface.hpp
OsiCpxSolverInterface::getEmptyWarmStart
CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
OsiCpxSolverInterfaceUnitTest
void OsiCpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiCpxSolverInterface class.
OsiCpxSolverInterface::FREECACHED_ROW
@ FREECACHED_ROW
free only cached row and LP solution information
Definition: OsiCpxSolverInterface.hpp:633
OsiRowCut.hpp
OsiCpxSolverInterface::hotStartRStat_
int * hotStartRStat_
Definition: OsiCpxSolverInterface.hpp:825
OsiCpxSolverInterface::coltype_
char * coltype_
Pointer to dense vector of variable types (continous, binary, integer)
Definition: OsiCpxSolverInterface.hpp:877
OsiColCut.hpp
OsiCpxSolverInterface::setMipStart
void setMipStart(bool value)
Definition: OsiCpxSolverInterface.hpp:76
OsiCpxSolverInterface::gutsOfConstructor
void gutsOfConstructor()
The real work of the constructor.
OsiCpxSolverInterface::freeColType
void freeColType()
frees colsize_ vector
OsiCpxSolverInterface::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 ...
OsiCpxSolverInterface::KEEPCACHED_NONE
@ KEEPCACHED_NONE
discard all cached data (default)
Definition: OsiCpxSolverInterface.hpp:617
OsiCpxSolverInterface::redcost_
double * redcost_
Pointer to reduced cost vector.
Definition: OsiCpxSolverInterface.hpp:862
OsiCpxSolverInterface::getMutableEnvironmentPtr
CPXENVptr getMutableEnvironmentPtr() const
Get Environment Pointer for const methods.
OsiCpxSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows)
Definition: OsiCpxSolverInterface.hpp:847
OsiCpxSolverInterface::colsol_
double * colsol_
Pointer to primal solution vector.
Definition: OsiCpxSolverInterface.hpp:856
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.
OsiCpxSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
OsiCpxSolverInterface::rowact_
double * rowact_
Pointer to row activity (slack) vector.
Definition: OsiCpxSolverInterface.hpp:865
OsiCpxSolverInterface::disableadvbasis
bool disableadvbasis
Whether to disable use of advanced basis (if given)
Definition: OsiCpxSolverInterface.hpp:889
OsiCpxSolverInterface::hotStartMaxIteration_
int hotStartMaxIteration_
Definition: OsiCpxSolverInterface.hpp:827
OsiCpxSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiCpxSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiCpxSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
OsiCpxSolverInterface::getBInvRow
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
OsiCpxSolverInterface::KEEPCACHED_COLUMN
@ KEEPCACHED_COLUMN
column information: objective values, lower and upper bounds, variable types
Definition: OsiCpxSolverInterface.hpp:619
OsiCpxSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiCpxSolverInterface::lp_
CPXLPptr lp_
CPLEX model represented by this class instance.
Definition: OsiCpxSolverInterface.hpp:820
OsiCpxSolverInterface::getBInvARow
virtual void getBInvARow(int row, double *z, double *slack=NULL) const
Get a row of the tableau (slack part in slack if not NULL)
OsiCpxSolverInterface::freeCachedRowRim
void freeCachedRowRim()
free cached row rim vectors
OsiCpxSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
OsiCpxSolverInterface::getLpPtr
CPXLPptr getLpPtr(int keepCached=KEEPCACHED_NONE)
OsiCpxSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
OsiCpxSolverInterface::KEEPCACHED_PROBLEM
@ KEEPCACHED_PROBLEM
only discard cached LP solution
Definition: OsiCpxSolverInterface.hpp:627
OsiCpxSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiCpxSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
Add a row (constraint) to the problem.
OsiCpxSolverInterface::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.
OsiCpxSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
OsiCpxSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
OsiCpxSolverInterface::KEEPCACHED_ALL
@ KEEPCACHED_ALL
keep all cached data (similar to getMutableLpPtr())
Definition: OsiCpxSolverInterface.hpp:629
OsiCpxSolverInterface::collower_
double * collower_
Pointer to dense vector of variable lower bounds.
Definition: OsiCpxSolverInterface.hpp:835
OsiCpxSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiCpxSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
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...
OsiCpxSolverInterface::matrixByCol_
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiCpxSolverInterface.hpp:871
OsiCpxSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
CPXENVptr
struct cpxenv * CPXENVptr
Definition: OsiCpxSolverInterface.hpp:22
OsiCpxSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
OsiSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiCpxSolverInterface::rowupper_
double * rowupper_
Pointer to dense vector of row upper bounds.
Definition: OsiCpxSolverInterface.hpp:853
OsiCpxSolverInterface::freeCachedData
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
OsiCpxSolverInterface::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.
OsiCpxSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiCpxSolverInterface::OsiCpxSolverInterface
OsiCpxSolverInterface()
Default Constructor.
OsiSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)=0
Add a row (constraint) to the problem.
OsiCpxSolverInterface::obj_
double * obj_
Pointer to objective vector.
Definition: OsiCpxSolverInterface.hpp:832
OsiCpxSolverInterface
CPLEX Solver Interface.
Definition: OsiCpxSolverInterface.hpp:29
OsiCpxSolverInterface::KEEPCACHED_MATRIX
@ KEEPCACHED_MATRIX
problem matrix: matrix ordered by column and by row
Definition: OsiCpxSolverInterface.hpp:623
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
OsiCpxSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiCpxSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiCpxSolverInterface::setRowBounds
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound The default implementation just invokes setRowLower() and set...
OsiCpxSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:88
CPXLPptr
struct cpxlp * CPXLPptr
Definition: OsiCpxSolverInterface.hpp:21