OsiSolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef OsiSolverInterface_H
4 #define OsiSolverInterface_H
5 
6 #include <string>
7 #include <vector>
8 
9 #include "CoinMessageHandler.hpp"
10 #include "CoinPackedVectorBase.hpp"
11 
12 #include "OsiCollections.hpp"
13 #include "OsiSolverParameters.hpp"
14 
15 class CoinPackedMatrix;
16 class CoinWarmStart;
17 class CoinSnapshot;
18 class CoinLpIO;
19 class CoinMpsIO;
20 
21 class OsiCuts;
22 class OsiAuxInfo;
23 class OsiRowCut;
24 class OsiRowCutDebugger;
25 class CoinSet;
26 class CoinBuild;
27 class CoinModel;
28 class OsiSolverBranch;
29 class OsiSolverResult;
30 class OsiObject;
31 #include "CoinFinite.hpp"
32 
33 
34 //#############################################################################
35 
61  const OsiSolverInterface* emptySi,
62  const std::string & mpsDir,
63  const std::string & netlibDir);
65  const std::vector<OsiSolverInterface*> & vecSiP,
66  const std::string & mpsDir);
67 
68 public:
69 
72  friend class OsiSolverInterface;
73  friend class OsiOslSolverInterface;
74  friend class OsiClpSolverInterface;
75 
76  public:
78 
83  infeasible_(0),
84  ineffective_(0),
85  applied_(0) {}
92  applied_(rhs.applied_) {}
95  {
96  if (this != &rhs) {
101  applied_ = rhs.applied_;
102  }
103  return *this;
104  }
108 
111  inline int getNumInconsistent(){return intInconsistent_;}
116  inline int getNumInfeasible(){return infeasible_;}
118  inline int getNumIneffective(){return ineffective_;}
120  inline int getNumApplied(){return applied_;}
122 
123  private:
135  inline void incrementApplied(){applied_++;}
137 
139 
140  int intInconsistent_;
149  int applied_;
151  };
152 
153  //---------------------------------------------------------------------------
154 
156 
157  virtual void initialSolve() = 0;
159 
165  virtual void resolve() = 0;
166 
168  virtual void branchAndBound() = 0;
169 
170 #ifdef CBC_NEXT_VERSION
171  /*
172  Would it make sense to collect all of these routines in a `MIP Helper'
173  section? It'd make it easier for users and implementors to find them.
174  */
192  virtual int solveBranches(int depth,const OsiSolverBranch * branch,
193  OsiSolverResult * result,
194  int & numberSolves, int & numberIterations,
195  bool forceBranch=false);
196 #endif
197 
198 
199  //---------------------------------------------------------------------------
257  virtual bool setIntParam(OsiIntParam key, int value) {
259  if (key == OsiLastIntParam) return (false) ;
260  intParam_[key] = value;
261  return true;
262  }
264  virtual bool setDblParam(OsiDblParam key, double value) {
265  if (key == OsiLastDblParam) return (false) ;
266  dblParam_[key] = value;
267  return true;
268  }
270  virtual bool setStrParam(OsiStrParam key, const std::string & value) {
271  if (key == OsiLastStrParam) return (false) ;
272  strParam_[key] = value;
273  return true;
274  }
286  virtual bool setHintParam(OsiHintParam key, bool yesNo=true,
287  OsiHintStrength strength=OsiHintTry,
288  void *otherInformation = NULL) {
289  if (key==OsiLastHintParam)
290  return false;
291  hintParam_[key] = yesNo;
292  hintStrength_[key] = strength;
293  if (strength == OsiForceDo)
294  throw CoinError("OsiForceDo illegal",
295  "setHintParam", "OsiSolverInterface");
296  return true;
297  }
299  virtual bool getIntParam(OsiIntParam key, int& value) const {
300  if (key == OsiLastIntParam) return (false) ;
301  value = intParam_[key];
302  return true;
303  }
305  virtual bool getDblParam(OsiDblParam key, double& value) const {
306  if (key == OsiLastDblParam) return (false) ;
307  value = dblParam_[key];
308  return true;
309  }
311  virtual bool getStrParam(OsiStrParam key, std::string& value) const {
312  if (key == OsiLastStrParam) return (false) ;
313  value = strParam_[key];
314  return true;
315  }
325  virtual bool getHintParam(OsiHintParam key, bool& yesNo,
326  OsiHintStrength& strength,
327  void *& otherInformation) const {
328  if (key==OsiLastHintParam)
329  return false;
330  yesNo = hintParam_[key];
331  strength = hintStrength_[key];
332  otherInformation=NULL;
333  return true;
334  }
339  virtual bool getHintParam(OsiHintParam key, bool& yesNo,
340  OsiHintStrength& strength) const {
341  if (key==OsiLastHintParam)
342  return false;
343  yesNo = hintParam_[key];
344  strength = hintStrength_[key];
345  return true;
346  }
351  virtual bool getHintParam(OsiHintParam key, bool& yesNo) const {
352  if (key==OsiLastHintParam)
353  return false;
354  yesNo = hintParam_[key];
355  return true;
356  }
364 
378  inline double getIntegerTolerance() const
379  { return dblParam_[OsiPrimalTolerance];}
381 
382  //---------------------------------------------------------------------------
384 
385  virtual bool isAbandoned() const = 0;
388  virtual bool isProvenOptimal() const = 0;
390  virtual bool isProvenPrimalInfeasible() const = 0;
392  virtual bool isProvenDualInfeasible() const = 0;
394  virtual bool isPrimalObjectiveLimitReached() const = 0;
396  virtual bool isDualObjectiveLimitReached() const = 0;
398  virtual bool isIterationLimitReached() const = 0;
400 
401  //---------------------------------------------------------------------------
419  virtual CoinWarmStart *getEmptyWarmStart () const = 0 ;
420 
427  virtual CoinWarmStart* getWarmStart() const = 0;
436  virtual CoinWarmStart* getPointerToWarmStart(bool & mustDelete) ;
437 
446  virtual bool setWarmStart(const CoinWarmStart* warmstart) = 0;
448 
449  //---------------------------------------------------------------------------
470  virtual void markHotStart();
473  virtual void solveFromHotStart();
475  virtual void unmarkHotStart();
477 
478  //---------------------------------------------------------------------------
489  virtual int getNumCols() const = 0;
491 
493  virtual int getNumRows() const = 0;
494 
496  virtual int getNumElements() const = 0;
497 
499  virtual int getNumIntegers() const ;
500 
502  virtual const double * getColLower() const = 0;
503 
505  virtual const double * getColUpper() const = 0;
506 
516  virtual const char * getRowSense() const = 0;
517 
530  virtual const double * getRightHandSide() const = 0;
531 
540  virtual const double * getRowRange() const = 0;
541 
543  virtual const double * getRowLower() const = 0;
544 
546  virtual const double * getRowUpper() const = 0;
547 
549  virtual const double * getObjCoefficients() const = 0;
550 
552  virtual double getObjSense() const = 0;
553 
555  virtual bool isContinuous(int colIndex) const = 0;
556 
558  virtual bool isBinary(int colIndex) const;
559 
564  virtual bool isInteger(int colIndex) const;
565 
567  virtual bool isIntegerNonBinary(int colIndex) const;
568 
570  virtual bool isFreeBinary(int colIndex) const;
577  inline const char * columnType(bool refresh=false) const
578  { return getColType(refresh);}
584  virtual const char * getColType(bool refresh=false) const;
585 
587  virtual const CoinPackedMatrix * getMatrixByRow() const = 0;
588 
590  virtual const CoinPackedMatrix * getMatrixByCol() const = 0;
591 
593  virtual CoinPackedMatrix * getMutableMatrixByRow() const {return NULL;}
594 
596  virtual CoinPackedMatrix * getMutableMatrixByCol() const {return NULL;}
597 
599  virtual double getInfinity() const = 0;
601 
604  virtual const double * getColSolution() const = 0;
606 
610  const double * getStrictColSolution();
611 
613  virtual const double * getRowPrice() const = 0;
614 
616  virtual const double * getReducedCost() const = 0;
617 
620  virtual const double * getRowActivity() const = 0;
621 
623  virtual double getObjValue() const = 0;
624 
627  virtual int getIterationCount() const = 0;
628 
642  virtual std::vector<double*> getDualRays(int maxNumRays) const = 0;
654  virtual std::vector<double*> getPrimalRays(int maxNumRays) const = 0;
655 
658  virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
659  const;
661 
662  //-------------------------------------------------------------------------
675  virtual void setObjCoeff( int elementIndex, double elementValue ) = 0;
676 
678  virtual void setObjCoeffSet(const int* indexFirst,
679  const int* indexLast,
680  const double* coeffList);
681 
687  virtual void setObjective(const double * array);
688 
699  virtual void setObjSense(double s) = 0;
700 
701 
704  virtual void setColLower( int elementIndex, double elementValue ) = 0;
705 
711  virtual void setColLower(const double * array);
712 
715  virtual void setColUpper( int elementIndex, double elementValue ) = 0;
716 
722  virtual void setColUpper(const double * array);
723 
724 
728  virtual void setColBounds( int elementIndex,
729  double lower, double upper ) {
730  setColLower(elementIndex, lower);
731  setColUpper(elementIndex, upper);
732  }
733 
740  virtual void setColSetBounds(const int* indexFirst,
741  const int* indexLast,
742  const double* boundList);
743 
746  virtual void setRowLower( int elementIndex, double elementValue ) = 0;
747 
750  virtual void setRowUpper( int elementIndex, double elementValue ) = 0;
751 
755  virtual void setRowBounds( int elementIndex,
756  double lower, double upper ) {
757  setRowLower(elementIndex, lower);
758  setRowUpper(elementIndex, upper);
759  }
760 
767  virtual void setRowSetBounds(const int* indexFirst,
768  const int* indexLast,
769  const double* boundList);
770 
771 
773  virtual void setRowType(int index, char sense, double rightHandSide,
774  double range) = 0;
775 
780  virtual void setRowSetTypes(const int* indexFirst,
781  const int* indexLast,
782  const char* senseList,
783  const double* rhsList,
784  const double* rangeList);
785 
795  virtual void setColSolution(const double *colsol) = 0;
796 
806  virtual void setRowPrice(const double * rowprice) = 0;
807 
816  virtual int reducedCostFix(double gap, bool justInteger=true);
818 
819  //-------------------------------------------------------------------------
823  virtual void setContinuous(int index) = 0;
825  virtual void setInteger(int index) = 0;
828  virtual void setContinuous(const int* indices, int len);
831  virtual void setInteger(const int* indices, int len);
833  //-------------------------------------------------------------------------
834 
835  //-------------------------------------------------------------------------
836 
838  typedef std::vector<std::string> OsiNameVec ;
839 
860 
870  virtual std::string dfltRowColName(char rc,
871  int ndx, unsigned digits = 7) const ;
872 
875  virtual std::string getObjName (unsigned maxLen = static_cast<unsigned>(std::string::npos)) const ;
876 
879  virtual inline void setObjName (std::string name)
880  { objName_ = name ; }
881 
888  virtual std::string getRowName(int rowIndex,
889  unsigned maxLen = static_cast<unsigned>(std::string::npos)) const ;
890 
902  virtual const OsiNameVec &getRowNames() ;
903 
909  virtual void setRowName(int ndx, std::string name) ;
910 
917  virtual void setRowNames(OsiNameVec &srcNames,
918  int srcStart, int len, int tgtStart) ;
919 
925  virtual void deleteRowNames(int tgtStart, int len) ;
926 
933  virtual std::string getColName(int colIndex,
934  unsigned maxLen = static_cast<unsigned>(std::string::npos)) const ;
935 
945  virtual const OsiNameVec &getColNames() ;
946 
952  virtual void setColName(int ndx, std::string name) ;
953 
960  virtual void setColNames(OsiNameVec &srcNames,
961  int srcStart, int len, int tgtStart) ;
962 
968  virtual void deleteColNames(int tgtStart, int len) ;
969 
970 
977  void setRowColNames(const CoinMpsIO &mps) ;
978 
984  void setRowColNames(CoinModel &mod) ;
985 
992  void setRowColNames(CoinLpIO &mod) ;
993 
995  //-------------------------------------------------------------------------
996 
997  //-------------------------------------------------------------------------
1003 
1005  virtual void addCol(const CoinPackedVectorBase& vec,
1006  const double collb, const double colub,
1007  const double obj) = 0;
1008 
1014  virtual void addCol(const CoinPackedVectorBase& vec,
1015  const double collb, const double colub,
1016  const double obj, std::string name) ;
1017 
1019  virtual void addCol(int numberElements,
1020  const int* rows, const double* elements,
1021  const double collb, const double colub,
1022  const double obj) ;
1023 
1029  virtual void addCol(int numberElements,
1030  const int* rows, const double* elements,
1031  const double collb, const double colub,
1032  const double obj, std::string name) ;
1033 
1039  virtual void addCols(const int numcols,
1040  const CoinPackedVectorBase * const * cols,
1041  const double* collb, const double* colub,
1042  const double* obj);
1043 
1049  virtual void addCols(const int numcols, const int* columnStarts,
1050  const int* rows, const double* elements,
1051  const double* collb, const double* colub,
1052  const double* obj);
1053 
1055  void addCols(const CoinBuild & buildObject);
1056 
1062  int addCols(CoinModel & modelObject);
1063 
1064 #if 0
1065 
1066  virtual void addCols(const CoinPackedMatrix& matrix,
1067  const double* collb, const double* colub,
1068  const double* obj);
1069 #endif
1070 
1077  virtual void deleteCols(const int num, const int * colIndices) = 0;
1078 
1080  virtual void addRow(const CoinPackedVectorBase& vec,
1081  const double rowlb, const double rowub) = 0;
1082 
1088  virtual void addRow(const CoinPackedVectorBase& vec,
1089  const double rowlb, const double rowub,
1090  std::string name) ;
1091 
1093  virtual void addRow(const CoinPackedVectorBase& vec,
1094  const char rowsen, const double rowrhs,
1095  const double rowrng) = 0;
1096 
1102  virtual void addRow(const CoinPackedVectorBase& vec,
1103  const char rowsen, const double rowrhs,
1104  const double rowrng, std::string name) ;
1105 
1110  virtual void addRow(int numberElements,
1111  const int *columns, const double *element,
1112  const double rowlb, const double rowub) ;
1113 
1119  virtual void addRows(const int numrows,
1120  const CoinPackedVectorBase * const * rows,
1121  const double* rowlb, const double* rowub);
1122 
1128  virtual void addRows(const int numrows,
1129  const CoinPackedVectorBase * const * rows,
1130  const char* rowsen, const double* rowrhs,
1131  const double* rowrng);
1132 
1138  virtual void addRows(const int numrows, const int *rowStarts,
1139  const int *columns, const double *element,
1140  const double *rowlb, const double *rowub);
1141 
1143  void addRows(const CoinBuild &buildObject);
1144 
1153  int addRows(CoinModel &modelObject);
1154 
1155 #if 0
1156 
1157  virtual void addRows(const CoinPackedMatrix& matrix,
1158  const double* rowlb, const double* rowub);
1160  virtual void addRows(const CoinPackedMatrix& matrix,
1161  const char* rowsen, const double* rowrhs,
1162  const double* rowrng);
1163 #endif
1164 
1170  virtual void deleteRows(const int num, const int * rowIndices) = 0;
1171 
1174  virtual void saveBaseModel() {}
1178  virtual void restoreBaseModel(int numberRows);
1179  //-----------------------------------------------------------------------
1202  virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
1203  double effectivenessLb = 0.0);
1204 
1209  virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts);
1210 
1214  virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts);
1215 
1217  void deleteBranchingInfo(int numberDeleted, const int * which);
1218 
1220 
1221  //---------------------------------------------------------------------------
1222 
1240  virtual void loadProblem (const CoinPackedMatrix& matrix,
1241  const double* collb, const double* colub,
1242  const double* obj,
1243  const double* rowlb, const double* rowub) = 0;
1244 
1254  virtual void assignProblem (CoinPackedMatrix*& matrix,
1255  double*& collb, double*& colub, double*& obj,
1256  double*& rowlb, double*& rowub) = 0;
1257 
1274  virtual void loadProblem (const CoinPackedMatrix& matrix,
1275  const double* collb, const double* colub,
1276  const double* obj,
1277  const char* rowsen, const double* rowrhs,
1278  const double* rowrng) = 0;
1279 
1289  virtual void assignProblem (CoinPackedMatrix*& matrix,
1290  double*& collb, double*& colub, double*& obj,
1291  char*& rowsen, double*& rowrhs,
1292  double*& rowrng) = 0;
1293 
1306  virtual void loadProblem (const int numcols, const int numrows,
1307  const CoinBigIndex * start, const int* index,
1308  const double* value,
1309  const double* collb, const double* colub,
1310  const double* obj,
1311  const double* rowlb, const double* rowub) = 0;
1312 
1325  virtual void loadProblem (const int numcols, const int numrows,
1326  const CoinBigIndex * start, const int* index,
1327  const double* value,
1328  const double* collb, const double* colub,
1329  const double* obj,
1330  const char* rowsen, const double* rowrhs,
1331  const double* rowrng) = 0;
1332 
1339  virtual int loadFromCoinModel (CoinModel & modelObject,
1340  bool keepSolution=false);
1341 
1347  virtual int readMps (const char *filename,
1348  const char *extension = "mps") ;
1349 
1356  virtual int readMps (const char *filename, const char*extension,
1357  int & numberSets, CoinSet ** & sets);
1358 
1364  virtual int readGMPL (const char *filename, const char *dataname=NULL);
1365 
1372  virtual void writeMps (const char *filename,
1373  const char *extension = "mps",
1374  double objSense=0.0) const = 0;
1375 
1389  int writeMpsNative (const char *filename,
1390  const char ** rowNames, const char ** columnNames,
1391  int formatType=0,int numberAcross=2,
1392  double objSense=0.0, int numberSOS=0,
1393  const CoinSet * setInfo=NULL) const ;
1394 
1395 /***********************************************************************/
1396 // Lp files
1397 
1417  virtual void writeLp(const char *filename,
1418  const char *extension = "lp",
1419  double epsilon = 1e-5,
1420  int numberAcross = 10,
1421  int decimals = 5,
1422  double objSense = 0.0,
1423  bool useRowNames = true) const;
1424 
1429  virtual void writeLp(FILE *fp,
1430  double epsilon = 1e-5,
1431  int numberAcross = 10,
1432  int decimals = 5,
1433  double objSense = 0.0,
1434  bool useRowNames = true) const;
1435 
1454  int writeLpNative(const char *filename,
1455  char const * const * const rowNames,
1456  char const * const * const columnNames,
1457  const double epsilon = 1.0e-5,
1458  const int numberAcross = 10,
1459  const int decimals = 5,
1460  const double objSense = 0.0,
1461  const bool useRowNames = true) const;
1462 
1467  int writeLpNative(FILE *fp,
1468  char const * const * const rowNames,
1469  char const * const * const columnNames,
1470  const double epsilon = 1.0e-5,
1471  const int numberAcross = 10,
1472  const int decimals = 5,
1473  const double objSense = 0.0,
1474  const bool useRowNames = true) const;
1475 
1478  virtual int readLp(const char *filename, const double epsilon = 1e-5);
1479 
1482  int readLp(FILE *fp, const double epsilon = 1e-5);
1483 
1489  virtual void replaceMatrixOptional(const CoinPackedMatrix & ) {}
1491  virtual void replaceMatrix(const CoinPackedMatrix & ) {abort();}
1493 
1494  //---------------------------------------------------------------------------
1495 
1498 #ifdef COIN_SNAPSHOT
1499  virtual CoinSnapshot * snapshot(bool createArrays=true) const;
1501 #endif
1502 #ifdef COIN_FACTORIZATION_INFO
1503  virtual CoinBigIndex getSizeL() const;
1506  virtual CoinBigIndex getSizeU() const;
1507 #endif
1508 
1509 
1510  //---------------------------------------------------------------------------
1511 
1521  void setApplicationData (void * appData);
1528  void setAuxiliaryInfo(OsiAuxInfo * auxiliaryInfo);
1529 
1531  void * getApplicationData() const;
1533  OsiAuxInfo * getAuxiliaryInfo() const;
1535  //---------------------------------------------------------------------------
1536 
1550  virtual void passInMessageHandler(CoinMessageHandler * handler);
1552  void newLanguage(CoinMessages::Language language);
1553  inline void setLanguage(CoinMessages::Language language)
1554  {newLanguage(language);}
1556  inline CoinMessageHandler * messageHandler() const
1557  {return handler_;}
1559  inline CoinMessages messages()
1560  {return messages_;}
1562  inline CoinMessages * messagesPointer()
1563  {return &messages_;}
1565  inline bool defaultHandler() const
1566  { return defaultHandler_;}
1568  //---------------------------------------------------------------------------
1583  void findIntegers(bool justCount);
1594  virtual int findIntegersAndSOS(bool justCount);
1596  inline int numberObjects() const { return numberObjects_;}
1598  inline void setNumberObjects(int number)
1599  { numberObjects_=number;}
1600 
1602  inline OsiObject ** objects() const { return object_;}
1603 
1605  const inline OsiObject * object(int which) const { return object_[which];}
1607  inline OsiObject * modifiableObject(int which) const { return object_[which];}
1608 
1610  void deleteObjects();
1611 
1616  void addObjects(int numberObjects, OsiObject ** objects);
1621  double forceFeasible();
1623  //---------------------------------------------------------------------------
1624 
1633  virtual void activateRowCutDebugger (const char * modelName);
1634 
1640  virtual void activateRowCutDebugger( const double * solution);
1650  const OsiRowCutDebugger * getRowCutDebugger() const;
1653 
1655 
1664 public:
1666 
1667 
1670  virtual int canDoSimplexInterface() const;
1677  virtual void enableSimplexInterface(bool doingPrimal) ;
1678 
1680  virtual void disableSimplexInterface() ;
1681 
1688  virtual void enableFactorization() const;
1690  virtual void disableFactorization() const;
1691 
1696  virtual bool basisIsAvailable() const ;
1698  inline bool optimalBasisIsAvailable() const
1699  { return basisIsAvailable();}
1700 
1713  virtual void getBasisStatus(int* cstat, int* rstat) const ;
1714 
1721  virtual int setBasisStatus(const int* cstat, const int* rstat) ;
1722 
1730  virtual int pivot(int colIn, int colOut, int outStatus) ;
1731 
1743  virtual int primalPivotResult(int colIn, int sign,
1744  int& colOut, int& outStatus,
1745  double& t, CoinPackedVector* dx);
1746 
1753  virtual int dualPivotResult(int& colIn, int& sign,
1754  int colOut, int outStatus,
1755  double& t, CoinPackedVector* dx) ;
1756 
1758  virtual void getReducedGradient(double* columnReducedCosts,
1759  double * duals,
1760  const double * c) ;
1761 
1764  virtual void setObjectiveAndRefresh(double* c) ;
1765 
1767  virtual void getBInvARow(int row, double* z, double * slack=NULL) const ;
1768 
1770  virtual void getBInvRow(int row, double* z) const ;
1771 
1773  virtual void getBInvACol(int col, double* vec) const ;
1774 
1776  virtual void getBInvCol(int col, double* vec) const ;
1777 
1782  virtual void getBasics(int* index) const ;
1784 
1785  //---------------------------------------------------------------------------
1786 
1788 
1789  OsiSolverInterface();
1791 
1797  virtual OsiSolverInterface * clone(bool copyData = true) const = 0;
1798 
1801 
1804 
1806  virtual ~OsiSolverInterface ();
1807 
1814  virtual void reset();
1816 
1817  //---------------------------------------------------------------------------
1818 
1819 protected:
1821 
1822 
1823  virtual void applyRowCut( const OsiRowCut & rc ) = 0;
1824 
1826  virtual void applyColCut( const OsiColCut & cc ) = 0;
1827 
1830  inline void
1831  convertBoundToSense(const double lower, const double upper,
1832  char& sense, double& right, double& range) const;
1835  inline void
1836  convertSenseToBound(const char sense, const double right,
1837  const double range,
1838  double& lower, double& upper) const;
1841  template <class T> inline T
1842  forceIntoRange(const T value, const T lower, const T upper) const {
1843  return value < lower ? lower : (value > upper ? upper : value);
1844  }
1851  void setInitialData();
1853 
1855 
1858  // Why not just make useful stuff protected?
1860  CoinMessageHandler * handler_;
1868  CoinMessages messages_;
1873 
1881  mutable char * columnType_;
1882 
1884 
1885  //---------------------------------------------------------------------------
1886 
1887 private:
1889 
1904  CoinWarmStart* ws_;
1906  std::vector<double> strictColSolution_;
1907 
1913  std::string objName_ ;
1914 
1916 };
1917 
1918 //#############################################################################
1926 int
1928  const OsiSolverInterface* emptySi,
1929  const std::string & mpsDir,
1930  const std::string & netlibDir);
1931 
1932 //#############################################################################
1935 int
1937  const std::vector<OsiSolverInterface*> & vecSiP,
1938  const std::string & mpsDir);
1939 
1940 //#############################################################################
1943 inline void
1944 OsiSolverInterface::convertBoundToSense(const double lower, const double upper,
1945  char& sense, double& right,
1946  double& range) const
1947 {
1948  double inf = getInfinity();
1949  range = 0.0;
1950  if (lower > -inf) {
1951  if (upper < inf) {
1952  right = upper;
1953  if (upper==lower) {
1954  sense = 'E';
1955  } else {
1956  sense = 'R';
1957  range = upper - lower;
1958  }
1959  } else {
1960  sense = 'G';
1961  right = lower;
1962  }
1963  } else {
1964  if (upper < inf) {
1965  sense = 'L';
1966  right = upper;
1967  } else {
1968  sense = 'N';
1969  right = 0.0;
1970  }
1971  }
1972 }
1973 
1974 //-----------------------------------------------------------------------------
1977 inline void
1978 OsiSolverInterface::convertSenseToBound(const char sense, const double right,
1979  const double range,
1980  double& lower, double& upper) const
1981 {
1982  double inf=getInfinity();
1983  switch (sense) {
1984  case 'E':
1985  lower = upper = right;
1986  break;
1987  case 'L':
1988  lower = -inf;
1989  upper = right;
1990  break;
1991  case 'G':
1992  lower = right;
1993  upper = inf;
1994  break;
1995  case 'R':
1996  lower = right - range;
1997  upper = right;
1998  break;
1999  case 'N':
2000  lower = -inf;
2001  upper = inf;
2002  break;
2003  }
2004 }
2005 
2006 #endif