Clp 1.17.6

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //---------------------------------------------------------------------------
36 virtual void initialSolve();
38
40 virtual void resolve();
41
43 virtual void branchAndBound();
45
46 //---------------------------------------------------------------------------
62 // Set an integer parameter
63 bool setIntParam(OsiIntParam key, int value);
64 // Set an double parameter
65 bool setDblParam(OsiDblParam key, double value);
66 // Set a string parameter
67 bool setStrParam(OsiStrParam key, const std::string &value);
68 // Get an integer parameter
69 bool getIntParam(OsiIntParam key, int &value) const;
70 // Get an double parameter
71 bool getDblParam(OsiDblParam key, double &value) const;
72 // Get a string parameter
73 bool getStrParam(OsiStrParam key, std::string &value) const;
74 // Set mipstart option (pass column solution to CPLEX before MIP start)
75 void setMipStart(bool value) { domipstart = value; }
76 // Get mipstart option value
77 bool getMipStart() const { return domipstart; }
79
80 //---------------------------------------------------------------------------
82
83 virtual bool isAbandoned() const;
86 virtual bool isProvenOptimal() const;
88 virtual bool isProvenPrimalInfeasible() const;
90 virtual bool isProvenDualInfeasible() const;
92 virtual bool isPrimalObjectiveLimitReached() const;
94 virtual bool isDualObjectiveLimitReached() const;
96 virtual bool isIterationLimitReached() const;
98
99 //---------------------------------------------------------------------------
102
109 CoinWarmStart *getEmptyWarmStart() const;
110
112 virtual CoinWarmStart *getWarmStart() const;
115 virtual bool setWarmStart(const CoinWarmStart *warmstart);
117
118 //---------------------------------------------------------------------------
125 virtual void markHotStart();
128 virtual void solveFromHotStart();
130 virtual void unmarkHotStart();
132
133 //---------------------------------------------------------------------------
148 virtual int getNumCols() const;
150
152 virtual int getNumRows() const;
153
155 virtual int getNumElements() const;
156
158 virtual const double *getColLower() const;
159
161 virtual const double *getColUpper() const;
162
172 virtual const char *getRowSense() const;
173
182 virtual const double *getRightHandSide() const;
183
192 virtual const double *getRowRange() const;
193
195 virtual const double *getRowLower() const;
196
198 virtual const double *getRowUpper() const;
199
201 virtual const double *getObjCoefficients() const;
202
204 virtual double getObjSense() const;
205
207 virtual bool isContinuous(int colNumber) const;
208
209 #if 0
210 virtual bool isBinary(int columnNumber) const;
212
217 virtual bool isInteger(int columnNumber) const;
218
220 virtual bool isIntegerNonBinary(int columnNumber) const;
221
223 virtual bool isFreeBinary(int columnNumber) const;
224 #endif
225
227 virtual const CoinPackedMatrix *getMatrixByRow() const;
228
230 virtual const CoinPackedMatrix *getMatrixByCol() const;
231
233 virtual double getInfinity() const;
235
238 virtual const double *getColSolution() const;
240
242 virtual const double *getRowPrice() const;
243
245 virtual const double *getReducedCost() const;
246
249 virtual const double *getRowActivity() const;
250
252 virtual double getObjValue() const;
253
256 virtual int getIterationCount() const;
257
275 virtual std::vector< double * > getDualRays(int maxNumRays,
276 bool fullRay = false) const;
288 virtual std::vector< double * > getPrimalRays(int maxNumRays) const;
289
290 #if 0
291
293 virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
294 const;
295 #endif
296
297
298
299 //---------------------------------------------------------------------------
300
303 //-------------------------------------------------------------------------
307 virtual void setObjCoeff(int elementIndex, double elementValue);
308
310 virtual void setObjCoeffSet(const int *indexFirst,
311 const int *indexLast,
312 const double *coeffList);
313
314 using OsiSolverInterface::setColLower;
317 virtual void setColLower(int elementIndex, double elementValue);
318
319 using OsiSolverInterface::setColUpper;
322 virtual void setColUpper(int elementIndex, double elementValue);
323
327 virtual void setColBounds(int elementIndex,
328 double lower, double upper);
329
337 virtual void setColSetBounds(const int *indexFirst,
338 const int *indexLast,
339 const double *boundList);
340
343 virtual void setRowLower(int elementIndex, double elementValue);
344
347 virtual void setRowUpper(int elementIndex, double elementValue);
348
352 virtual void setRowBounds(int elementIndex,
353 double lower, double upper);
354
356 virtual void setRowType(int index, char sense, double rightHandSide,
357 double range);
358
366 virtual void setRowSetBounds(const int *indexFirst,
367 const int *indexLast,
368 const double *boundList);
369
379 virtual void setRowSetTypes(const int *indexFirst,
380 const int *indexLast,
381 const char *senseList,
382 const double *rhsList,
383 const double *rangeList);
385
386 //-------------------------------------------------------------------------
390 virtual void setContinuous(int index);
392 virtual void setInteger(int index);
395 virtual void setContinuous(const int *indices, int len);
398 virtual void setInteger(const int *indices, int len);
400
401 //-------------------------------------------------------------------------
403 virtual void setObjSense(double s);
404
415 virtual void setColSolution(const double *colsol);
416
427 virtual void setRowPrice(const double *rowprice);
428
429 //-------------------------------------------------------------------------
434 using OsiSolverInterface::addCol;
436 virtual void addCol(const CoinPackedVectorBase &vec,
437 const double collb, const double colub,
438 const double obj);
439
440 using OsiSolverInterface::addCols;
442 virtual void addCols(const int numcols,
443 const CoinPackedVectorBase *const *cols,
444 const double *collb, const double *colub,
445 const double *obj);
447 virtual void deleteCols(const int num, const int *colIndices);
448
449 using OsiSolverInterface::addRow;
451 virtual void addRow(const CoinPackedVectorBase &vec,
452 const double rowlb, const double rowub);
454 virtual void addRow(const CoinPackedVectorBase &vec,
455 const char rowsen, const double rowrhs,
456 const double rowrng);
457
458 using OsiSolverInterface::addRows;
460 virtual void addRows(const int numrows,
461 const CoinPackedVectorBase *const *rows,
462 const double *rowlb, const double *rowub);
464 virtual void addRows(const int numrows,
465 const CoinPackedVectorBase *const *rows,
466 const char *rowsen, const double *rowrhs,
467 const double *rowrng);
469 virtual void deleteRows(const int num, const int *rowIndices);
470
471 #if 0
472 // ??? implemented in OsiSolverInterface
473 //-----------------------------------------------------------------------
495 virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
496 double effectivenessLb = 0.0);
497 #endif
498
499
500
501 //---------------------------------------------------------------------------
502
516 virtual void loadProblem(const CoinPackedMatrix &matrix,
517 const double *collb, const double *colub,
518 const double *obj,
519 const double *rowlb, const double *rowub);
520
528 virtual void assignProblem(CoinPackedMatrix *&matrix,
529 double *&collb, double *&colub, double *&obj,
530 double *&rowlb, double *&rowub);
531
544 virtual void loadProblem(const CoinPackedMatrix &matrix,
545 const double *collb, const double *colub,
546 const double *obj,
547 const char *rowsen, const double *rowrhs,
548 const double *rowrng);
549
557 virtual void assignProblem(CoinPackedMatrix *&matrix,
558 double *&collb, double *&colub, double *&obj,
559 char *&rowsen, double *&rowrhs,
560 double *&rowrng);
561
564 virtual void loadProblem(const int numcols, const int numrows,
565 const int *start, const int *index,
566 const double *value,
567 const double *collb, const double *colub,
568 const double *obj,
569 const double *rowlb, const double *rowub);
570
573 virtual void loadProblem(const int numcols, const int numrows,
574 const int *start, const int *index,
575 const double *value,
576 const double *collb, const double *colub,
577 const double *obj,
578 const char *rowsen, const double *rowrhs,
579 const double *rowrng);
580
581 using OsiSolverInterface::readMps;
583 virtual int readMps(const char *filename,
584 const char *extension = "mps");
585
590 virtual void writeMps(const char *filename,
591 const char *extension = "mps",
592 double objSense = 0.0) const;
593
595
603 void passInMessageHandler(CoinMessageHandler *handler);
605
606 //---------------------------------------------------------------------------
607
613 enum keepCachedFlag {
615 KEEPCACHED_NONE = 0,
617 KEEPCACHED_COLUMN = 1,
619 KEEPCACHED_ROW = 2,
621 KEEPCACHED_MATRIX = 4,
623 KEEPCACHED_RESULTS = 8,
625 KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX,
627 KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS,
629 FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN,
631 FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW,
633 FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX,
635 FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS
636 };
637 CPXLPptr getLpPtr(int keepCached = KEEPCACHED_NONE);
638
640 CPXENVptr getEnvironmentPtr();
643
645 const char *getCtype() const;
646
649 OsiCpxSolverInterface();
651
653 virtual OsiSolverInterface *clone(bool copyData = true) const;
654
656 OsiCpxSolverInterface(const OsiCpxSolverInterface &);
657
659 OsiCpxSolverInterface &operator=(const OsiCpxSolverInterface &rhs);
660
662 virtual ~OsiCpxSolverInterface();
663
665 virtual void reset();
667
668 /***************************************************************************/
688
692 virtual int canDoSimplexInterface() const;
693
694 using OsiSolverInterface::enableSimplexInterface;
698 virtual void enableSimplexInterface(int doingPrimal) {};
699
703 virtual void disableSimplexInterface() {};
704
708 virtual void enableFactorization() const {};
709
713 virtual void disableFactorization() const {};
714
716 virtual bool basisIsAvailable() const;
717
721 virtual void getBasisStatus(int *cstat, int *rstat) const;
722
724 virtual void getBInvARow(int row, double *z, double *slack = NULL) const;
725
727 virtual void getBInvRow(int row, double *z) const;
728
730 virtual void getBInvACol(int col, double *vec) const;
731
733 virtual void getBInvCol(int col, double *vec) const;
734
740 virtual void getBasics(int *index) const;
742 void switchToLP();
743
745 void switchToMIP();
746
748 /***************************************************************************/
749
750 protected:
752 CPXLPptr getMutableLpPtr() const;
753
755 CPXENVptr getMutableEnvironmentPtr() const;
756
759 virtual void applyRowCut(const OsiRowCut &rc);
761
765 virtual void applyColCut(const OsiColCut &cc);
767
768 private:
771 void resizeColType(int minsize);
773
775 void freeColType();
777
780
782 void gutsOfCopy(const OsiCpxSolverInterface &source);
783
785 void gutsOfConstructor();
786
788 void gutsOfDestructor();
789
791 void freeCachedColRim();
792
794 void freeCachedRowRim();
795
797 void freeCachedResults();
798
800 void freeCachedMatrix();
801
803 void freeCachedData(int keepCached = KEEPCACHED_NONE);
804
806 void freeAllMemory();
807
809
812 mutable CPXENVptr env_;
815 mutable CPXLPptr lp_;
816
818 int *hotStartCStat_;
819 int hotStartCStatSize_;
820 int *hotStartRStat_;
821 int hotStartRStatSize_;
822 int hotStartMaxIteration_;
823
826 mutable double *obj_;
828
830 mutable double *collower_;
831
833 mutable double *colupper_;
834
836 mutable char *rowsense_;
837
839 mutable double *rhs_;
840
842 mutable double *rowrange_;
843
845 mutable double *rowlower_;
846
848 mutable double *rowupper_;
849
851 mutable double *colsol_;
852
854 mutable double *rowsol_;
855
857 mutable double *redcost_;
858
860 mutable double *rowact_;
861
863 mutable CoinPackedMatrix *matrixByRow_;
864
866 mutable CoinPackedMatrix *matrixByCol_;
868
871 char *coltype_;
873
875 int coltypesize_;
876
878 mutable bool probtypemip_;
879
881 bool domipstart;
882
884 bool disableadvbasis;
885
887 };
888
889 //#############################################################################
891 void OsiCpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
892
893 #endif
894
895 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
896 */
OsiCpxSolverInterface::FREECACHED_MATRIX
free only cached matrix and LP solution information
Definition: OsiCpxSolverInterface.hpp:633
OsiCpxSolverInterface::KEEPCACHED_MATRIX
problem matrix: matrix ordered by column and by row
Definition: OsiCpxSolverInterface.hpp:621
OsiSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
OsiCpxSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiCpxSolverInterface::freeCachedRowRim
void freeCachedRowRim()
free cached row rim vectors
OsiCpxSolverInterface::KEEPCACHED_NONE
discard all cached data (default)
Definition: OsiCpxSolverInterface.hpp:615
OsiCpxSolverInterface::keepCachedFlag
keepCachedFlag
Get pointer to CPLEX model and free all specified cached data entries (combined with logical or-opera...
Definition: OsiCpxSolverInterface.hpp:613
OsiCpxSolverInterface::getMipStart
bool getMipStart() const
Definition: OsiCpxSolverInterface.hpp:77
OsiCpxSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
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::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler It is the client&#39;s responsibility to destroy a message handler installed by...
OsiCpxSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
OsiCpxSolverInterface::rowlower_
double * rowlower_
Pointer to dense vector of row lower bounds.
Definition: OsiCpxSolverInterface.hpp:845
OsiCpxSolverInterface::gutsOfCopy
void gutsOfCopy(const OsiCpxSolverInterface &source)
The real work of a copy constructor (used by copy and assignment)
OsiCpxSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
OsiCpxSolverInterface::lp_
CPXLPptr lp_
CPLEX model represented by this class instance.
Definition: OsiCpxSolverInterface.hpp:815
OsiCpxSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiCpxSolverInterface::freeCachedMatrix
void freeCachedMatrix()
free cached matrices
OsiCpxSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
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::domipstart
bool domipstart
Whether to pass a column solution to CPLEX before starting MIP solve (copymipstart) ...
Definition: OsiCpxSolverInterface.hpp:881
OsiCpxSolverInterface::getNumElements
virtual int getNumElements() const
Get number of nonzero elements.
OsiCpxSolverInterface::rowupper_
double * rowupper_
Pointer to dense vector of row upper bounds.
Definition: OsiCpxSolverInterface.hpp:848
OsiSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiCpxSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiCpxSolverInterface::KEEPCACHED_RESULTS
LP solution: primal and dual solution, reduced costs, row activities.
Definition: OsiCpxSolverInterface.hpp:623
OsiSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
OsiCpxSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiCpxSolverInterface::getMutableLpPtr
CPXLPptr getMutableLpPtr() const
Get LP Pointer for const methods.
OsiCpxSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiCpxSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiCpxSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiCpxSolverInterface::OsiCpxSolverInterface
OsiCpxSolverInterface()
Default Constructor.
OsiCpxSolverInterfaceUnitTest
void OsiCpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiCpxSolverInterface class.
OsiCpxSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiCpxSolverInterface::disableSimplexInterface
virtual void disableSimplexInterface()
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:703
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiCpxSolverInterface::enableFactorization
virtual void enableFactorization() const
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:708
OsiCpxSolverInterface::setObjCoeffSet
virtual void setObjCoeffSet(const int *indexFirst, const int *indexLast, const double *coeffList)
Set a a set of objective function coefficients.
OsiCpxSolverInterface::hotStartMaxIteration_
int hotStartMaxIteration_
Definition: OsiCpxSolverInterface.hpp:822
OsiCpxSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiCpxSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
OsiCpxSolverInterface::getInfinity
virtual double getInfinity() const
Get solver&#39;s value for infinity.
OsiCpxSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
OsiCpxSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
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...
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiCpxSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiCpxSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiCpxSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever &quot;iteration&quot; mean to the solver...
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::gutsOfConstructor
void gutsOfConstructor()
The real work of the constructor.
OsiCpxSolverInterface::freeColType
void freeColType()
frees colsize_ vector
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::disableadvbasis
bool disableadvbasis
Whether to disable use of advanced basis (if given)
Definition: OsiCpxSolverInterface.hpp:884
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:345
OsiCpxSolverInterface::KEEPCACHED_ROW
row information: right hand sides, ranges and senses, lower and upper bounds for row ...
Definition: OsiCpxSolverInterface.hpp:619
OsiSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
OsiCpxSolverInterface::coltype_
char * coltype_
Pointer to dense vector of variable types (continous, binary, integer)
Definition: OsiCpxSolverInterface.hpp:872
OsiCpxSolverInterface::matrixByCol_
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiCpxSolverInterface.hpp:866
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.
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
OsiCpxSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver&#39;s built-in enumeration algorithm.
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::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiCpxSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
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::~OsiCpxSolverInterface
virtual ~OsiCpxSolverInterface()
Destructor.
OsiCpxSolverInterface::switchToLP
void switchToLP()
switches CPLEX to prob type LP
OsiCpxSolverInterface::redcost_
double * redcost_
Pointer to reduced cost vector.
Definition: OsiCpxSolverInterface.hpp:857
OsiCpxSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
OsiCpxSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
Definition: OsiCpxSolverInterface.hpp:842
OsiCpxSolverInterface::rowsol_
double * rowsol_
Pointer to dual solution vector.
Definition: OsiCpxSolverInterface.hpp:854
OsiCpxSolverInterface::OsiCpxSolverInterfaceUnitTest
friend void OsiCpxSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiCpxSolverInterface class.
OsiCpxSolverInterface::hotStartRStat_
int * hotStartRStat_
Definition: OsiCpxSolverInterface.hpp:820
OsiCpxSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiCpxSolverInterface::colsol_
double * colsol_
Pointer to primal solution vector.
Definition: OsiCpxSolverInterface.hpp:851
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::disableFactorization
virtual void disableFactorization() const
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:713
OsiCpxSolverInterface::hotStartCStatSize_
int hotStartCStatSize_
Definition: OsiCpxSolverInterface.hpp:819
CPXLPptr
struct cpxlp * CPXLPptr
Definition: OsiCpxSolverInterface.hpp:21
OsiCpxSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer 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::probtypemip_
bool probtypemip_
Stores whether CPLEX&#39; prob type is currently set to MIP.
Definition: OsiCpxSolverInterface.hpp:878
OsiCpxSolverInterface::gutsOfDestructor
void gutsOfDestructor()
The real work of the destructor.
OsiCpxSolverInterface::getEnvironmentPtr
CPXENVptr getEnvironmentPtr()
Method to access CPLEX environment pointer.
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...
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:87
OsiCpxSolverInterface::hotStartCStat_
int * hotStartCStat_
Hotstart information.
Definition: OsiCpxSolverInterface.hpp:818
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::getEmptyWarmStart
CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
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::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiCpxSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiCpxSolverInterface::getMutableEnvironmentPtr
CPXENVptr getMutableEnvironmentPtr() const
Get Environment Pointer for const methods.
OsiCpxSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiCpxSolverInterface::setMipStart
void setMipStart(bool value)
Definition: OsiCpxSolverInterface.hpp:75
OsiCpxSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiCpxSolverInterface::freeCachedData
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
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.
OsiSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
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::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
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::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
OsiCpxSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
OsiCpxSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
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::env_
CPXENVptr env_
CPLEX environment used in this class instance.
Definition: OsiCpxSolverInterface.hpp:813
OsiCpxSolverInterface::reset
virtual void reset()
Resets as if default constructor.
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiCpxSolverInterface::getLpPtr
CPXLPptr getLpPtr(int keepCached=KEEPCACHED_NONE)
OsiCpxSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiCpxSolverInterface::FREECACHED_COLUMN
free only cached column and LP solution information
Definition: OsiCpxSolverInterface.hpp:629
OsiCpxSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiCpxSolverInterface.hpp:863
OsiSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
OsiCpxSolverInterface::operator=
OsiCpxSolverInterface & operator=(const OsiCpxSolverInterface &rhs)
Assignment operator.
OsiRowCut.hpp
OsiCpxSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiCpxSolverInterface
CPLEX Solver Interface.
Definition: OsiCpxSolverInterface.hpp:29
OsiCpxSolverInterface::getBInvCol
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
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::resizeColType
void resizeColType(int minsize)
resizes coltype_ vector to be able to store at least minsize elements
OsiCpxSolverInterface::getCtype
const char * getCtype() const
return a vector of variable types (continous, binary, integer)
OsiCpxSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiCpxSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
OsiSolverInterface.hpp
OsiCpxSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiCpxSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
OsiCpxSolverInterface::KEEPCACHED_COLUMN
column information: objective values, lower and upper bounds, variable types
Definition: OsiCpxSolverInterface.hpp:617
OsiCpxSolverInterface::switchToMIP
void switchToMIP()
switches CPLEX to prob type MIP
OsiCpxSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
OsiCpxSolverInterface::getBInvRow
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
OsiCpxSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiCpxSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
OsiCpxSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiCpxSolverInterface.hpp:836
OsiCpxSolverInterface::freeCachedColRim
void freeCachedColRim()
free cached column rim vectors
OsiColCut.hpp
OsiCpxSolverInterface::enableSimplexInterface
virtual void enableSimplexInterface(int doingPrimal)
Useless function, defined only for compatibility with OsiSimplexInterface.
Definition: OsiCpxSolverInterface.hpp:698
OsiCpxSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiCpxSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiCpxSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiCpxSolverInterface::getBInvACol
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
OsiCpxSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
OsiCpxSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
CoinWarmStartBasis.hpp
OsiCpxSolverInterface::colupper_
double * colupper_
Pointer to dense vector of variable lower bounds.
Definition: OsiCpxSolverInterface.hpp:833
OsiCpxSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiCpxSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
OsiCpxSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)=0
Add a row (constraint) to the problem.
OsiVectorInt
std::vector< int > OsiVectorInt
Vector of int.
Definition: OsiCollections.hpp:20
OsiCpxSolverInterface::basisIsAvailable
virtual bool basisIsAvailable() const
Returns true if a basis is available.
OsiCpxSolverInterface::coltypesize_
int coltypesize_
Size of allocated memory for coltype_.
Definition: OsiCpxSolverInterface.hpp:875
OsiCpxSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiCpxSolverInterface::freeAllMemory
void freeAllMemory()
free all allocated memory
OsiCpxSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiCpxSolverInterface::FREECACHED_ROW
free only cached row and LP solution information
Definition: OsiCpxSolverInterface.hpp:631
OsiCpxSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiCpxSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
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::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::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiCpxSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiCpxSolverInterface::hotStartRStatSize_
int hotStartRStatSize_
Definition: OsiCpxSolverInterface.hpp:821
CoinWarmStart
Abstract base class for warm start information.
Definition: CoinWarmStart.hpp:21
OsiCpxSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
OsiCpxSolverInterface::FREECACHED_RESULTS
free only cached LP solution information
Definition: OsiCpxSolverInterface.hpp:635
OsiCpxSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiCpxSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiCpxSolverInterface.hpp:839
OsiCpxSolverInterface::rowact_
double * rowact_
Pointer to row activity (slack) vector.
Definition: OsiCpxSolverInterface.hpp:860
OsiCpxSolverInterface::KEEPCACHED_PROBLEM
only discard cached LP solution
Definition: OsiCpxSolverInterface.hpp:625
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.
CPXENVptr
struct cpxenv * CPXENVptr
Definition: OsiCpxSolverInterface.hpp:22
OsiCpxSolverInterface::obj_
double * obj_
Pointer to objective vector.
Definition: OsiCpxSolverInterface.hpp:827
OsiCpxSolverInterface::collower_
double * collower_
Pointer to dense vector of variable lower bounds.
Definition: OsiCpxSolverInterface.hpp:830
OsiCpxSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
OsiCpxSolverInterface::freeCachedResults
void freeCachedResults()
free cached result vectors
OsiCpxSolverInterface::KEEPCACHED_ALL
keep all cached data (similar to getMutableLpPtr())
Definition: OsiCpxSolverInterface.hpp:627