Osi 0.108.9
Loading...
Searching...
No Matches
OsiSolverInterface.hpp
Go to the documentation of this file.
1// Copyright (C) 2000, International Business Machines
2// Corporation and others. All Rights Reserved.
3// This code is licensed under the terms of the Eclipse Public License (EPL).
4
5#ifndef OsiSolverInterface_H
6#define OsiSolverInterface_H
7
8#include <cstdlib>
9#include <string>
10#include <vector>
11
12#include "CoinTypes.hpp"
13#include "CoinMessageHandler.hpp"
14#include "CoinPackedVectorBase.hpp"
15#include "CoinPackedMatrix.hpp"
16#include "CoinWarmStart.hpp"
17#include "CoinFinite.hpp"
18#include "CoinError.hpp"
19
20#include "OsiCollections.hpp"
22
23class CoinSnapshot;
24class CoinLpIO;
25class CoinMpsIO;
26
27class OsiCuts;
28class OsiAuxInfo;
29class OsiRowCut;
31class CoinSet;
32class CoinBuild;
33class CoinModel;
34class OsiSolverBranch;
35class OsiSolverResult;
36class OsiObject;
37
38//#############################################################################
39
63 const OsiSolverInterface *emptySi,
64 const std::string &mpsDir,
65 const std::string &netlibDir);
67 const std::vector< OsiSolverInterface * > &vecSiP,
68 const std::string &mpsDir);
69
70public:
73 friend class OsiSolverInterface;
76
77 public:
79
80
84 , infeasible_(0)
85 , ineffective_(0)
86 , applied_(0)
87 {
88 }
100 {
101 if (this != &rhs) {
106 applied_ = rhs.applied_;
107 }
108 return *this;
109 }
113
117 inline int getNumInconsistent() const
118 {
119 return intInconsistent_;
120 }
123 {
124 return extInconsistent_;
125 }
127 inline int getNumInfeasible() const
128 {
129 return infeasible_;
130 }
132 inline int getNumIneffective() const
133 {
134 return ineffective_;
135 }
137 inline int getNumApplied() const
138 {
139 return applied_;
140 }
142
143 private:
151 inline void incrementInfeasible() { infeasible_++; }
155 inline void incrementApplied() { applied_++; }
157
159
160
171 };
172
173 //---------------------------------------------------------------------------
174
176
177
178 virtual void initialSolve() = 0;
179
185 virtual void resolve() = 0;
186
188 virtual void branchAndBound() = 0;
189
190#ifdef CBC_NEXT_VERSION
191 /*
192 Would it make sense to collect all of these routines in a `MIP Helper'
193 section? It'd make it easier for users and implementors to find them.
194 */
212 virtual int solveBranches(int depth, const OsiSolverBranch *branch,
213 OsiSolverResult *result,
214 int &numberSolves, int &numberIterations,
215 bool forceBranch = false);
216#endif
218
219 //---------------------------------------------------------------------------
277
278 virtual bool setIntParam(OsiIntParam key, int value)
279 {
280 if (key == OsiLastIntParam)
281 return (false);
282 intParam_[key] = value;
283 return true;
284 }
286 virtual bool setDblParam(OsiDblParam key, double value)
287 {
288 if (key == OsiLastDblParam)
289 return (false);
290 dblParam_[key] = value;
291 return true;
292 }
294 virtual bool setStrParam(OsiStrParam key, const std::string &value)
295 {
296 if (key == OsiLastStrParam)
297 return (false);
298 strParam_[key] = value;
299 return true;
300 }
312 virtual bool setHintParam(OsiHintParam key, bool yesNo = true,
313 OsiHintStrength strength = OsiHintTry,
314 void * /*otherInformation*/ = NULL)
315 {
316 if (key == OsiLastHintParam)
317 return false;
318 hintParam_[key] = yesNo;
319 hintStrength_[key] = strength;
320 if (strength == OsiForceDo)
321 throw CoinError("OsiForceDo illegal",
322 "setHintParam", "OsiSolverInterface");
323 return true;
324 }
326 virtual bool getIntParam(OsiIntParam key, int &value) const
327 {
328 if (key == OsiLastIntParam)
329 return (false);
330 value = intParam_[key];
331 return true;
332 }
334 virtual bool getDblParam(OsiDblParam key, double &value) const
335 {
336 if (key == OsiLastDblParam)
337 return (false);
338 value = dblParam_[key];
339 return true;
340 }
342 virtual bool getStrParam(OsiStrParam key, std::string &value) const
343 {
344 if (key == OsiLastStrParam)
345 return (false);
346 value = strParam_[key];
347 return true;
348 }
358 virtual bool getHintParam(OsiHintParam key, bool &yesNo,
359 OsiHintStrength &strength,
360 void *&otherInformation) const
361 {
362 if (key == OsiLastHintParam)
363 return false;
364 yesNo = hintParam_[key];
365 strength = hintStrength_[key];
366 otherInformation = NULL;
367 return true;
368 }
373 virtual bool getHintParam(OsiHintParam key, bool &yesNo,
374 OsiHintStrength &strength) const
375 {
376 if (key == OsiLastHintParam)
377 return false;
378 yesNo = hintParam_[key];
379 strength = hintStrength_[key];
380 return true;
381 }
386 virtual bool getHintParam(OsiHintParam key, bool &yesNo) const
387 {
388 if (key == OsiLastHintParam)
389 return false;
390 yesNo = hintParam_[key];
391 return true;
392 }
400
414 inline double getIntegerTolerance() const
415 {
417 }
419
420 //---------------------------------------------------------------------------
422
423
424 virtual bool isAbandoned() const = 0;
426 virtual bool isProvenOptimal() const = 0;
428 virtual bool isProvenPrimalInfeasible() const = 0;
430 virtual bool isProvenDualInfeasible() const = 0;
432 virtual bool isPrimalObjectiveLimitReached() const;
434 virtual bool isDualObjectiveLimitReached() const;
436 virtual bool isIterationLimitReached() const = 0;
438
439 //---------------------------------------------------------------------------
457 virtual CoinWarmStart *getEmptyWarmStart() const = 0;
458
465 virtual CoinWarmStart *getWarmStart() const = 0;
474 virtual CoinWarmStart *getPointerToWarmStart(bool &mustDelete);
475
484 virtual bool setWarmStart(const CoinWarmStart *warmstart) = 0;
486
487 //---------------------------------------------------------------------------
508
509 virtual void markHotStart();
511 virtual void solveFromHotStart();
513 virtual void unmarkHotStart();
515
516 //---------------------------------------------------------------------------
527
528 virtual int getNumCols() const = 0;
529
531 virtual int getNumRows() const = 0;
532
534 virtual CoinBigIndex getNumElements() const = 0;
535
537 virtual int getNumIntegers() const;
538
540 virtual const double *getColLower() const = 0;
541
543 virtual const double *getColUpper() const = 0;
544
555 virtual const char *getRowSense() const = 0;
556
570 virtual const double *getRightHandSide() const = 0;
571
581 virtual const double *getRowRange() const = 0;
582
584 virtual const double *getRowLower() const = 0;
585
587 virtual const double *getRowUpper() const = 0;
588
592 virtual const double *getObjCoefficients() const = 0;
593
599 virtual double getObjSense() const = 0;
600
602 virtual bool isContinuous(int colIndex) const = 0;
603
605 virtual bool isBinary(int colIndex) const;
606
611 virtual bool isInteger(int colIndex) const;
612
614 virtual bool isIntegerNonBinary(int colIndex) const;
615
617 virtual bool isFreeBinary(int colIndex) const;
618
623 inline const char *columnType(bool refresh = false) const
624 {
625 return getColType(refresh);
626 }
627
629 inline void setColumnType(int iColumn, char type)
630 {
631 if (!columnType_)
632 getColType(true);
633 columnType_[iColumn] = type;
634 }
635
649 virtual const char *getColType(bool refresh = false) const;
650
652 virtual const CoinPackedMatrix *getMatrixByRow() const = 0;
653
655 virtual const CoinPackedMatrix *getMatrixByCol() const = 0;
656
662 virtual CoinPackedMatrix *getMutableMatrixByRow() const { return NULL; }
663
669 virtual CoinPackedMatrix *getMutableMatrixByCol() const { return NULL; }
670
672 virtual double getInfinity() const = 0;
674
678 virtual const double *getColSolution() const = 0;
679
683 virtual const double *getStrictColSolution();
684
686 virtual const double *getRowPrice() const = 0;
687
689 virtual const double *getReducedCost() const = 0;
690
696 virtual const double *getRowActivity() const = 0;
697
699 virtual double getObjValue() const = 0;
700
704 virtual int getIterationCount() const = 0;
705
728 virtual std::vector< double * > getDualRays(int maxNumRays,
729 bool fullRay = false) const = 0;
730
746 virtual std::vector< double * > getPrimalRays(int maxNumRays) const = 0;
747
750 virtual OsiVectorInt getFractionalIndices(const double etol = 1.e-05)
751 const;
753
754 //-------------------------------------------------------------------------
767 virtual void setObjCoeff(int elementIndex, double elementValue) = 0;
768
770 virtual void setObjCoeffSet(const int *indexFirst,
771 const int *indexLast,
772 const double *coeffList);
773
779 virtual void setObjective(const double *array);
780
791 virtual void setObjSense(double s) = 0;
792
795 virtual void setColLower(int elementIndex, double elementValue) = 0;
796
802 virtual void setColLower(const double *array);
803
806 virtual void setColUpper(int elementIndex, double elementValue) = 0;
807
813 virtual void setColUpper(const double *array);
814
818 virtual void setColBounds(int elementIndex,
819 double lower, double upper)
820 {
821 setColLower(elementIndex, lower);
822 setColUpper(elementIndex, upper);
823 }
824
831 virtual void setColSetBounds(const int *indexFirst,
832 const int *indexLast,
833 const double *boundList);
834
837 virtual void setRowLower(int elementIndex, double elementValue) = 0;
838
841 virtual void setRowUpper(int elementIndex, double elementValue) = 0;
842
846 virtual void setRowBounds(int elementIndex,
847 double lower, double upper)
848 {
849 setRowLower(elementIndex, lower);
850 setRowUpper(elementIndex, upper);
851 }
852
859 virtual void setRowSetBounds(const int *indexFirst,
860 const int *indexLast,
861 const double *boundList);
862
864 virtual void setRowType(int index, char sense, double rightHandSide,
865 double range)
866 = 0;
867
872 virtual void setRowSetTypes(const int *indexFirst,
873 const int *indexLast,
874 const char *senseList,
875 const double *rhsList,
876 const double *rangeList);
877
887 virtual void setColSolution(const double *colsol) = 0;
888
898 virtual void setRowPrice(const double *rowprice) = 0;
899
908 virtual int reducedCostFix(double gap, bool justInteger = true);
910
911 //-------------------------------------------------------------------------
915 virtual void setContinuous(int index) = 0;
917 virtual void setInteger(int index) = 0;
920 virtual void setContinuous(const int *indices, int len);
923 virtual void setInteger(const int *indices, int len);
925 //-------------------------------------------------------------------------
926
927 //-------------------------------------------------------------------------
928
930 typedef std::vector< std::string > OsiNameVec;
931
952
962 virtual std::string dfltRowColName(char rc,
963 int ndx, unsigned digits = 7) const;
964
967 virtual std::string getObjName(unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
968
971 virtual inline void setObjName(std::string name)
972 {
973 objName_ = name;
974 }
975
982 virtual std::string getRowName(int rowIndex,
983 unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
984
996 virtual const OsiNameVec &getRowNames();
997
1003 virtual void setRowName(int ndx, std::string name);
1004
1011 virtual void setRowNames(OsiNameVec &srcNames,
1012 int srcStart, int len, int tgtStart);
1013
1019 virtual void deleteRowNames(int tgtStart, int len);
1020
1027 virtual std::string getColName(int colIndex,
1028 unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
1029
1039 virtual const OsiNameVec &getColNames();
1040
1046 virtual void setColName(int ndx, std::string name);
1047
1054 virtual void setColNames(OsiNameVec &srcNames,
1055 int srcStart, int len, int tgtStart);
1056
1062 virtual void deleteColNames(int tgtStart, int len);
1063
1070 void setRowColNames(const CoinMpsIO &mps);
1071
1077 void setRowColNames(CoinModel &mod);
1078
1085 void setRowColNames(CoinLpIO &mod);
1086
1088 //-------------------------------------------------------------------------
1089
1090 //-------------------------------------------------------------------------
1096
1098 virtual void addCol(const CoinPackedVectorBase &vec,
1099 const double collb, const double colub,
1100 const double obj)
1101 = 0;
1102
1108 virtual void addCol(const CoinPackedVectorBase &vec,
1109 const double collb, const double colub,
1110 const double obj, std::string name);
1111
1113 virtual void addCol(int numberElements,
1114 const int *rows, const double *elements,
1115 const double collb, const double colub,
1116 const double obj);
1117
1123 virtual void addCol(int numberElements,
1124 const int *rows, const double *elements,
1125 const double collb, const double colub,
1126 const double obj, std::string name);
1127
1133 virtual void addCols(const int numcols,
1134 const CoinPackedVectorBase *const *cols,
1135 const double *collb, const double *colub,
1136 const double *obj);
1137
1143 virtual void addCols(const int numcols, const CoinBigIndex *columnStarts,
1144 const int *rows, const double *elements,
1145 const double *collb, const double *colub,
1146 const double *obj);
1147
1149 void addCols(const CoinBuild &buildObject);
1150
1156 int addCols(CoinModel &modelObject);
1157
1158#if 0
1160 virtual void addCols(const CoinPackedMatrix& matrix,
1161 const double* collb, const double* colub,
1162 const double* obj);
1163#endif
1164
1171 virtual void deleteCols(const int num, const int *colIndices) = 0;
1172
1174 virtual void addRow(const CoinPackedVectorBase &vec,
1175 const double rowlb, const double rowub)
1176 = 0;
1177
1183 virtual void addRow(const CoinPackedVectorBase &vec,
1184 const double rowlb, const double rowub,
1185 std::string name);
1186
1188 virtual void addRow(const CoinPackedVectorBase &vec,
1189 const char rowsen, const double rowrhs,
1190 const double rowrng)
1191 = 0;
1192
1198 virtual void addRow(const CoinPackedVectorBase &vec,
1199 const char rowsen, const double rowrhs,
1200 const double rowrng, std::string name);
1201
1206 virtual void addRow(int numberElements,
1207 const int *columns, const double *element,
1208 const double rowlb, const double rowub);
1209
1215 virtual void addRows(const int numrows,
1216 const CoinPackedVectorBase *const *rows,
1217 const double *rowlb, const double *rowub);
1218
1224 virtual void addRows(const int numrows,
1225 const CoinPackedVectorBase *const *rows,
1226 const char *rowsen, const double *rowrhs,
1227 const double *rowrng);
1228
1234 virtual void addRows(const int numrows, const CoinBigIndex *rowStarts,
1235 const int *columns, const double *element,
1236 const double *rowlb, const double *rowub);
1237
1239 void addRows(const CoinBuild &buildObject);
1240
1249 int addRows(CoinModel &modelObject);
1250
1251#if 0
1253 virtual void addRows(const CoinPackedMatrix& matrix,
1254 const double* rowlb, const double* rowub);
1256 virtual void addRows(const CoinPackedMatrix& matrix,
1257 const char* rowsen, const double* rowrhs,
1258 const double* rowrng);
1259#endif
1260
1266 virtual void deleteRows(const int num, const int *rowIndices) = 0;
1267
1274 virtual void replaceMatrixOptional(const CoinPackedMatrix &) {}
1275
1280 virtual void replaceMatrix(const CoinPackedMatrix &) { abort(); }
1281
1286 virtual void saveBaseModel() {}
1287
1301 virtual void restoreBaseModel(int numberRows);
1302 //-----------------------------------------------------------------------
1326 double effectivenessLb = 0.0);
1327
1332 virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts);
1333
1337 virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts);
1338
1340 void deleteBranchingInfo(int numberDeleted, const int *which);
1341
1343
1344 //---------------------------------------------------------------------------
1345
1363 virtual void loadProblem(const CoinPackedMatrix &matrix,
1364 const double *collb, const double *colub,
1365 const double *obj,
1366 const double *rowlb, const double *rowub)
1367 = 0;
1368
1378 virtual void assignProblem(CoinPackedMatrix *&matrix,
1379 double *&collb, double *&colub, double *&obj,
1380 double *&rowlb, double *&rowub)
1381 = 0;
1382
1399 virtual void loadProblem(const CoinPackedMatrix &matrix,
1400 const double *collb, const double *colub,
1401 const double *obj,
1402 const char *rowsen, const double *rowrhs,
1403 const double *rowrng)
1404 = 0;
1405
1415 virtual void assignProblem(CoinPackedMatrix *&matrix,
1416 double *&collb, double *&colub, double *&obj,
1417 char *&rowsen, double *&rowrhs,
1418 double *&rowrng)
1419 = 0;
1420
1433 virtual void loadProblem(const int numcols, const int numrows,
1434 const CoinBigIndex *start, const int *index,
1435 const double *value,
1436 const double *collb, const double *colub,
1437 const double *obj,
1438 const double *rowlb, const double *rowub)
1439 = 0;
1440
1453 virtual void loadProblem(const int numcols, const int numrows,
1454 const CoinBigIndex *start, const int *index,
1455 const double *value,
1456 const double *collb, const double *colub,
1457 const double *obj,
1458 const char *rowsen, const double *rowrhs,
1459 const double *rowrng)
1460 = 0;
1461
1468 virtual int loadFromCoinModel(CoinModel &modelObject,
1469 bool keepSolution = false);
1470
1476 virtual int readMps(const char *filename,
1477 const char *extension = "mps");
1478
1485 virtual int readMps(const char *filename, const char *extension,
1486 int &numberSets, CoinSet **&sets);
1487
1493 virtual int readGMPL(const char *filename, const char *dataname = NULL);
1494
1501 virtual void writeMps(const char *filename,
1502 const char *extension = "mps",
1503 double objSense = 0.0) const = 0;
1504
1518 int writeMpsNative(const char *filename,
1519 const char **rowNames, const char **columnNames,
1520 int formatType = 0, int numberAcross = 2,
1521 double objSense = 0.0, int numberSOS = 0,
1522 const CoinSet *setInfo = NULL) const;
1523
1524 /***********************************************************************/
1525 // Lp files
1526
1546 virtual void writeLp(const char *filename,
1547 const char *extension = "lp",
1548 double epsilon = 1e-5,
1549 int numberAcross = 10,
1550 int decimals = 9,
1551 double objSense = 0.0,
1552 bool useRowNames = true) const;
1553
1558 virtual void writeLp(FILE *fp,
1559 double epsilon = 1e-5,
1560 int numberAcross = 10,
1561 int decimals = 5,
1562 double objSense = 0.0,
1563 bool useRowNames = true) const;
1564
1583 int writeLpNative(const char *filename,
1584 char const *const *const rowNames,
1585 char const *const *const columnNames,
1586 const double epsilon = 1.0e-5,
1587 const int numberAcross = 10,
1588 const int decimals = 5,
1589 const double objSense = 0.0,
1590 const bool useRowNames = true) const;
1591
1596 int writeLpNative(FILE *fp,
1597 char const *const *const rowNames,
1598 char const *const *const columnNames,
1599 const double epsilon = 1.0e-5,
1600 const int numberAcross = 10,
1601 const int decimals = 5,
1602 const double objSense = 0.0,
1603 const bool useRowNames = true) const;
1604
1607 virtual int readLp(const char *filename, const double epsilon = 1e-5);
1608
1611 int readLp(FILE *fp, const double epsilon = 1e-5);
1612
1614
1615 //---------------------------------------------------------------------------
1616
1625 bool ignoreNames = true);
1630 void statistics(double &minimumNegative, double &maximumNegative,
1631 double &minimumPositive, double &maximumPositive,
1632 int type = 3) const;
1633#ifdef COIN_SNAPSHOT
1635 virtual CoinSnapshot *snapshot(bool createArrays = true) const;
1636#endif
1637#ifdef COIN_FACTORIZATION_INFO
1639 virtual CoinBigIndex getSizeL() const;
1641 virtual CoinBigIndex getSizeU() const;
1642#endif
1644
1645 //---------------------------------------------------------------------------
1646
1656 void setApplicationData(void *appData);
1663 void setAuxiliaryInfo(OsiAuxInfo *auxiliaryInfo);
1664
1666 void *getApplicationData() const;
1670 //---------------------------------------------------------------------------
1671
1685 virtual void passInMessageHandler(CoinMessageHandler *handler);
1687 void newLanguage(CoinMessages::Language language);
1688 inline void setLanguage(CoinMessages::Language language)
1689 {
1690 newLanguage(language);
1691 }
1693 inline CoinMessageHandler *messageHandler() const
1694 {
1695 return handler_;
1696 }
1698 inline CoinMessages messages()
1699 {
1700 return messages_;
1701 }
1703 inline CoinMessages *messagesPointer()
1704 {
1705 return &messages_;
1706 }
1708 inline bool defaultHandler() const
1709 {
1710 return defaultHandler_;
1711 }
1713 //---------------------------------------------------------------------------
1728 void findIntegers(bool justCount);
1739 virtual int findIntegersAndSOS(bool justCount);
1741 inline int numberObjects() const { return numberObjects_; }
1743 inline void setNumberObjects(int number)
1744 {
1745 numberObjects_ = number;
1746 }
1747
1749 inline OsiObject **objects() const { return object_; }
1750
1752 const inline OsiObject *object(int which) const { return object_[which]; }
1754 inline OsiObject *modifiableObject(int which) const { return object_[which]; }
1755
1758
1770 //---------------------------------------------------------------------------
1771
1783 virtual void activateRowCutDebugger(const char *modelName);
1784
1798 virtual void activateRowCutDebugger(const double *solution,
1799 bool enforceOptimality = true);
1800
1813
1823
1832
1843 virtual int canDoSimplexInterface() const;
1845
1853
1862 virtual void enableFactorization() const;
1863
1865 virtual void disableFactorization() const;
1866
1877 virtual bool basisIsAvailable() const;
1878
1880 inline bool optimalBasisIsAvailable() const { return basisIsAvailable(); }
1881
1905 virtual void getBasisStatus(int *cstat, int *rstat) const;
1906
1921 virtual int setBasisStatus(const int *cstat, const int *rstat);
1922
1928 virtual void getReducedGradient(double *columnReducedCosts,
1929 double *duals, const double *c) const;
1930
1936 virtual void getBInvARow(int row, double *z, double *slack = NULL) const;
1937
1939 virtual void getBInvRow(int row, double *z) const;
1940
1942 virtual void getBInvACol(int col, double *vec) const;
1943
1945 virtual void getBInvCol(int col, double *vec) const;
1946
1954 virtual void getBasics(int *index) const;
1955
1957
1965
1972 virtual void enableSimplexInterface(bool doingPrimal);
1973
1983 virtual int pivot(int colIn, int colOut, int outStatus);
1984
1996 virtual int primalPivotResult(int colIn, int sign,
1997 int &colOut, int &outStatus,
1998 double &t, CoinPackedVector *dx);
1999
2006 virtual int dualPivotResult(int &colIn, int &sign,
2007 int colOut, int outStatus,
2008 double &t, CoinPackedVector *dx);
2010
2011 //---------------------------------------------------------------------------
2012
2014
2015
2017
2023 virtual OsiSolverInterface *clone(bool copyData = true) const = 0;
2024
2027
2030
2033
2040 virtual void reset();
2042
2043 //---------------------------------------------------------------------------
2044
2045protected:
2047
2048
2049 virtual void applyRowCut(const OsiRowCut &rc) = 0;
2050
2052 virtual void applyColCut(const OsiColCut &cc) = 0;
2053
2056 inline void
2057 convertBoundToSense(const double lower, const double upper,
2058 char &sense, double &right, double &range) const;
2061 inline void
2062 convertSenseToBound(const char sense, const double right,
2063 const double range,
2064 double &lower, double &upper) const;
2067 template < class T >
2068 inline T
2069 forceIntoRange(const T value, const T lower, const T upper) const
2070 {
2071 return value < lower ? lower : (value > upper ? upper : value);
2072 }
2081
2083
2084
2090 // Why not just make useful stuff protected?
2092 CoinMessageHandler *handler_;
2100 CoinMessages messages_;
2105
2115 mutable char *columnType_;
2116
2118
2119 //---------------------------------------------------------------------------
2120
2121private:
2123
2124
2138 CoinWarmStart *ws_;
2140 std::vector< double > strictColSolution_;
2141
2147 std::string objName_;
2148
2150};
2151
2152//#############################################################################
2155inline void
2156OsiSolverInterface::convertBoundToSense(const double lower, const double upper,
2157 char &sense, double &right,
2158 double &range) const
2159{
2160 double inf = getInfinity();
2161 range = 0.0;
2162 if (lower > -inf) {
2163 if (upper < inf) {
2164 right = upper;
2165 if (upper == lower) {
2166 sense = 'E';
2167 } else {
2168 sense = 'R';
2169 range = upper - lower;
2170 }
2171 } else {
2172 sense = 'G';
2173 right = lower;
2174 }
2175 } else {
2176 if (upper < inf) {
2177 sense = 'L';
2178 right = upper;
2179 } else {
2180 sense = 'N';
2181 right = 0.0;
2182 }
2183 }
2184}
2185
2186//-----------------------------------------------------------------------------
2189inline void
2190OsiSolverInterface::convertSenseToBound(const char sense, const double right,
2191 const double range,
2192 double &lower, double &upper) const
2193{
2194 double inf = getInfinity();
2195 switch (sense) {
2196 case 'E':
2197 lower = upper = right;
2198 break;
2199 case 'L':
2200 lower = -inf;
2201 upper = right;
2202 break;
2203 case 'G':
2204 lower = right;
2205 upper = inf;
2206 break;
2207 case 'R':
2208 lower = right - range;
2209 upper = right;
2210 break;
2211 case 'N':
2212 lower = -inf;
2213 upper = inf;
2214 break;
2215 }
2216}
2217
2218#endif
2219
2220/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
2221*/
std::vector< int > OsiVectorInt
Vector of int.
@ OsiPrimalTolerance
Primal feasibility tolerance.
@ OsiLastDblParam
End marker.
@ OsiLastStrParam
End marker.
@ OsiForceDo
And this means throw an exception if not possible.
@ OsiHintTry
This means it is only a hint.
@ OsiLastHintParam
Just a marker, so that OsiSolverInterface can allocate a static sized array to store parameters.
@ OsiLastIntParam
End marker.
This class allows for a more structured use of algorithmic tweaking to an OsiSolverInterface.
Column Cut Class.
Definition OsiColCut.hpp:23
Collections of row cuts and column cuts.
Definition OsiCuts.hpp:19
Gurobi Solver Interface.
Abstract base class for ‘objects’.
Validate cuts against a known solution.
Row Cut Class.
Definition OsiRowCut.hpp:29
Solver Branch Class.
Internal class for obtaining status from the applyCuts method.
int infeasible_
Counter for infeasible cuts.
int getNumInconsistentWrtIntegerModel() const
Number of cuts inconsistent with the current model.
void incrementApplied()
Increment applied cut counter.
int extInconsistent_
Counter for model-inconsistent cuts.
int getNumApplied() const
Number of cuts applied.
int getNumIneffective() const
Number of redundant or ineffective cuts.
ApplyCutsReturnCode(const ApplyCutsReturnCode &rhs)
Copy constructor.
void incrementInfeasible()
Increment infeasible cut counter.
int getNumInfeasible() const
Number of cuts that cause obvious infeasibility.
void incrementInternallyInconsistent()
Increment logically inconsistent cut counter.
ApplyCutsReturnCode & operator=(const ApplyCutsReturnCode &rhs)
Assignment operator.
void incrementExternallyInconsistent()
Increment model-inconsistent counter.
int intInconsistent_
Counter for logically inconsistent cuts.
void incrementIneffective()
Increment ineffective cut counter.
int getNumInconsistent() const
Number of logically inconsistent cuts.
int ineffective_
Counter for ineffective cuts.
Abstract Base Class for describing an interface to a solver.
const OsiObject * object(int which) const
Get the specified object.
int writeLpNative(FILE *fp, char const *const *const rowNames, char const *const *const columnNames, const double epsilon=1.0e-5, const int numberAcross=10, const int decimals=5, const double objSense=0.0, const bool useRowNames=true) const
Write the problem into the file pointed to by the parameter fp.
friend void OsiSolverInterfaceMpsUnitTest(const std::vector< OsiSolverInterface * > &vecSiP, const std::string &mpsDir)
A function that tests that a lot of problems given in MPS files (mostly the NETLIB problems) solve pr...
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a set of rows.
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)=0
Add a column (primal variable) to the problem.
void convertSenseToBound(const char sense, const double right, const double range, double &lower, double &upper) const
A quick inlined function to convert from the sense/rhs/range style of constraint definition to the lb...
virtual void resolve()=0
Resolve an LP relaxation after problem modification.
CoinMessages messages()
Return the current set of messages.
virtual std::string getObjName(unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the objective function.
virtual void addCol(int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
int numberIntegers_
Number of integers.
int numberObjects_
Total number of objects.
virtual CoinWarmStart * getPointerToWarmStart(bool &mustDelete)
Get warm start information.
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
virtual void deleteCols(const int num, const int *colIndices)=0
Remove a set of columns (primal variables) from the problem.
void setNumberObjects(int number)
Set the number of objects.
virtual void setObjName(std::string name)
Set the name of the objective function.
const OsiRowCutDebugger * getRowCutDebugger() const
Get the row cut debugger provided the solution known to the debugger is within the feasible region he...
CoinMessageHandler * handler_
Message handler.
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get a pointer to a mutable column-wise copy of the matrix.
void setRowColNames(CoinLpIO &mod)
Set row and column names from a CoinLpIO object.
virtual std::vector< double * > getPrimalRays(int maxNumRays) const =0
Get as many primal rays as the solver can provide.
virtual int getIterationCount() const =0
Get the number of iterations it took to solve the problem (whatever ‘iteration’ means to the solver).
OsiAuxInfo * appDataEtc_
Pointer to user-defined data structure - and more if user wants.
virtual void deleteColNames(int tgtStart, int len)
Delete len column names starting at index tgtStart.
virtual std::string getColName(int colIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the column.
virtual bool getHintParam(OsiHintParam key, bool &yesNo, OsiHintStrength &strength, void *&otherInformation) const
Get a hint parameter (all information)
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj, std::string name)
Add a named column (primal variable) to the problem.
virtual void disableFactorization() const
Undo the effects of enableFactorization.
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
bool defaultHandler() const
Return true if default handler.
virtual std::string dfltRowColName(char rc, int ndx, unsigned digits=7) const
Generate a standard name of the form Rnnnnnnn or Cnnnnnnn.
virtual void setInteger(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be integer variables.
OsiSolverInterface(const OsiSolverInterface &)
Copy constructor.
virtual int dualPivotResult(int &colIn, int &sign, int colOut, int outStatus, double &t, CoinPackedVector *dx)
Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and...
void findIntegers(bool justCount)
Identify integer variables and create corresponding objects.
OsiNameVec colNames_
Column names.
virtual int setBasisStatus(const int *cstat, const int *rstat)
Set the status of column and row variables and update the basis factorization and solution.
virtual const OsiNameVec & getColNames()
Return a pointer to a vector of column names.
virtual const double * getObjCoefficients() const =0
Get a pointer to an array[getNumCols()] of objective function coefficients.
virtual double getInfinity() const =0
Get the solver's value for infinity.
OsiObject * modifiableObject(int which) const
Get the specified object.
virtual const double * getRightHandSide() const =0
Get a pointer to an array[getNumRows()] of row right-hand sides.
virtual bool isProvenPrimalInfeasible() const =0
Is primal infeasibility proven?
virtual const double * getColUpper() const =0
Get a pointer to an array[getNumCols()] of column upper bounds.
void statistics(double &minimumNegative, double &maximumNegative, double &minimumPositive, double &maximumPositive, int type=3) const
Get some statistics about model - min/max always computed type 0->4 , larger gives more information 0...
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the upper and lower bounds of a set of columns.
void setAuxiliaryInfo(OsiAuxInfo *auxiliaryInfo)
Create a clone of an Auxiliary Information object.
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const =0
Get as many dual rays as the solver can provide.
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...
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)=0
Add a row (constraint) to the problem.
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *=NULL)
Set a hint parameter.
void setApplicationData(void *appData)
Set application data.
virtual CoinBigIndex getNumElements() const =0
Get the number of nonzero elements.
virtual void unmarkHotStart()
Delete the hot start snapshot.
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
virtual void replaceMatrixOptional(const CoinPackedMatrix &)
Replace the constraint matrix.
virtual bool getHintParam(OsiHintParam key, bool &yesNo, OsiHintStrength &strength) const
Get a hint parameter (sense and strength only)
virtual bool isProvenOptimal() const =0
Is optimality proven?
virtual ~OsiSolverInterface()
Destructor.
virtual void setContinuous(int index)=0
Set the index-th variable to be a continuous variable.
virtual void getBInvARow(int row, double *z, double *slack=NULL) const
Get a row of the tableau.
bool optimalBasisIsAvailable() const
Synonym for basisIsAvailable.
OsiSolverInterface()
Default Constructor.
OsiRowCutDebugger * rowCutDebugger_
Pointer to row cut debugger object.
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)=0
Load in a problem by copying the arguments.
OsiHintStrength hintStrength_[OsiLastHintParam]
Array of hint strengths.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)=0
Add a row (constraint) to the problem.
virtual void setColSolution(const double *colsol)=0
Set the primal solution variable values.
friend void OsiSolverInterfaceCommonUnitTest(const OsiSolverInterface *emptySi, const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiSolverInterface class.
virtual void writeLp(const char *filename, const char *extension="lp", double epsilon=1e-5, int numberAcross=10, int decimals=9, double objSense=0.0, bool useRowNames=true) const
Write the problem into an Lp file of the given filename with the specified extension.
virtual CoinPackedMatrix * getMutableMatrixByRow() const
Get a pointer to a mutable row-wise copy of the matrix.
OsiObject ** objects() const
Get the array of objects.
virtual void getBasisStatus(int *cstat, int *rstat) const
Retrieve status information for column and row variables.
int addCols(CoinModel &modelObject)
Add columns from a model object.
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
CoinMessageHandler * messageHandler() const
Return a pointer to the current message handler.
virtual void setRowPrice(const double *rowprice)=0
Set dual solution variable values.
int intParam_[OsiLastIntParam]
Array of integer parameters.
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
virtual void restoreBaseModel(int numberRows)
Reduce the constraint system to the specified number of constraints.
virtual bool isIterationLimitReached() const =0
Iteration limit reached?
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub)=0
Load in a problem by assuming ownership of the arguments.
void setRowColNames(const CoinMpsIO &mps)
Set row and column names from a CoinMpsIO object.
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
const char * columnType(bool refresh=false) const
Return an array[getNumCols()] of column types.
void newLanguage(CoinMessages::Language language)
Set language.
int addRows(CoinModel &modelObject)
Add rows from a CoinModel object.
virtual void applyColCut(const OsiColCut &cc)=0
Apply a column cut (adjust the bounds of one or more variables).
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.
virtual const double * getReducedCost() const =0
Get a pointer to an array[getNumCols()] of reduced costs.
virtual void setRowName(int ndx, std::string name)
Set a row name.
virtual void setColUpper(const double *array)
Set the upper bounds for all columns.
virtual void writeMps(const char *filename, const char *extension="mps", double objSense=0.0) const =0
Write the problem in MPS format to the specified file.
virtual const double * getStrictColSolution()
Get a pointer to an array[getNumCols()] of primal variable values guaranteed to be between the column...
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)=0
Load in a problem by copying the arguments.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub, std::string name)
Add a named row (constraint) to the problem.
virtual void disableSimplexInterface()
Undo whatever setting changes the above method had to make.
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
virtual void loadProblem(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)=0
Load in a problem by copying the arguments.
virtual const OsiNameVec & getRowNames()
Return a pointer to a vector of row names.
virtual const char * getColType(bool refresh=false) const
Return an array[getNumCols()] of column types.
virtual const double * getRowPrice() const =0
Get pointer to array[getNumRows()] of dual variable values.
virtual void addRows(const int numrows, const CoinBigIndex *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub)
Add a set of rows (constraints) to the problem.
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
virtual int findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
virtual int readGMPL(const char *filename, const char *dataname=NULL)
Read a problem in GMPL format from the given filenames.
void addObjects(int numberObjects, OsiObject **objects)
Add in object information.
void setInitialData()
Set OsiSolverInterface object state for default constructor.
virtual int canDoSimplexInterface() const
Return the simplex implementation level.
virtual bool isProvenDualInfeasible() const =0
Is dual infeasibility proven?
virtual void markHotStart()
Create a hot start snapshot of the optimization process.
virtual void getBasics(int *index) const
Get indices of basic variables.
virtual const double * getRowLower() const =0
Get a pointer to an array[getNumRows()] of row lower bounds.
void setLanguage(CoinMessages::Language language)
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
virtual void setRowUpper(int elementIndex, double elementValue)=0
Set a single row upper bound.
virtual bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
virtual int getNumRows() const =0
Get the number of rows.
virtual CoinWarmStart * getEmptyWarmStart() const =0
Get an empty warm start object.
virtual void setRowSetTypes(const int *indexFirst, const int *indexLast, const char *senseList, const double *rhsList, const double *rangeList)
Set the type of a set of rows.
virtual bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
virtual int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
virtual bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
virtual void initialSolve()=0
Solve initial LP relaxation.
CoinMessages * messagesPointer()
Return a pointer to the current set of messages.
virtual void setObjective(const double *array)
Set the objective coefficients for all columns.
CoinMessages messages_
Messages.
virtual void setRowLower(int elementIndex, double elementValue)=0
Set a single row lower bound.
virtual void branchAndBound()=0
Invoke solver's built-in enumeration algorithm.
virtual const double * getColLower() const =0
Get a pointer to an array[getNumCols()] of column lower bounds.
virtual void setColName(int ndx, std::string name)
Set a column name.
virtual void setRowNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart)
Set multiple row names.
double forceFeasible()
Use current solution to set bounds so current integer feasible solution will stay feasible.
void setColumnType(int iColumn, char type)
Set column type.
virtual void applyRowCut(const OsiRowCut &rc)=0
Apply a row cut (append to the constraint matrix).
virtual void activateRowCutDebugger(const double *solution, bool enforceOptimality=true)
Activate the row cut debugger using a full solution array.
virtual int reducedCostFix(double gap, bool justInteger=true)
Fix variables at bound based on reduced cost.
virtual void setObjCoeffSet(const int *indexFirst, const int *indexLast, const double *coeffList)
Set a set of objective function coefficients.
virtual void loadProblem(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)=0
Load in a problem by copying the arguments.
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format from file with name filename.
int writeMpsNative(const char *filename, const char **rowNames, const char **columnNames, int formatType=0, int numberAcross=2, double objSense=0.0, int numberSOS=0, const CoinSet *setInfo=NULL) const
Write the problem in MPS format to the specified file with more control over the output.
CoinWarmStart * ws_
Warm start information used for hot starts when the default hot start implementation is used.
virtual double getObjValue() const =0
Get the objective function value.
int readLp(FILE *fp, const double epsilon=1e-5)
Read file in LP format from the file pointed to by fp.
virtual void setColUpper(int elementIndex, double elementValue)=0
Set a single column upper bound.
void deleteObjects()
Delete all object information.
virtual void saveBaseModel()
Save a copy of the base model.
int numberObjects() const
Get the number of objects.
virtual bool isContinuous(int colIndex) const =0
Return true if the variable is continuous.
virtual const double * getColSolution() const =0
Get a pointer to an array[getNumCols()] of primal variable values.
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
std::vector< double > strictColSolution_
Column solution satisfying lower and upper column bounds.
char * columnType_
Column type 0 - continuous 1 - binary (may get fixed later) 2 - general integer (may get fixed later)...
virtual const char * getRowSense() const =0
Get a pointer to an array[getNumRows()] of row constraint senses.
virtual bool getHintParam(OsiHintParam key, bool &yesNo) const
Get a hint parameter (sense only)
virtual void setColNames(OsiNameVec &srcNames, int srcStart, int len, int tgtStart)
Set multiple column names.
void copyParameters(OsiSolverInterface &rhs)
Copy all parameters in this section from one solver to another.
void addRows(const CoinBuild &buildObject)
Add rows using a CoinBuild object.
OsiObject ** object_
Integer and ... information (integer info normally at beginning)
virtual double getObjSense() const =0
Get the objective function sense.
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.
virtual bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
virtual bool isAbandoned() const =0
Are there numerical difficulties?
virtual int getNumIntegers() const
Get the number of integer variables.
virtual std::string getRowName(int rowIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return the name of the row.
virtual bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
virtual const CoinPackedMatrix * getMatrixByRow() const =0
Get a pointer to a row-wise copy of the matrix.
virtual const double * getRowUpper() const =0
Get a pointer to an array[getNumRows()] of row upper bounds.
int writeLpNative(const char *filename, char const *const *const rowNames, char const *const *const columnNames, const double epsilon=1.0e-5, const int numberAcross=10, const int decimals=5, const double objSense=0.0, const bool useRowNames=true) const
Write the problem into an Lp file.
virtual void reset()
Reset the solver interface.
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
Add a set of rows (constraints) to the problem.
double getIntegerTolerance() const
Return the integrality tolerance of the underlying solver.
void addCols(const CoinBuild &buildObject)
Add columns using a CoinBuild object.
virtual const CoinPackedMatrix * getMatrixByCol() const =0
Get a pointer to a column-wise copy of the matrix.
virtual void deleteRowNames(int tgtStart, int len)
Delete len row names starting at index tgtStart.
int differentModel(OsiSolverInterface &other, bool ignoreNames=true)
Check two models against each other.
virtual void setInteger(int index)=0
Set the index-th variable to be an integer variable.
void setRowColNames(CoinModel &mod)
Set row and column names from a CoinModel object.
OsiSolverInterface & operator=(const OsiSolverInterface &rhs)
Assignment operator.
std::string objName_
Objective name.
virtual void addCols(const int numcols, const CoinBigIndex *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
Add a set of columns (primal variables) to the problem.
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng, std::string name)
Add a named row (constraint) to the problem.
virtual void addCol(int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj, std::string name)
Add a named column (primal variable) to the problem.
virtual void setRowType(int index, char sense, double rightHandSide, double range)=0
Set the type of a single row.
virtual const double * getRowActivity() const =0
Get a pointer to array[getNumRows()] of row activity levels.
virtual int getNumCols() const =0
Get the number of columns.
virtual void replaceMatrix(const CoinPackedMatrix &)
Replace the constraint matrix.
OsiNameVec rowNames_
Row names.
virtual void addRow(int numberElements, const int *columns, const double *element, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiAuxInfo * getAuxiliaryInfo() const
Get pointer to auxiliary info object.
virtual void solveFromHotStart()
Optimize starting from the hot start snapshot.
virtual void enableFactorization() const
Prepare the solver for the use of tableau access methods.
OsiRowCutDebugger * getRowCutDebuggerAlways() const
Get the row cut debugger object.
virtual const double * getRowRange() const =0
Get a pointer to an array[getNumRows()] of row ranges.
virtual void activateRowCutDebugger(const char *modelName)
Activate the row cut debugger.
virtual int primalPivotResult(int colIn, int sign, int &colOut, int &outStatus, double &t, CoinPackedVector *dx)
Obtain a result of the primal pivot Outputs: colOut – leaving column, outStatus – its status,...
void * getApplicationData() const
Get application data.
std::vector< std::string > OsiNameVec
Data type for name vectors.
virtual void writeLp(FILE *fp, double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
Write the problem into the file pointed to by the parameter fp.
virtual void setObjSense(double s)=0
Set the objective function sense.
virtual void setContinuous(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be continuous variables.
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
void deleteBranchingInfo(int numberDeleted, const int *which)
Deletes branching information before columns deleted.
virtual int readMps(const char *filename, const char *extension, int &numberSets, CoinSet **&sets)
Read a problem in MPS format from the given full filename.
virtual bool basisIsAvailable() const
Check if an optimal basis is available.
T forceIntoRange(const T value, const T lower, const T upper) const
A quick inlined function to force a value to be between a minimum and a maximum value.
virtual void deleteRows(const int num, const int *rowIndices)=0
Delete a set of rows (constraints) from the problem.
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
virtual CoinWarmStart * getWarmStart() const =0
Get warm start information.
virtual void enableSimplexInterface(bool doingPrimal)
Enables normal operation of subsequent functions.
virtual void setColLower(const double *array)
Set the lower bounds for all columns.
bool hintParam_[OsiLastHintParam]
Array of hint parameters.
double dblParam_[OsiLastDblParam]
Array of double parameters.
std::string strParam_[OsiLastStrParam]
Array of string parameters.
virtual OsiSolverInterface * clone(bool copyData=true) const =0
Clone.
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Calculate duals and reduced costs for the given objective coefficients.
virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts)
Apply a collection of row cuts which are all effective.
virtual bool setWarmStart(const CoinWarmStart *warmstart)=0
Set warm start information.
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng)=0
Load in a problem by assuming ownership of the arguments.
void convertBoundToSense(const double lower, const double upper, char &sense, double &right, double &range) const
A quick inlined function to convert from the lb/ub style of constraint definition to the sense/rhs/ra...
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
Load a model from a CoinModel object.
bool defaultHandler_
Flag to say if the currrent handler is the default handler.
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
virtual void setObjCoeff(int elementIndex, double elementValue)=0
Set an objective function coefficient.
virtual bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
Solver Result Class.