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

- File List
- File Members

OsiMskSolverInterface.hpp
Go to the documentation of this file.
1 // Osi interface for Mosek ver. 5.0
2 // Lower versions are not supported
3 //-----------------------------------------------------------------------------
4 // name: OSI Interface for MOSEK
5 // author: Bo Jensen
6 // email: support@MOSEK.com
7 //-----------------------------------------------------------------------------
8
9 // This code is licensed under the terms of the Eclipse Public License (EPL).
10
11 #ifndef OsiMskSolverInterface_H
12 #define OsiMskSolverInterface_H
13
14 #include "OsiSolverInterface.hpp"
15
16 typedef void* MSKtask_t;
17 typedef void* MSKenv_t;
18
19 /* MOSEK Solver Interface
20 Instantiation of OsiMskSolverInterface for MOSEK
21 */
22
23 class OsiMskSolverInterface :
24 virtual public OsiSolverInterface {
25 friend void OsiMskSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
26 public:
27
28 //---------------------------------------------------------------------------
31 virtual void initialSolve();
33
35 virtual void resolve();
36
38 virtual void branchAndBound();
40
41 //---------------------------------------------------------------------------
57 // Set an integer parameter
58 bool setIntParam(OsiIntParam key, int value);
59 // Set an double parameter
60 bool setDblParam(OsiDblParam key, double value);
61 // Set a string parameter
62 bool setStrParam(OsiStrParam key, const std::string & value);
63 // Get an integer parameter
64 bool getIntParam(OsiIntParam key, int& value) const;
65 // Get an double parameter
66 bool getDblParam(OsiDblParam key, double& value) const;
67 // Get a string parameter
68 bool getStrParam(OsiStrParam key, std::string& value) const;
70
71 //---------------------------------------------------------------------------
73
74 virtual bool isAbandoned() const;
77 virtual bool isProvenOptimal() const;
79 virtual bool isProvenPrimalInfeasible() const;
81 virtual bool isProvenDualInfeasible() const;
83 virtual bool isPrimalObjectiveLimitReached() const;
85 virtual bool isDualObjectiveLimitReached() const;
87 virtual bool isIterationLimitReached() const;
89 virtual bool isLicenseError() const;
91 int getRescode() const { return Mskerr; }
93
94 //---------------------------------------------------------------------------
103 CoinWarmStart* getEmptyWarmStart () const;
104
106 virtual CoinWarmStart* getWarmStart() const;
110 virtual bool setWarmStart(const CoinWarmStart* warmstart);
112
113 //---------------------------------------------------------------------------
120 virtual void markHotStart();
123 virtual void solveFromHotStart();
125 virtual void unmarkHotStart();
127
128 //---------------------------------------------------------------------------
143 virtual int getNumCols() const;
145
147 virtual int getNumRows() const;
148
150 virtual int getNumElements() const;
151
153 virtual const double * getColLower() const;
154
156 virtual const double * getColUpper() const;
157
167 virtual const char * getRowSense() const;
168
177 virtual const double * getRightHandSide() const;
178
187 virtual const double * getRowRange() const;
188
190 virtual const double * getRowLower() const;
191
193 virtual const double * getRowUpper() const;
194
196 virtual const double * getObjCoefficients() const;
197
199 virtual double getObjSense() const;
200
202 virtual bool isContinuous(int colNumber) const;
203
204 #if 0
205 virtual bool isBinary(int columnNumber) const;
207
212 virtual bool isInteger(int columnNumber) const;
213
215 virtual bool isIntegerNonBinary(int columnNumber) const;
216
218 virtual bool isFreeBinary(int columnNumber) const;
219 #endif
220
222 virtual const CoinPackedMatrix * getMatrixByRow() const;
223
225 virtual const CoinPackedMatrix * getMatrixByCol() const;
226
228 virtual double getInfinity() const;
230
233 virtual const double * getColSolution() const;
235
237 virtual const double * getRowPrice() const;
238
240 virtual const double * getReducedCost() const;
241
244 virtual const double * getRowActivity() const;
245
247 virtual double getObjValue() const;
248
251 virtual int getIterationCount() const;
252
270 virtual std::vector<double*> getDualRays(int maxNumRays,
271 bool fullRay=false) const;
283 virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
284
285 #if 0
286
288 virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
289 const;
290 #endif
291
292
293
294 //---------------------------------------------------------------------------
295
298 //-------------------------------------------------------------------------
302 virtual void setObjCoeff( int elementIndex, double elementValue );
303
305 virtual void setObjCoeffSet(const int* indexFirst,
306 const int* indexLast,
307 const double* coeffList);
308
311 virtual void setColLower( int elementIndex, double elementValue );
312
315 virtual void setColUpper( int elementIndex, double elementValue );
316
320 virtual void setColBounds( int elementIndex,
321 double lower, double upper );
322
330 virtual void setColSetBounds(const int* indexFirst,
331 const int* indexLast,
332 const double* boundList);
333
336 virtual void setRowLower( int elementIndex, double elementValue );
337
340 virtual void setRowUpper( int elementIndex, double elementValue );
341
345 virtual void setRowBounds( int elementIndex,
346 double lower, double upper );
347
349 virtual void setRowType(int index, char sense, double rightHandSide,
350 double range);
351
359 virtual void setRowSetBounds(const int* indexFirst,
360 const int* indexLast,
361 const double* boundList);
362
372 virtual void setRowSetTypes(const int* indexFirst,
373 const int* indexLast,
374 const char* senseList,
375 const double* rhsList,
376 const double* rangeList);
378
379 //-------------------------------------------------------------------------
383 virtual void setContinuous(int index);
385 virtual void setInteger(int index);
388 virtual void setContinuous(const int* indices, int len);
391 virtual void setInteger(const int* indices, int len);
393
394 //-------------------------------------------------------------------------
396 virtual void setObjSense(double s);
397
408 virtual void setColSolution(const double * colsol);
409
420 virtual void setRowPrice(const double * rowprice);
421
422 //-------------------------------------------------------------------------
428 virtual void addCol(const CoinPackedVectorBase& vec,
429 const double collb, const double colub,
430 const double obj);
432 virtual void addCols(const int numcols,
433 const CoinPackedVectorBase * const * cols,
434 const double* collb, const double* colub,
435 const double* obj);
437 virtual void deleteCols(const int num, const int * colIndices);
438
440 virtual void addRow(const CoinPackedVectorBase& vec,
441 const double rowlb, const double rowub);
443 virtual void addRow(const CoinPackedVectorBase& vec,
444 const char rowsen, const double rowrhs,
445 const double rowrng);
447 virtual void addRows(const int numrows,
448 const CoinPackedVectorBase * const * rows,
449 const double* rowlb, const double* rowub);
451 virtual void addRows(const int numrows,
452 const CoinPackedVectorBase * const * rows,
453 const char* rowsen, const double* rowrhs,
454 const double* rowrng);
456 virtual void deleteRows(const int num, const int * rowIndices);
457
458 #if 0
459 // ??? implemented in OsiSolverInterface
460 //-----------------------------------------------------------------------
482 virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
483 double effectivenessLb = 0.0);
484 #endif
485
486
487
488 //---------------------------------------------------------------------------
489
503 virtual void loadProblem(const CoinPackedMatrix& matrix,
504 const double* collb, const double* colub,
505 const double* obj,
506 const double* rowlb, const double* rowub);
507
515 virtual void assignProblem(CoinPackedMatrix*& matrix,
516 double*& collb, double*& colub, double*& obj,
517 double*& rowlb, double*& rowub);
518
531 virtual void loadProblem(const CoinPackedMatrix& matrix,
532 const double* collb, const double* colub,
533 const double* obj,
534 const char* rowsen, const double* rowrhs,
535 const double* rowrng);
536
544 virtual void assignProblem(CoinPackedMatrix*& matrix,
545 double*& collb, double*& colub, double*& obj,
546 char*& rowsen, double*& rowrhs,
547 double*& rowrng);
548
551 virtual void loadProblem(const int numcols, const int numrows,
552 const int* start, const int* index,
553 const double* value,
554 const double* collb, const double* colub,
555 const double* obj,
556 const double* rowlb, const double* rowub);
557
560 virtual void loadProblem(const int numcols, const int numrows,
561 const int* start, const int* index,
562 const double* value,
563 const double* collb, const double* colub,
564 const double* obj,
565 const char* rowsen, const double* rowrhs,
566 const double* rowrng);
567
569 virtual int readMps(const char *filename,
570 const char *extension = "mps");
571
576 virtual void writeMps(const char *filename,
577 const char *extension = "mps",
578 double objSense=0.0) const;
580
588 void passInMessageHandler(CoinMessageHandler * handler);
590
591 //---------------------------------------------------------------------------
592
598 enum keepCachedFlag
599 {
601 KEEPCACHED_NONE = 0,
603 KEEPCACHED_COLUMN = 1,
605 KEEPCACHED_ROW = 2,
607 KEEPCACHED_MATRIX = 4,
609 KEEPCACHED_RESULTS = 8,
611 KEEPCACHED_PROBLEM = KEEPCACHED_COLUMN | KEEPCACHED_ROW | KEEPCACHED_MATRIX,
613 KEEPCACHED_ALL = KEEPCACHED_PROBLEM | KEEPCACHED_RESULTS,
615 FREECACHED_COLUMN = KEEPCACHED_PROBLEM & ~KEEPCACHED_COLUMN,
617 FREECACHED_ROW = KEEPCACHED_PROBLEM & ~KEEPCACHED_ROW,
619 FREECACHED_MATRIX = KEEPCACHED_PROBLEM & ~KEEPCACHED_MATRIX,
621 FREECACHED_RESULTS = KEEPCACHED_ALL & ~KEEPCACHED_RESULTS
622 };
623
624 MSKtask_t getLpPtr( int keepCached = KEEPCACHED_NONE );
625
627 MSKenv_t getEnvironmentPtr();
630
632 const char* getCtype() const;
633
643 static void incrementInstanceCounter();
644
653 static void decrementInstanceCounter();
654
656 static unsigned int getNumInstances();
658
659
662 OsiMskSolverInterface(MSKenv_t mskenv = NULL);
666
668 virtual OsiSolverInterface * clone(bool copyData = true) const;
669
671 OsiMskSolverInterface( const OsiMskSolverInterface& );
672
674 OsiMskSolverInterface& operator=( const OsiMskSolverInterface& rhs );
675
677 virtual ~OsiMskSolverInterface();
679
680 protected:
681
684 virtual void applyRowCut( const OsiRowCut & rc );
686
690 virtual void applyColCut( const OsiColCut & cc );
692
693 private:
696 void switchToLP();
698
700 void switchToMIP();
701
703 void resizeColType( int minsize );
704
706 void freeColType();
707
708 bool definedSolution(int solution) const;
709
710 int solverUsed() const;
711
713
716 static MSKenv_t env_ ;
718
720 //static unsigned int numInstances_;
722 static unsigned int numInstances_;
723
726
727 int Mskerr;
728 int MSKsolverused_;
729 double ObjOffset_;
730
731 int InitialSolver;
732
734 public: MSKtask_t getMutableLpPtr() const;
735
737 void gutsOfCopy( const OsiMskSolverInterface & source );
738
740 void gutsOfConstructor();
741
743 void gutsOfDestructor();
744
746 void freeCachedColRim();
747
749 void freeCachedRowRim();
750
752 void freeCachedResults();
753
755 void freeCachedMatrix();
756
758 void freeCachedData( int keepCached = KEEPCACHED_NONE );
759
761 void freeAllMemory();
762
765 mutable MSKtask_t task_;
767
769 int *hotStartCStat_;
770 int hotStartCStatSize_;
771 int *hotStartRStat_;
772 int hotStartRStatSize_;
773 int hotStartMaxIteration_;
774
777 mutable double *obj_;
779
781 mutable double *collower_;
782
784 mutable double *colupper_;
785
787 mutable char *rowsense_;
788
790 mutable double *rhs_;
791
793 mutable double *rowrange_;
794
796 mutable double *rowlower_;
797
799 mutable double *rowupper_;
800
802 mutable double *colsol_;
803
805 mutable double *rowsol_;
806
808 mutable double *redcost_;
809
811 mutable double *rowact_;
812
814 mutable CoinPackedMatrix *matrixByRow_;
815
817 mutable CoinPackedMatrix *matrixByCol_;
819
822 char *coltype_;
824
826 int coltypesize_;
827
829 mutable bool probtypemip_;
830
832 };
833
834 //#############################################################################
836 void OsiMskSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
837
838 #endif
OsiMskSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
OsiMskSolverInterface::freeAllMemory
void freeAllMemory()
free all allocated memory
OsiMskSolverInterface::obj_
double * obj_
Pointer to objective vector.
Definition: OsiMskSolverInterface.hpp:778
OsiMskSolverInterface::freeCachedMatrix
void freeCachedMatrix()
free cached matrices
OsiMskSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiMskSolverInterface::getRescode
int getRescode() const
Get rescode return of last Mosek optimizer call.
Definition: OsiMskSolverInterface.hpp:91
OsiMskSolverInterface::probtypemip_
bool probtypemip_
Stores whether MOSEK&#39; prob type is currently set to MIP.
Definition: OsiMskSolverInterface.hpp:829
OsiMskSolverInterface::rowupper_
double * rowupper_
Pointer to dense vector of row upper bounds.
Definition: OsiMskSolverInterface.hpp:799
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiMskSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiMskSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
OsiMskSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiMskSolverInterface::matrixByCol_
CoinPackedMatrix * matrixByCol_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiMskSolverInterface.hpp:817
OsiMskSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiMskSolverInterface::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 ...
OsiMskSolverInterface::OsiMskSolverInterfaceUnitTest
friend void OsiMskSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiMskSolverInterface class.
OsiMskSolverInterface::isLicenseError
virtual bool isLicenseError() const
Has there been a license problem?
OsiMskSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:327
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiMskSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiMskSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiMskSolverInterface::decrementInstanceCounter
static void decrementInstanceCounter()
MOSEK has a context which should be deleted after MOSEK calls.
OsiMskSolverInterface::getNumInstances
static unsigned int getNumInstances()
Return the number of instances of instantiated objects using MOSEK services.
OsiMskSolverInterface::env_
static MSKenv_t env_
MOSEK environment pointer.
Definition: OsiMskSolverInterface.hpp:717
OsiMskSolverInterface::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...
OsiMskSolverInterface::getLpPtr
MSKtask_t getLpPtr(int keepCached=KEEPCACHED_NONE)
Get pointer to MOSEK model and free all specified cached data entries (combined with logical or-opera...
OsiMskSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
OsiMskSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiMskSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiMskSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiMskSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiMskSolverInterface::collower_
double * collower_
Pointer to dense vector of variable lower bounds.
Definition: OsiMskSolverInterface.hpp:781
OsiMskSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
OsiMskSolverInterface::colsol_
double * colsol_
Pointer to primal solution vector.
Definition: OsiMskSolverInterface.hpp:802
OsiMskSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiMskSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
OsiMskSolverInterface::getMutableLpPtr
MSKtask_t getMutableLpPtr() const
Get task Pointer for const methods.
OsiMskSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
OsiMskSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiMskSolverInterface.hpp:814
OsiMskSolverInterface::getInfinity
virtual double getInfinity() const
Get solver&#39;s value for infinity.
OsiMskSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiMskSolverInterface::getCtype
const char * getCtype() const
return a vector of variable types (continous, binary, integer)
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
OsiMskSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiMskSolverInterface::KEEPCACHED_ROW
row information: right hand sides, ranges and senses, lower and upper bounds for row ...
Definition: OsiMskSolverInterface.hpp:605
OsiMskSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
OsiMskSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiMskSolverInterface.hpp:790
OsiMskSolverInterface::colupper_
double * colupper_
Pointer to dense vector of variable lower bounds.
Definition: OsiMskSolverInterface.hpp:784
OsiMskSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
OsiMskSolverInterface::FREECACHED_RESULTS
free only cached LP solution information
Definition: OsiMskSolverInterface.hpp:621
OsiMskSolverInterface::FREECACHED_ROW
free only cached row and LP solution information
Definition: OsiMskSolverInterface.hpp:617
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiMskSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
OsiMskSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
OsiMskSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver&#39;s built-in enumeration algorithm.
OsiMskSolverInterface::KEEPCACHED_MATRIX
problem matrix: matrix ordered by column and by row
Definition: OsiMskSolverInterface.hpp:607
OsiMskSolverInterface::coltypesize_
int coltypesize_
Size of allocated memory for coltype_.
Definition: OsiMskSolverInterface.hpp:826
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
OsiMskSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiMskSolverInterface::freeColType
void freeColType()
frees colsize_ vector
OsiMskSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiMskSolverInterface::hotStartMaxIteration_
int hotStartMaxIteration_
MOSEK model represented by this class instance.
Definition: OsiMskSolverInterface.hpp:773
OsiMskSolverInterface::getEmptyWarmStart
CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
OsiVectorInt
std::vector< int > OsiVectorInt
Vector of int.
Definition: OsiCollections.hpp:22
OsiMskSolverInterface::hotStartCStatSize_
int hotStartCStatSize_
MOSEK model represented by this class instance.
Definition: OsiMskSolverInterface.hpp:770
OsiMskSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiMskSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiMskSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
Definition: OsiMskSolverInterface.hpp:793
OsiMskSolverInterface::hotStartRStat_
int * hotStartRStat_
MOSEK model represented by this class instance.
Definition: OsiMskSolverInterface.hpp:771
OsiMskSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiMskSolverInterface::gutsOfCopy
void gutsOfCopy(const OsiMskSolverInterface &source)
The real work of a copy constructor (used by copy and assignment)
OsiMskSolverInterface::gutsOfConstructor
void gutsOfConstructor()
The real work of the constructor.
OsiMskSolverInterface::rowact_
double * rowact_
Pointer to row activity (slack) vector.
Definition: OsiMskSolverInterface.hpp:811
OsiMskSolverInterface::hotStartRStatSize_
int hotStartRStatSize_
MOSEK model represented by this class instance.
Definition: OsiMskSolverInterface.hpp:772
OsiMskSolverInterface::freeCachedData
void freeCachedData(int keepCached=KEEPCACHED_NONE)
free all cached data (except specified entries, see getLpPtr())
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...
OsiMskSolverInterface::freeCachedRowRim
void freeCachedRowRim()
free cached row rim vectors
OsiMskSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
OsiMskSolverInterface::rowsol_
double * rowsol_
Pointer to dual solution vector.
Definition: OsiMskSolverInterface.hpp:805
OsiMskSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
OsiMskSolverInterface::~OsiMskSolverInterface
virtual ~OsiMskSolverInterface()
Destructor.
OsiMskSolverInterface::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...
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:88
OsiMskSolverInterface::freeCachedColRim
void freeCachedColRim()
free cached column rim vectors
OsiMskSolverInterface::definedSolution
bool definedSolution(int solution) const
switches MOSEK to prob type LP
OsiMskSolverInterface::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiMskSolverInterface::KEEPCACHED_NONE
discard all cached data (default)
Definition: OsiMskSolverInterface.hpp:601
OsiMskSolverInterface::MSKsolverused_
int MSKsolverused_
Get task Pointer for const methods.
Definition: OsiMskSolverInterface.hpp:728
OsiMskSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
OsiMskSolverInterface::incrementInstanceCounter
static void incrementInstanceCounter()
MOSEK has a context which must be created prior to all other MOSEK calls.
OsiMskSolverInterface::freeCachedResults
void freeCachedResults()
free cached result vectors
OsiMskSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
OsiMskSolverInterface::InitialSolver
int InitialSolver
Get task Pointer for const methods.
Definition: OsiMskSolverInterface.hpp:731
OsiMskSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
OsiMskSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiMskSolverInterface::resizeColType
void resizeColType(int minsize)
resizes coltype_ vector to be able to store at least minsize elements
OsiMskSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiMskSolverInterface::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.
OsiMskSolverInterface::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.
OsiMskSolverInterface::operator=
OsiMskSolverInterface & operator=(const OsiMskSolverInterface &rhs)
Assignment operator.
OsiSolverInterface.hpp
MSKenv_t
void * MSKenv_t
Definition: OsiMskSolverInterface.hpp:17
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
OsiMskSolverInterface::keepCachedFlag
keepCachedFlag
Get pointer to MOSEK model and free all specified cached data entries (combined with logical or-opera...
Definition: OsiMskSolverInterface.hpp:598
OsiMskSolverInterface::setObjCoeffSet
virtual void setObjCoeffSet(const int *indexFirst, const int *indexLast, const double *coeffList)
Set a a set of objective function coefficients.
OsiMskSolverInterface::hotStartCStat_
int * hotStartCStat_
Hotstart information.
Definition: OsiMskSolverInterface.hpp:769
OsiMskSolverInterface::getEnvironmentPtr
MSKenv_t getEnvironmentPtr()
Method to access MOSEK environment pointer.
OsiMskSolverInterface::ObjOffset_
double ObjOffset_
Get task Pointer for const methods.
Definition: OsiMskSolverInterface.hpp:729
OsiMskSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiMskSolverInterface::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...
OsiMskSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
OsiMskSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiMskSolverInterface::switchToLP
void switchToLP()
switches MOSEK to prob type LP
OsiMskSolverInterface::Mskerr
int Mskerr
Get task Pointer for const methods.
Definition: OsiMskSolverInterface.hpp:727
OsiMskSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiMskSolverInterface::OsiMskSolverInterface
OsiMskSolverInterface(MSKenv_t mskenv=NULL)
Default Constructor optional argument mskenv can be used to reach in an initialized user environment ...
OsiMskSolverInterface::KEEPCACHED_ALL
keep all cached data (similar to getMutableLpPtr())
Definition: OsiMskSolverInterface.hpp:613
OsiMskSolverInterface::addRows
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
OsiMskSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
OsiMskSolverInterface::redcost_
double * redcost_
Pointer to reduced cost vector.
Definition: OsiMskSolverInterface.hpp:808
OsiMskSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
CoinWarmStart
Abstract base class for warm start information.
Definition: CoinWarmStart.hpp:21
OsiMskSolverInterface::KEEPCACHED_RESULTS
LP solution: primal and dual solution, reduced costs, row activities.
Definition: OsiMskSolverInterface.hpp:609
OsiMskSolverInterface::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...
OsiMskSolverInterface::numInstances_
static unsigned int numInstances_
Number of live problem instances.
Definition: OsiMskSolverInterface.hpp:722
OsiMskSolverInterfaceUnitTest
void OsiMskSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiMskSolverInterface class.
OsiMskSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
OsiMskSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiMskSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever &quot;iteration&quot; mean to the solver...
OsiMskSolverInterface::rowlower_
double * rowlower_
Pointer to dense vector of row lower bounds.
Definition: OsiMskSolverInterface.hpp:796
OsiMskSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
OsiSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
OsiMskSolverInterface::FREECACHED_COLUMN
free only cached column and LP solution information
Definition: OsiMskSolverInterface.hpp:615
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiMskSolverInterface
Definition: OsiMskSolverInterface.hpp:23
OsiMskSolverInterface::getNumElements
virtual int getNumElements() const
Get number of nonzero elements.
OsiMskSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiMskSolverInterface.hpp:787
OsiMskSolverInterface::gutsOfDestructor
void gutsOfDestructor()
The real work of the destructor.
MSKtask_t
void * MSKtask_t
Definition: OsiMskSolverInterface.hpp:16
OsiMskSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiMskSolverInterface::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler It is the client&#39;s responsibility to destroy a message handler installed by...
OsiMskSolverInterface::KEEPCACHED_COLUMN
column information: objective values, lower and upper bounds, variable types
Definition: OsiMskSolverInterface.hpp:603
OsiMskSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
OsiMskSolverInterface::FREECACHED_MATRIX
free only cached matrix and LP solution information
Definition: OsiMskSolverInterface.hpp:619
OsiMskSolverInterface::solverUsed
int solverUsed() const
switches MOSEK to prob type LP
OsiMskSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
OsiMskSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiMskSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiMskSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
OsiMskSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiMskSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiMskSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
OsiMskSolverInterface::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...
OsiMskSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiMskSolverInterface::task_
MSKtask_t task_
MOSEK model represented by this class instance.
Definition: OsiMskSolverInterface.hpp:766
OsiMskSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiMskSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiMskSolverInterface::switchToMIP
void switchToMIP()
switches MOSEK to prob type MIP
OsiMskSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiMskSolverInterface::coltype_
char * coltype_
Pointer to dense vector of variable types (continous, binary, integer)
Definition: OsiMskSolverInterface.hpp:823
OsiMskSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
OsiMskSolverInterface::KEEPCACHED_PROBLEM
only discard cached LP solution
Definition: OsiMskSolverInterface.hpp:611
OsiMskSolverInterface::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()...