Cgl 0.60.2

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OsiClpSolverInterface.hpp
Go to the documentation of this file.
1 // $Id$
2 // Copyright (C) 2000, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 #ifndef OsiClpSolverInterface_H
7 #define OsiClpSolverInterface_H
8
9 #include <string>
10 #include <cfloat>
11 #include <map>
12
13 #include "ClpSimplex.hpp"
14 #include "ClpLinearObjective.hpp"
15 #include "CoinPackedMatrix.hpp"
16 #include "OsiSolverInterface.hpp"
17 #include "CoinWarmStartBasis.hpp"
18 #include "ClpEventHandler.hpp"
19 #include "ClpNode.hpp"
20 #include "CoinIndexedVector.hpp"
21 #include "CoinFinite.hpp"
22
23 class OsiRowCut;
24 class OsiClpUserSolver;
25 class OsiClpDisasterHandler;
26 class CoinSet;
27 static const double OsiClpInfinity = COIN_DBL_MAX;
28
29 //#############################################################################
30
37 class OsiClpSolverInterface : virtual public OsiSolverInterface {
38 friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
39
40 public:
41 //---------------------------------------------------------------------------
44 virtual void initialSolve();
46
48 virtual void resolve();
49
51 virtual void resolveGub(int needed);
52
54 virtual void branchAndBound();
55
63 void crossover(int options, int basis);
65
81 virtual int canDoSimplexInterface() const;
82
91 virtual void enableFactorization() const;
92
94 virtual void disableFactorization() const;
95
100 virtual bool basisIsAvailable() const;
101
117 virtual void getBasisStatus(int *cstat, int *rstat) const;
118
129 virtual int setBasisStatus(const int *cstat, const int *rstat);
130
132 virtual void getReducedGradient(double *columnReducedCosts,
133 double *duals,
134 const double *c) const;
135
137 virtual void getBInvARow(int row, double *z, double *slack = NULL) const;
138
143 virtual void getBInvARow(int row, CoinIndexedVector *z, CoinIndexedVector *slack = NULL,
144 bool keepScaled = false) const;
145
147 virtual void getBInvRow(int row, double *z) const;
148
150 virtual void getBInvACol(int col, double *vec) const;
151
153 virtual void getBInvACol(int col, CoinIndexedVector *vec) const;
154
159 virtual void getBInvACol(CoinIndexedVector *vec) const;
160
162 virtual void getBInvCol(int col, double *vec) const;
163
168 virtual void getBasics(int *index) const;
169
176 virtual void enableSimplexInterface(bool doingPrimal);
178 void copyEnabledSuff(OsiClpSolverInterface &rhs);
179
181 virtual void disableSimplexInterface();
183 void copyEnabledStuff(ClpSimplex &rhs);
184
192 virtual int pivot(int colIn, int colOut, int outStatus);
193
205 virtual int primalPivotResult(int colIn, int sign,
206 int &colOut, int &outStatus,
207 double &t, CoinPackedVector *dx);
208
215 virtual int dualPivotResult(int &colIn, int &sign,
216 int colOut, int outStatus,
217 double &t, CoinPackedVector *dx);
218
220 //---------------------------------------------------------------------------
236 // Set an integer parameter
237 bool setIntParam(OsiIntParam key, int value);
238 // Set an double parameter
239 bool setDblParam(OsiDblParam key, double value);
240 // Set a string parameter
241 bool setStrParam(OsiStrParam key, const std::string &value);
242 // Get an integer parameter
243 bool getIntParam(OsiIntParam key, int &value) const;
244 // Get an double parameter
245 bool getDblParam(OsiDblParam key, double &value) const;
246 // Get a string parameter
247 bool getStrParam(OsiStrParam key, std::string &value) const;
248 // Set a hint parameter - overrides OsiSolverInterface
249 virtual bool setHintParam(OsiHintParam key, bool yesNo = true,
250 OsiHintStrength strength = OsiHintTry,
251 void *otherInformation = NULL);
253
254 //---------------------------------------------------------------------------
256
257 virtual bool isAbandoned() const;
260 virtual bool isProvenOptimal() const;
262 virtual bool isProvenPrimalInfeasible() const;
264 virtual bool isProvenDualInfeasible() const;
266 virtual bool isPrimalObjectiveLimitReached() const;
268 virtual bool isDualObjectiveLimitReached() const;
270 virtual bool isIterationLimitReached() const;
272
273 //---------------------------------------------------------------------------
276
284 virtual CoinWarmStart *getEmptyWarmStart() const;
285
287 virtual CoinWarmStart *getWarmStart() const;
289 inline CoinWarmStartBasis *getPointerToWarmStart()
290 {
291 return &basis_;
292 }
294 inline const CoinWarmStartBasis *getConstPointerToWarmStart() const
295 {
296 return &basis_;
297 }
300 virtual bool setWarmStart(const CoinWarmStart *warmstart);
310 virtual CoinWarmStart *getPointerToWarmStart(bool &mustDelete);
311
313 void setColumnStatus(int iColumn, ClpSimplex::Status status);
314
316
317 //---------------------------------------------------------------------------
324 virtual void markHotStart();
327 virtual void solveFromHotStart();
329 virtual void unmarkHotStart();
338 int startFastDual(int options);
340 void stopFastDual();
342 void setStuff(double tolerance, double increment);
344 OsiRowCut *smallModelCut(const double *originalLower, const double *originalUpper,
345 int numberRowsAtContinuous, const int *whichGenerator,
346 int typeCut = 0);
350 OsiRowCut *modelCut(const double *originalLower, const double *originalUpper,
351 int numberRowsAtContinuous, const int *whichGenerator,
352 int typeCut = 0);
354
355 //---------------------------------------------------------------------------
370 virtual int getNumCols() const
372 {
373 return modelPtr_->numberColumns();
374 }
375
377 virtual int getNumRows() const
378 {
379 return modelPtr_->numberRows();
380 }
381
383 virtual CoinBigIndex getNumElements() const
384 {
385 CoinBigIndex retVal = 0;
386 const CoinPackedMatrix *matrix = modelPtr_->matrix();
387 if (matrix != NULL)
388 retVal = matrix->getNumElements();
389 return retVal;
390 }
391
394 virtual std::string getRowName(int rowIndex,
395 unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
396
399 virtual std::string getColName(int colIndex,
400 unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
401
403 virtual const double *getColLower() const { return modelPtr_->columnLower(); }
404
406 virtual const double *getColUpper() const { return modelPtr_->columnUpper(); }
407
417 virtual const char *getRowSense() const;
418
427 virtual const double *getRightHandSide() const;
428
437 virtual const double *getRowRange() const;
438
440 virtual const double *getRowLower() const { return modelPtr_->rowLower(); }
441
443 virtual const double *getRowUpper() const { return modelPtr_->rowUpper(); }
444
446 virtual const double *getObjCoefficients() const
447 {
448 if (fakeMinInSimplex_)
449 return linearObjective_;
450 else
451 return modelPtr_->objective();
452 }
453
455 virtual double getObjSense() const
456 {
457 return ((fakeMinInSimplex_) ? -modelPtr_->optimizationDirection() : modelPtr_->optimizationDirection());
458 }
459
461 virtual bool isContinuous(int colNumber) const;
463 virtual bool isBinary(int colIndex) const;
464
469 virtual bool isInteger(int colIndex) const;
470
472 virtual bool isIntegerNonBinary(int colIndex) const;
473
475 virtual bool isFreeBinary(int colIndex) const;
481 virtual const char *getColType(bool refresh = false) const;
482
488 bool isOptionalInteger(int colIndex) const;
490 void setOptionalInteger(int index);
492 inline bool isHeuristicInteger(int colIndex) const
493 {
494 return (integerInformation_ && integerInformation_[colIndex] == 1);
495 }
497 inline int integerType(int colIndex) const
498 {
499 return integerInformation_ ? integerInformation_[colIndex] : 0;
500 }
502 inline void setIntegerType(int colIndex, int value)
503 {
504 integerInformation_[colIndex] = static_cast< char >(value);
505 }
507 virtual const CoinPackedMatrix *getMatrixByRow() const;
508
510 virtual const CoinPackedMatrix *getMatrixByCol() const;
511
513 virtual CoinPackedMatrix *getMutableMatrixByCol() const;
514
516 virtual double getInfinity() const { return OsiClpInfinity; }
518
521 virtual const double *getColSolution() const;
523
525 virtual const double *getRowPrice() const;
526
528 virtual const double *getReducedCost() const;
529
532 virtual const double *getRowActivity() const;
533
535 virtual double getObjValue() const;
536
539 virtual int getIterationCount() const
540 {
541 return modelPtr_->numberIterations();
542 }
543
561 virtual std::vector< double * > getDualRays(int maxNumRays,
562 bool fullRay = false) const;
574 virtual std::vector< double * > getPrimalRays(int maxNumRays) const;
575
577
578
579 //---------------------------------------------------------------------------
580
583 //-------------------------------------------------------------------------
587 virtual void setObjCoeff(int elementIndex, double elementValue);
588
591 virtual void setColLower(int elementIndex, double elementValue);
592
595 virtual void setColUpper(int elementIndex, double elementValue);
596
598 virtual void setColBounds(int elementIndex,
599 double lower, double upper);
600
609 virtual void setColSetBounds(const int *indexFirst,
610 const int *indexLast,
611 const double *boundList);
612
615 virtual void setRowLower(int elementIndex, double elementValue);
616
619 virtual void setRowUpper(int elementIndex, double elementValue);
620
622 virtual void setRowBounds(int elementIndex,
623 double lower, double upper);
624
626 virtual void setRowType(int index, char sense, double rightHandSide,
627 double range);
628
637 virtual void setRowSetBounds(const int *indexFirst,
638 const int *indexLast,
639 const double *boundList);
640
651 virtual void setRowSetTypes(const int *indexFirst,
652 const int *indexLast,
653 const char *senseList,
654 const double *rhsList,
655 const double *rangeList);
660 virtual void setObjective(const double *array);
661
666 virtual void setColLower(const double *array);
667
672 virtual void setColUpper(const double *array);
673
674 // using OsiSolverInterface::setRowName ;
676 // virtual void setRowName(int rowIndex, std::string & name) ;
677 virtual void setRowName(int rowIndex, std::string name);
678
679 // using OsiSolverInterface::setColName ;
681 // virtual void setColName(int colIndex, std::string & name) ;
682 virtual void setColName(int colIndex, std::string name);
683
685
686 //-------------------------------------------------------------------------
690 virtual void setContinuous(int index);
692 virtual void setInteger(int index);
695 virtual void setContinuous(const int *indices, int len);
698 virtual void setInteger(const int *indices, int len);
700 inline int numberSOS() const
701 {
702 return numberSOS_;
703 }
705 inline const CoinSet *setInfo() const
706 {
707 return setInfo_;
708 }
710 void replaceSetInfo(int numberSOS, CoinSet *setInfo);
720 virtual int findIntegersAndSOS(bool justCount);
722
723 //-------------------------------------------------------------------------
725 virtual void setObjSense(double s)
726 {
727 modelPtr_->setOptimizationDirection(s < 0 ? -1 : 1);
728 }
729
740 virtual void setColSolution(const double *colsol);
741
752 virtual void setRowPrice(const double *rowprice);
753
754 //-------------------------------------------------------------------------
759
760 //using OsiSolverInterface::addCol ;
762 virtual void addCol(const CoinPackedVectorBase &vec,
763 const double collb, const double colub,
764 const double obj);
767 virtual void addCol(const CoinPackedVectorBase &vec,
768 const double collb, const double colub,
769 const double obj, std::string name);
771 virtual void addCol(int numberElements, const int *rows, const double *elements,
772 const double collb, const double colub,
773 const double obj);
776 virtual void addCol(int numberElements,
777 const int *rows, const double *elements,
778 const double collb, const double colub,
779 const double obj, std::string name);
781 virtual void addCols(const int numcols,
782 const CoinPackedVectorBase *const *cols,
783 const double *collb, const double *colub,
784 const double *obj);
786 virtual void addCols(const int numcols,
787 const CoinBigIndex *columnStarts, const int *rows, const double *elements,
788 const double *collb, const double *colub,
789 const double *obj);
791 virtual void deleteCols(const int num, const int *colIndices);
792
794 virtual void addRow(const CoinPackedVectorBase &vec,
795 const double rowlb, const double rowub);
802 virtual void addRow(const CoinPackedVectorBase &vec,
803 const double rowlb, const double rowub,
804 std::string name);
805 virtual void addRow(const CoinPackedVectorBase &vec,
806 const char rowsen, const double rowrhs,
807 const double rowrng);
809 virtual void addRow(int numberElements, const int *columns, const double *element,
810 const double rowlb, const double rowub);
813 virtual void addRow(const CoinPackedVectorBase &vec,
814 const char rowsen, const double rowrhs,
815 const double rowrng, std::string name);
817 virtual void addRows(const int numrows,
818 const CoinPackedVectorBase *const *rows,
819 const double *rowlb, const double *rowub);
821 virtual void addRows(const int numrows,
822 const CoinPackedVectorBase *const *rows,
823 const char *rowsen, const double *rowrhs,
824 const double *rowrng);
825
827 virtual void addRows(const int numrows,
828 const CoinBigIndex *rowStarts, const int *columns, const double *element,
829 const double *rowlb, const double *rowub);
831 void modifyCoefficient(int row, int column, double newElement,
832 bool keepZero = false)
833 {
834 modelPtr_->modifyCoefficient(row, column, newElement, keepZero);
835 }
836
838 virtual void deleteRows(const int num, const int *rowIndices);
841 virtual void saveBaseModel();
845 virtual void restoreBaseModel(int numberRows);
846
847 //-----------------------------------------------------------------------
851 virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts);
856 virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts);
879 virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs,
880 double effectivenessLb = 0.0);
881
883
884
885 //---------------------------------------------------------------------------
886
887 public:
901 virtual void loadProblem(const CoinPackedMatrix &matrix,
902 const double *collb, const double *colub,
903 const double *obj,
904 const double *rowlb, const double *rowub);
905
913 virtual void assignProblem(CoinPackedMatrix *&matrix,
914 double *&collb, double *&colub, double *&obj,
915 double *&rowlb, double *&rowub);
916
929 virtual void loadProblem(const CoinPackedMatrix &matrix,
930 const double *collb, const double *colub,
931 const double *obj,
932 const char *rowsen, const double *rowrhs,
933 const double *rowrng);
934
942 virtual void assignProblem(CoinPackedMatrix *&matrix,
943 double *&collb, double *&colub, double *&obj,
944 char *&rowsen, double *&rowrhs,
945 double *&rowrng);
946
949 virtual void loadProblem(const ClpMatrixBase &matrix,
950 const double *collb, const double *colub,
951 const double *obj,
952 const double *rowlb, const double *rowub);
953
956 virtual void loadProblem(const int numcols, const int numrows,
957 const CoinBigIndex *start, const int *index,
958 const double *value,
959 const double *collb, const double *colub,
960 const double *obj,
961 const double *rowlb, const double *rowub);
962
965 virtual void loadProblem(const int numcols, const int numrows,
966 const CoinBigIndex *start, const int *index,
967 const double *value,
968 const double *collb, const double *colub,
969 const double *obj,
970 const char *rowsen, const double *rowrhs,
971 const double *rowrng);
973 virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution = false);
974
975 using OsiSolverInterface::readMps;
978 virtual int readMps(const char *filename,
979 const char *extension = "mps");
982 int readMps(const char *filename, bool keepNames, bool allowErrors);
984 virtual int readMps(const char *filename, const char *extension,
985 int &numberSets, CoinSet **&sets);
986
991 virtual void writeMps(const char *filename,
992 const char *extension = "mps",
993 double objSense = 0.0) const;
1002 virtual int writeMpsNative(const char *filename,
1003 const char **rowNames, const char **columnNames,
1004 int formatType = 0, int numberAcross = 2,
1005 double objSense = 0.0) const;
1007 virtual int readLp(const char *filename, const double epsilon = 1e-5);
1013 virtual void writeLp(const char *filename,
1014 const char *extension = "lp",
1015 double epsilon = 1e-5,
1016 int numberAcross = 10,
1017 int decimals = 5,
1018 double objSense = 0.0,
1019 bool useRowNames = true) const;
1024 virtual void writeLp(FILE *fp,
1025 double epsilon = 1e-5,
1026 int numberAcross = 10,
1027 int decimals = 5,
1028 double objSense = 0.0,
1029 bool useRowNames = true) const;
1035 virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix);
1037 virtual void replaceMatrix(const CoinPackedMatrix &matrix);
1039
1050 virtual void passInMessageHandler(CoinMessageHandler *handler);
1052 void newLanguage(CoinMessages::Language language);
1053 void setLanguage(CoinMessages::Language language)
1054 {
1055 newLanguage(language);
1056 }
1058 void setLogLevel(int value);
1060 void generateCpp(FILE *fp);
1062 //---------------------------------------------------------------------------
1063
1066 ClpSimplex *getModelPtr() const;
1069 inline ClpSimplex *swapModelPtr(ClpSimplex *newModel)
1070 {
1071 ClpSimplex *model = modelPtr_;
1072 modelPtr_ = newModel;
1073 return model;
1074 }
1076 inline unsigned int specialOptions() const
1077 {
1078 return specialOptions_;
1079 }
1080 void setSpecialOptions(unsigned int value);
1082 inline int lastAlgorithm() const
1083 {
1084 return lastAlgorithm_;
1085 }
1087 inline void setLastAlgorithm(int value)
1088 {
1089 lastAlgorithm_ = value;
1090 }
1092 inline int cleanupScaling() const
1093 {
1094 return cleanupScaling_;
1095 }
1108 inline void setCleanupScaling(int value)
1109 {
1110 cleanupScaling_ = value;
1111 }
1114 inline double smallestElementInCut() const
1115 {
1116 return smallestElementInCut_;
1117 }
1120 inline void setSmallestElementInCut(double value)
1121 {
1122 smallestElementInCut_ = value;
1123 }
1130 inline double smallestChangeInCut() const
1131 {
1132 return smallestChangeInCut_;
1133 }
1140 inline void setSmallestChangeInCut(double value)
1141 {
1142 smallestChangeInCut_ = value;
1143 }
1145 inline void setSolveOptions(const ClpSolve &options)
1146 {
1147 solveOptions_ = options;
1148 }
1152 virtual int tightenBounds(int lightweight = 0);
1154 int infeasibleOtherWay(char *whichWay);
1156 virtual CoinBigIndex getSizeL() const;
1158 virtual CoinBigIndex getSizeU() const;
1160 const OsiClpDisasterHandler *disasterHandler() const
1161 {
1162 return disasterHandler_;
1163 }
1165 void passInDisasterHandler(OsiClpDisasterHandler *handler);
1167 ClpLinearObjective *fakeObjective() const
1168 {
1169 return fakeObjective_;
1170 }
1172 void setFakeObjective(ClpLinearObjective *fakeObjective);
1174 void setFakeObjective(double *fakeObjective);
1194 void setupForRepeatedUse(int senseOfAdventure = 0, int printOut = 0);
1196 virtual void synchronizeModel();
1201 void setSpecialOptionsMutable(unsigned int value) const;
1202
1204
1205 //---------------------------------------------------------------------------
1206
1209 OsiClpSolverInterface();
1211
1213 virtual OsiSolverInterface *clone(bool copyData = true) const;
1214
1216 OsiClpSolverInterface(const OsiClpSolverInterface &);
1217
1219 OsiClpSolverInterface(ClpSimplex *rhs, bool reallyOwn = false);
1220
1222 void releaseClp();
1223
1225 OsiClpSolverInterface &operator=(const OsiClpSolverInterface &rhs);
1226
1228 virtual ~OsiClpSolverInterface();
1229
1231 virtual void reset();
1233
1234 //---------------------------------------------------------------------------
1235
1236 protected:
1238
1239
1240 virtual void applyRowCut(const OsiRowCut &rc);
1241
1243 virtual void applyColCut(const OsiColCut &cc);
1245
1246 //---------------------------------------------------------------------------
1247
1248 protected:
1251 void gutsOfDestructor();
1253
1255 void freeCachedResults() const;
1256
1258 void freeCachedResults0() const;
1259
1261 void freeCachedResults1() const;
1262
1264 void extractSenseRhsRange() const;
1265
1267 void fillParamMaps();
1276 CoinWarmStartBasis getBasis(ClpSimplex *model) const;
1285 void setBasis(const CoinWarmStartBasis &basis, ClpSimplex *model);
1287 void crunch();
1289 void redoScaleFactors(int numberRows, const CoinBigIndex *starts,
1290 const int *indices, const double *elements);
1291
1292 public:
1295 void setBasis(const CoinWarmStartBasis &basis);
1297 inline void setBasis()
1298 {
1299 setBasis(basis_, modelPtr_);
1300 }
1302 CoinWarmStartDiff *getBasisDiff(const unsigned char *statusArray) const;
1304 CoinWarmStartBasis *getBasis(const unsigned char *statusArray) const;
1306 void deleteScaleFactors();
1308 inline const double *upRange() const
1309 {
1310 return rowActivity_;
1311 }
1312 inline const double *downRange() const
1313 {
1314 return columnActivity_;
1315 }
1317 inline void passInRanges(int *array)
1318 {
1319 whichRange_ = array;
1320 }
1322 void setSOSData(int numberSOS, const char *type,
1323 const int *start, const int *indices, const double *weights = NULL);
1325 void computeLargestAway();
1327 inline double largestAway() const
1328 {
1329 return largestAway_;
1330 }
1332 inline void setLargestAway(double value)
1333 {
1334 largestAway_ = value;
1335 }
1337 void lexSolve();
1339 inline ClpSimplex *getContinuousModel() const
1340 {
1341 return continuousModel_;
1342 }
1344 inline void setContinuousModel(ClpSimplex *model)
1345 {
1346 continuousModel_ = model;
1347 }
1349
1350 protected:
1353 mutable ClpSimplex *modelPtr_;
1356
1358 mutable char *rowsense_;
1360
1362 mutable double *rhs_;
1363
1367 mutable double *rowrange_;
1368
1371 mutable CoinWarmStartBasis *ws_;
1374 mutable double *rowActivity_;
1375 mutable double *columnActivity_;
1377 ClpNodeStuff stuff_;
1379 int numberSOS_;
1381 CoinSet *setInfo_;
1383 ClpSimplex *smallModel_;
1385 ClpFactorization *factorization_;
1388 double smallestElementInCut_;
1392 double smallestChangeInCut_;
1394 double largestAway_;
1396 char *spareArrays_;
1398 CoinWarmStartBasis basis_;
1400 int itlimOrig_;
1401
1412 mutable int lastAlgorithm_;
1413
1415 bool notOwned_;
1416
1418 mutable CoinPackedMatrix *matrixByRow_;
1419
1421 CoinPackedMatrix *matrixByRowAtContinuous_;
1422
1424 char *integerInformation_;
1425
1430 int *whichRange_;
1431
1432 //std::map<OsiIntParam, ClpIntParam> intParamMap_;
1433 //std::map<OsiDblParam, ClpDblParam> dblParamMap_;
1434 //std::map<OsiStrParam, ClpStrParam> strParamMap_;
1435
1437 mutable bool fakeMinInSimplex_;
1444 mutable double *linearObjective_;
1445
1447 mutable ClpDataSave saveData_;
1449 ClpSolve solveOptions_;
1462 int cleanupScaling_;
1491 mutable unsigned int specialOptions_;
1493 ClpSimplex *baseModel_;
1495 int lastNumberRows_;
1497 ClpSimplex *continuousModel_;
1499 OsiClpDisasterHandler *disasterHandler_;
1501 ClpLinearObjective *fakeObjective_;
1503 CoinDoubleArrayWithLength rowScale_;
1505 CoinDoubleArrayWithLength columnScale_;
1507 };
1508
1509 class OsiClpDisasterHandler : public ClpDisasterHandler {
1510 public:
1514 virtual void intoSimplex();
1517 virtual bool check() const;
1519 virtual void saveInfo();
1521 virtual int typeOfDisaster();
1523
1528 OsiClpDisasterHandler(OsiClpSolverInterface *model = NULL);
1530 virtual ~OsiClpDisasterHandler();
1531 // Copy
1532 OsiClpDisasterHandler(const OsiClpDisasterHandler &);
1533 // Assignment
1534 OsiClpDisasterHandler &operator=(const OsiClpDisasterHandler &);
1536 virtual ClpDisasterHandler *clone() const;
1537
1539
1544 void setOsiModel(OsiClpSolverInterface *model);
1546 inline OsiClpSolverInterface *osiModel() const
1547 {
1548 return osiModel_;
1549 }
1551 inline void setWhereFrom(int value)
1552 {
1553 whereFrom_ = value;
1554 }
1556 inline int whereFrom() const
1557 {
1558 return whereFrom_;
1559 }
1561 inline void setPhase(int value)
1562 {
1563 phase_ = value;
1564 }
1566 inline int phase() const
1567 {
1568 return phase_;
1569 }
1571 bool inTrouble() const;
1572
1574
1575 protected:
1579 OsiClpSolverInterface *osiModel_;
1588 int whereFrom_;
1596 int phase_;
1598 bool inTrouble_;
1600 };
1601 // So unit test can find out if NDEBUG set
1602 bool OsiClpHasNDEBUG();
1603 //#############################################################################
1605 void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
1606 #endif
1607
1608 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1609 */
OsiClpDisasterHandler
Definition: OsiClpSolverInterface.hpp:1509
OsiClpSolverInterface::pivot
virtual int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
OsiClpSolverInterface::setStuff
void setStuff(double tolerance, double increment)
Sets integer tolerance and increment.
ClpSolve
This is a very simple class to guide algorithms.
Definition: ClpSolve.hpp:20
OsiClpSolverInterface::getNumElements
virtual CoinBigIndex getNumElements() const
Get number of nonzero elements.
Definition: OsiClpSolverInterface.hpp:383
OsiClpSolverInterface::fillParamMaps
void fillParamMaps()
OsiSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
OsiClpSolverInterface::integerInformation_
char * integerInformation_
Pointer to integer information.
Definition: OsiClpSolverInterface.hpp:1424
OsiClpSolverInterface::getBInvACol
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
OsiClpSolverInterface::specialOptions_
unsigned int specialOptions_
Special options 0x80000000 off 0 simple stuff for branch and bound 1 try and keep work regions as muc...
Definition: OsiClpSolverInterface.hpp:1491
OsiClpSolverInterface::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.
OsiClpSolverInterface::numberSOS_
int numberSOS_
Number of SOS sets.
Definition: OsiClpSolverInterface.hpp:1379
OsiClpDisasterHandler::phase_
int phase_
phase 0 initial 1 trying continuing with back in and maybe different perturb 2 trying continuing with...
Definition: OsiClpSolverInterface.hpp:1596
OsiClpSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver&#39;s built-in enumeration algorithm.
ClpLinearObjective.hpp
OsiClpSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiClpSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiClpSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiClpSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
CoinPackedMatrix::getNumElements
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: CoinPackedMatrix.hpp:105
OsiClpSolverInterface::smallestElementInCut_
double smallestElementInCut_
Smallest allowed element in cut.
Definition: OsiClpSolverInterface.hpp:1388
OsiClpSolverInterface::redoScaleFactors
void redoScaleFactors(int numberRows, const CoinBigIndex *starts, const int *indices, const double *elements)
Extend scale factors.
OsiClpSolverInterface::getRowName
virtual std::string getRowName(int rowIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return name of row if one exists or Rnnnnnnn maxLen is currently ignored and only there to match the ...
ClpSimplex::Status
Status
enums for status of various sorts.
Definition: ClpSimplex.hpp:114
OsiClpSolverInterface::lexSolve
void lexSolve()
Sort of lexicographic resolve.
OsiClpSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if variable is binary.
ClpSimplex.hpp
OsiClpSolverInterface::freeCachedResults0
void freeCachedResults0() const
Deletes all mutable stuff for row ranges etc.
OsiClpSolverInterface::lastAlgorithm_
int lastAlgorithm_
Last algorithm used.
Definition: OsiClpSolverInterface.hpp:1412
OsiClpSolverInterface::linearObjective_
double * linearObjective_
Linear objective.
Definition: OsiClpSolverInterface.hpp:1444
OsiClpSolverInterface::setLargestAway
void setLargestAway(double value)
Set largest amount continuous away from bound.
Definition: OsiClpSolverInterface.hpp:1332
ClpModel::objective
double * objective() const
Objective.
Definition: ClpModel.hpp:713
OsiClpSolverInterface::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...
OsiClpSolverInterface::isOptionalInteger
bool isOptionalInteger(int colIndex) const
Return true if column is integer but does not have to be declared as such.
OsiClpSolverInterface::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiClpSolverInterface::passInMessageHandler
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
CoinDoubleArrayWithLength
double * version
Definition: CoinIndexedVector.hpp:678
OsiClpDisasterHandler::setWhereFrom
void setWhereFrom(int value)
Set where from.
Definition: OsiClpSolverInterface.hpp:1551
OsiClpSolverInterface::rowActivity_
double * rowActivity_
also save row and column information for hot starts only used in hotstarts so can be casual ...
Definition: OsiClpSolverInterface.hpp:1374
OsiClpSolverInterface::getBInvRow
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
OsiClpSolverInterface::disableFactorization
virtual void disableFactorization() const
Undo any setting changes made by enableFactorization.
OsiClpSolverInterface::applyRowCuts
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
ClpModel::columnLower
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:750
OsiClpSolverInterface::primalPivotResult
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...
OsiClpSolverInterface::OsiClpSolverInterfaceUnitTest
friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
OsiClpSolverInterface::readLp
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format (with names)
OsiClpSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if variable is general integer.
OsiClpSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiClpSolverInterface::enableSimplexInterface
virtual void enableSimplexInterface(bool doingPrimal)
Enables simplex mode 2 (individual pivot control)
ClpModel::rowUpper
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:544
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiClpSolverInterface::~OsiClpSolverInterface
virtual ~OsiClpSolverInterface()
Destructor.
OsiClpSolverInterface::setSpecialOptionsMutable
void setSpecialOptionsMutable(unsigned int value) const
Set special options in underlying clp solver.
OsiClpSolverInterface::newLanguage
void newLanguage(CoinMessages::Language language)
Set language.
OsiClpSolverInterface::continuousModel_
ClpSimplex * continuousModel_
Continuous model.
Definition: OsiClpSolverInterface.hpp:1497
ClpModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:485
OsiClpSolverInterface::setSpecialOptions
void setSpecialOptions(unsigned int value)
OsiClpSolverInterface::replaceSetInfo
void replaceSetInfo(int numberSOS, CoinSet *setInfo)
Replace setInfo (takes over ownership)
OsiClpSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
Definition: OsiClpSolverInterface.hpp:443
OsiClpSolverInterface::modelPtr_
ClpSimplex * modelPtr_
Clp model represented by this class instance.
Definition: OsiClpSolverInterface.hpp:1354
OsiClpSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiClpSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
Definition: OsiClpSolverInterface.hpp:455
OsiClpSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiClpSolverInterface::copyEnabledSuff
void copyEnabledSuff(OsiClpSolverInterface &rhs)
Copy across enabled stuff from one solver to another.
ClpDisasterHandler
Base class for Clp disaster handling.
Definition: ClpEventHandler.hpp:138
OsiClpSolverInterface::synchronizeModel
virtual void synchronizeModel()
Synchronize model (really if no cuts in tree)
OsiClpSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
Definition: OsiClpSolverInterface.hpp:725
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiClpSolverInterface::smallModel_
ClpSimplex * smallModel_
Alternate model (hot starts) - but also could be permanent and used for crunch.
Definition: OsiClpSolverInterface.hpp:1383
OsiClpSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust one or more bounds).
CoinModel
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:181
OsiClpSolverInterface
Clp Solver Interface.
Definition: OsiClpSolverInterface.hpp:37
OsiClpSolverInterface::swapModelPtr
ClpSimplex * swapModelPtr(ClpSimplex *newModel)
Set pointer to Clp model and return old.
Definition: OsiClpSolverInterface.hpp:1069
OsiClpSolverInterface::getBasics
virtual void getBasics(int *index) const
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBI...
OsiClpSolverInterface::columnScale_
CoinDoubleArrayWithLength columnScale_
Column scale factors (has inverse at end)
Definition: OsiClpSolverInterface.hpp:1505
OsiClpDisasterHandler::typeOfDisaster
virtual int typeOfDisaster()
Type of disaster 0 can fix, 1 abort.
OsiClpDisasterHandler::setPhase
void setPhase(int value)
Set phase.
Definition: OsiClpSolverInterface.hpp:1561
ClpFactorization
This just implements CoinFactorization when an ClpMatrixBase object is passed.
Definition: ClpFactorization.hpp:34
OsiClpSolverInterface::lastNumberRows_
int lastNumberRows_
Number of rows when last &quot;scaled&quot;.
Definition: OsiClpSolverInterface.hpp:1495
CoinWarmStartBasis
The default COIN simplex (basis-oriented) warm start class.
Definition: CoinWarmStartBasis.hpp:40
OsiHintStrength
OsiHintStrength
Definition: OsiSolverParameters.hpp:130
OsiClpSolverInterface::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()...
OsiClpSolverInterface::setSmallestElementInCut
void setSmallestElementInCut(double value)
Set smallest allowed element in cut.
Definition: OsiClpSolverInterface.hpp:1120
OsiClpSolverInterface::setLogLevel
void setLogLevel(int value)
Set log level (will also set underlying solver&#39;s log level)
OsiClpSolverInterface::setColBounds
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
OsiClpSolverInterface::baseModel_
ClpSimplex * baseModel_
Copy of model when option 131072 set.
Definition: OsiClpSolverInterface.hpp:1493
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:345
OsiClpSolverInterface::disableSimplexInterface
virtual void disableSimplexInterface()
Undo setting changes made by enableSimplexInterface.
OsiClpSolverInterface::generateCpp
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
OsiClpSolverInterface::getModelPtr
ClpSimplex * getModelPtr() const
Get pointer to Clp model.
OsiClpSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiClpSolverInterface::getReducedGradient
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Get the reduced gradient for the cost vector c.
CoinFinite.hpp
OsiClpDisasterHandler::phase
int phase() const
Get phase.
Definition: OsiClpSolverInterface.hpp:1566
OsiClpSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
Definition: OsiClpSolverInterface.hpp:403
OsiClpSolverInterface::isHeuristicInteger
bool isHeuristicInteger(int colIndex) const
Return true only if integer and not optional.
Definition: OsiClpSolverInterface.hpp:492
OsiClpSolverInterface::writeMpsNative
virtual int writeMpsNative(const char *filename, const char **rowNames, const char **columnNames, int formatType=0, int numberAcross=2, double objSense=0.0) const
Write the problem into an mps file of the given filename, names may be null.
OsiClpDisasterHandler::whereFrom
int whereFrom() const
Get where from.
Definition: OsiClpSolverInterface.hpp:1556
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:328
OsiClpSolverInterface::canDoSimplexInterface
virtual int canDoSimplexInterface() const
Simplex API capability.
OsiClpSolverInterface::disasterHandler_
OsiClpDisasterHandler * disasterHandler_
Possible disaster handler.
Definition: OsiClpSolverInterface.hpp:1499
OsiClpSolverInterface::crossover
void crossover(int options, int basis)
Solve when primal column and dual row solutions are near-optimal options - 0 no presolve (use primal ...
OsiClpSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiClpSolverInterface::factorization_
ClpFactorization * factorization_
factorization for hot starts
Definition: OsiClpSolverInterface.hpp:1385
OsiClpSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiClpSolverInterface::getSizeU
virtual CoinBigIndex getSizeU() const
Return number of entries in U part of current factorization.
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
OsiClpSolverInterface::setIntegerType
void setIntegerType(int colIndex, int value)
Set integer type (0,1,2=optional,3=sc,4=scint)
Definition: OsiClpSolverInterface.hpp:502
OsiClpSolverInterface::fakeObjective
ClpLinearObjective * fakeObjective() const
Get fake objective.
Definition: OsiClpSolverInterface.hpp:1167
OsiClpSolverInterface::OsiClpSolverInterface
OsiClpSolverInterface()
Default Constructor.
OsiClpSolverInterface::restoreBaseModel
virtual void restoreBaseModel(int numberRows)
Strip off rows to get to this number of rows.
OsiClpSolverInterface::dualPivotResult
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...
OsiClpSolverInterface::findIntegersAndSOS
virtual int findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
OsiClpSolverInterface::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...
OsiClpSolverInterface::specialOptions
unsigned int specialOptions() const
Get special options.
Definition: OsiClpSolverInterface.hpp:1076
OsiClpSolverInterface::downRange
const double * downRange() const
Definition: OsiClpSolverInterface.hpp:1312
OsiClpSolverInterface::spareArrays_
char * spareArrays_
Arrays for hot starts.
Definition: OsiClpSolverInterface.hpp:1396
OsiClpSolverInterface::setBasis
void setBasis()
Just puts current basis_ into ClpSimplex model.
Definition: OsiClpSolverInterface.hpp:1297
OsiClpDisasterHandler::check
virtual bool check() const
Checks if disaster.
OsiClpSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
OsiClpSolverInterface::numberSOS
int numberSOS() const
Number of SOS sets.
Definition: OsiClpSolverInterface.hpp:700
OsiClpSolverInterface::columnActivity_
double * columnActivity_
Definition: OsiClpSolverInterface.hpp:1375
OsiClpSolverInterface::setObjective
virtual void setObjective(const double *array)
Set the objective coefficients for all columns array [getNumCols()] is an array of values for the obj...
OsiClpSolverInterface::smallestChangeInCut_
double smallestChangeInCut_
Smallest change in cut.
Definition: OsiClpSolverInterface.hpp:1392
OsiClpSolverInterface::cleanupScaling_
int cleanupScaling_
Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled...
Definition: OsiClpSolverInterface.hpp:1462
OsiClpSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
Definition: OsiClpSolverInterface.hpp:440
OsiClpSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
OsiClpSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
OsiClpSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiClpSolverInterface.hpp:1362
ClpModel::columnUpper
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:759
OsiClpSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiClpSolverInterface::writeLp
virtual void writeLp(const char *filename, const char *extension="lp", double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
Write the problem into an Lp file of the given filename.
OsiClpSolverInterface::setCleanupScaling
void setCleanupScaling(int value)
Set Scaling option When scaling is on it is possible that the scaled problem is feasible but the unsc...
Definition: OsiClpSolverInterface.hpp:1108
OsiClpHasNDEBUG
bool OsiClpHasNDEBUG()
OsiClpSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
OsiClpSolverInterface::notOwned_
bool notOwned_
To say if destructor should delete underlying model.
Definition: OsiClpSolverInterface.hpp:1415
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
ClpModel::setOptimizationDirection
void setOptimizationDirection(double value)
OsiClpSolverInterface::saveData_
ClpDataSave saveData_
To save data in OsiSimplex stuff.
Definition: OsiClpSolverInterface.hpp:1447
OsiClpSolverInterface::setSolveOptions
void setSolveOptions(const ClpSolve &options)
Pass in initial solve options.
Definition: OsiClpSolverInterface.hpp:1145
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
OsiClpSolverInterface::gutsOfDestructor
void gutsOfDestructor()
The real work of a copy constructor (used by copy and assignment)
OsiClpSolverInterface::getBasis
CoinWarmStartBasis getBasis(ClpSimplex *model) const
Warm start.
OsiClpSolverInterface::infeasibleOtherWay
int infeasibleOtherWay(char *whichWay)
See if any integer variables make infeasible other way.
OsiClpSolverInterface::getConstPointerToWarmStart
const CoinWarmStartBasis * getConstPointerToWarmStart() const
Get warmstarting information.
Definition: OsiClpSolverInterface.hpp:294
OsiClpSolverInterface::setColName
virtual void setColName(int colIndex, std::string name)
Set name of column.
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:87
OsiClpSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
ClpNode.hpp
OsiClpSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
OsiClpSolverInterface::passInRanges
void passInRanges(int *array)
Pass in range array.
Definition: OsiClpSolverInterface.hpp:1317
OsiClpSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiClpDisasterHandler::intoSimplex
virtual void intoSimplex()
Into simplex.
OsiClpDisasterHandler::OsiClpDisasterHandler
OsiClpDisasterHandler(OsiClpSolverInterface *model=NULL)
Default constructor.
OsiClpSolverInterface::crunch
void crunch()
Crunch down problem a bit.
OsiClpSolverInterface::whichRange_
int * whichRange_
Pointer to variables for which we want range information The number is in [0] memory is not owned by ...
Definition: OsiClpSolverInterface.hpp:1430
ClpModel::rowLower
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:535
OsiClpSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiClpSolverInterface::setInfo_
CoinSet * setInfo_
SOS set info.
Definition: OsiClpSolverInterface.hpp:1381
OsiClpSolverInterface::modifyCoefficient
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Definition: OsiClpSolverInterface.hpp:831
OsiClpSolverInterface::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...
OsiClpDisasterHandler::~OsiClpDisasterHandler
virtual ~OsiClpDisasterHandler()
Destructor.
OsiClpSolverInterface::replaceMatrix
virtual void replaceMatrix(const CoinPackedMatrix &matrix)
And if it does matter (not used at present)
OsiClpSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
OsiClpSolverInterface::setRowName
virtual void setRowName(int rowIndex, std::string name)
Set name of row.
OsiClpSolverInterface::setFakeObjective
void setFakeObjective(ClpLinearObjective *fakeObjective)
Set fake objective (and take ownership)
OsiClpSolverInterface::upRange
const double * upRange() const
If doing fast hot start then ranges are computed.
Definition: OsiClpSolverInterface.hpp:1308
OsiClpSolverInterface::itlimOrig_
int itlimOrig_
The original iteration limit before hotstarts started.
Definition: OsiClpSolverInterface.hpp:1400
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1397
OsiClpSolverInterface::setLastAlgorithm
void setLastAlgorithm(int value)
Set last algorithm used , 1 = primal, 2 = dual other unknown.
Definition: OsiClpSolverInterface.hpp:1087
OsiClpSolverInterface::stopFastDual
void stopFastDual()
Stop fast dual.
OsiClpSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiClpSolverInterface::setHintParam
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL)
Set a hint parameter.
OsiClpSolverInterface::modelCut
OsiRowCut * modelCut(const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
Return a conflict analysis cut from model If type is 0 then genuine cut, if 1 then only partially pro...
OsiClpSolverInterface::operator=
OsiClpSolverInterface & operator=(const OsiClpSolverInterface &rhs)
Assignment operator.
OsiClpDisasterHandler::clone
virtual ClpDisasterHandler * clone() const
Clone.
OsiClpSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiClpSolverInterface::setBasisStatus
virtual int setBasisStatus(const int *cstat, const int *rstat)
Set the status of structural/artificial variables and factorize, update solution etc.
OsiClpDisasterHandler::inTrouble_
bool inTrouble_
Are we in trouble.
Definition: OsiClpSolverInterface.hpp:1598
OsiClpSolverInterface::reset
virtual void reset()
Resets as if default constructor.
OsiClpSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiClpSolverInterface.hpp:1418
OsiClpSolverInterface::freeCachedResults
void freeCachedResults() const
Deletes all mutable stuff.
OsiClpSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiClpSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiClpSolverInterface::stuff_
ClpNodeStuff stuff_
Stuff for fast dual.
Definition: OsiClpSolverInterface.hpp:1377
OsiClpSolverInterface::enableFactorization
virtual void enableFactorization() const
Enables simplex mode 1 (tableau access)
OsiClpSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows) ...
Definition: OsiClpSolverInterface.hpp:1367
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiClpSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to constraint matrix).
ClpLinearObjective
Linear Objective Class.
Definition: ClpLinearObjective.hpp:17
OsiClpSolverInterface::getBasisDiff
CoinWarmStartDiff * getBasisDiff(const unsigned char *statusArray) const
Warm start difference from basis_ to statusArray.
OsiClpSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiClpSolverInterface::getSizeL
virtual CoinBigIndex getSizeL() const
Return number of entries in L part of current factorization.
OsiClpSolverInterface::matrixByRowAtContinuous_
CoinPackedMatrix * matrixByRowAtContinuous_
Pointer to row-wise copy of continuous problem matrix coefficients.
Definition: OsiClpSolverInterface.hpp:1421
ClpEventHandler.hpp
OsiClpSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if column is integer.
OsiClpSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
Definition: OsiClpSolverInterface.hpp:377
OsiClpSolverInterface::setRowBounds
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
OsiClpSolverInterface::fakeMinInSimplex_
bool fakeMinInSimplex_
Faking min to get proper dual solution signs in simplex API.
Definition: OsiClpSolverInterface.hpp:1437
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
OsiClpInfinity
static const double OsiClpInfinity
Definition: OsiClpSolverInterface.hpp:27
OsiClpSolverInterface::fakeObjective_
ClpLinearObjective * fakeObjective_
Fake objective.
Definition: OsiClpSolverInterface.hpp:1501
OsiClpSolverInterface::largestAway
double largestAway() const
Get largest amount continuous away from bound.
Definition: OsiClpSolverInterface.hpp:1327
OsiClpSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiClpSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename (defaults to Osi reader) - returns number of errors (see Osi...
OsiClpSolverInterface::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.
OsiClpSolverInterface::getPointerToWarmStart
CoinWarmStartBasis * getPointerToWarmStart()
Get warmstarting information.
Definition: OsiClpSolverInterface.hpp:289
OsiClpSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiClpSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiClpSolverInterface::solveOptions_
ClpSolve solveOptions_
Options for initialSolve.
Definition: OsiClpSolverInterface.hpp:1449
OsiClpSolverInterfaceUnitTest
void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
OsiClpSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if variable is binary and not fixed at either bound.
OsiHintTry
This means it is only a hint.
Definition: OsiSolverParameters.hpp:134
OsiClpSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
OsiClpSolverInterface::getContinuousModel
ClpSimplex * getContinuousModel() const
Get continuous model.
Definition: OsiClpSolverInterface.hpp:1339
OsiClpDisasterHandler::setOsiModel
void setOsiModel(OsiClpSolverInterface *model)
set model.
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
OsiClpSolverInterface::copyEnabledStuff
void copyEnabledStuff(ClpSimplex &rhs)
Copy across enabled stuff from one solver to another.
OsiClpSolverInterface::resolveGub
virtual void resolveGub(int needed)
Resolve an LP relaxation after problem modification (try GUB)
OsiClpSolverInterface::getInfinity
virtual double getInfinity() const
Get solver&#39;s value for infinity.
Definition: OsiClpSolverInterface.hpp:516
OsiSolverInterface.hpp
CoinMessages::Language
Language
Supported languages.
Definition: CoinMessageHandler.hpp:148
ClpModel::modifyCoefficient
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition: ClpModel.hpp:230
OsiClpSolverInterface::largestAway_
double largestAway_
Largest amount continuous away from bound.
Definition: OsiClpSolverInterface.hpp:1394
OsiClpSolverInterface::getColName
virtual std::string getColName(int colIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return name of column if one exists or Cnnnnnnn maxLen is currently ignored and only there to match t...
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
OsiClpSolverInterface::replaceMatrixOptional
virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix)
I (JJF) am getting annoyed because I can&#39;t just replace a matrix.
OsiClpSolverInterface::getMutableMatrixByCol
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get pointer to mutable column-wise copy of matrix.
OsiClpSolverInterface::lastAlgorithm
int lastAlgorithm() const
Last algorithm used , 1 = primal, 2 = dual other unknown.
Definition: OsiClpSolverInterface.hpp:1082
OsiClpSolverInterface::basis_
CoinWarmStartBasis basis_
Warmstart information to be used in resolves.
Definition: OsiClpSolverInterface.hpp:1398
OsiHintParam
OsiHintParam
Definition: OsiSolverParameters.hpp:106
OsiClpSolverInterface::setupForRepeatedUse
void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0)
Set up solver for repeated use by Osi interface.
CoinWarmStartDiff
Abstract base class for warm start `diff&#39; objects.
Definition: CoinWarmStart.hpp:44
OsiClpSolverInterface::smallModelCut
OsiRowCut * smallModelCut(const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
Return a conflict analysis cut from small model.
OsiClpSolverInterface::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...
OsiClpSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
OsiClpSolverInterface::setSOSData
void setSOSData(int numberSOS, const char *type, const int *start, const int *indices, const double *weights=NULL)
Pass in sos stuff from AMPl.
OsiClpDisasterHandler::whereFrom_
int whereFrom_
Where from 0 dual (resolve) 1 crunch 2 primal (resolve) 4 dual (initialSolve) 6 primal (initialSolve)...
Definition: OsiClpSolverInterface.hpp:1588
OsiClpSolverInterface::getBInvCol
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
OsiClpSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiClpSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiClpSolverInterface::getBasisStatus
virtual void getBasisStatus(int *cstat, int *rstat) const
The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasi...
OsiClpSolverInterface::extractSenseRhsRange
void extractSenseRhsRange() const
A method that fills up the rowsense_, rhs_ and rowrange_ arrays.
OsiClpSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiClpSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiClpSolverInterface::setContinuousModel
void setContinuousModel(ClpSimplex *model)
Set continuous model.
Definition: OsiClpSolverInterface.hpp:1344
OsiClpSolverInterface::setSmallestChangeInCut
void setSmallestChangeInCut(double value)
Set smallest change in cut.
Definition: OsiClpSolverInterface.hpp:1140
OsiClpSolverInterface::passInDisasterHandler
void passInDisasterHandler(OsiClpDisasterHandler *handler)
Pass in disaster handler.
OsiClpSolverInterface::tightenBounds
virtual int tightenBounds(int lightweight=0)
Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers...
OsiClpSolverInterface::ws_
CoinWarmStartBasis * ws_
A pointer to the warmstart information to be used in the hotstarts.
Definition: OsiClpSolverInterface.hpp:1371
OsiClpSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiClpSolverInterface::setInfo
const CoinSet * setInfo() const
SOS set info.
Definition: OsiClpSolverInterface.hpp:705
OsiClpSolverInterface::setLanguage
void setLanguage(CoinMessages::Language language)
Definition: OsiClpSolverInterface.hpp:1053
OsiClpSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever &quot;iteration&quot; mean to the solver...
Definition: OsiClpSolverInterface.hpp:539
OsiClpSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
CoinWarmStartBasis.hpp
ClpNodeStuff
Definition: ClpNode.hpp:188
OsiClpSolverInterface::disasterHandler
const OsiClpDisasterHandler * disasterHandler() const
Get disaster handler.
Definition: OsiClpSolverInterface.hpp:1160
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiClpSolverInterface::deleteScaleFactors
void deleteScaleFactors()
Delete all scale factor stuff and reset option.
OsiClpDisasterHandler::operator=
OsiClpDisasterHandler & operator=(const OsiClpDisasterHandler &)
OsiClpSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiClpDisasterHandler::osiModel
OsiClpSolverInterface * osiModel() const
Get model.
Definition: OsiClpSolverInterface.hpp:1546
OsiClpSolverInterface::computeLargestAway
void computeLargestAway()
Compute largest amount any at continuous away from bound.
CoinIndexedVector.hpp
OsiClpSolverInterface::addRows
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
Add a set of rows (constraints) to the problem.
OsiClpSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiClpSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
Definition: OsiClpSolverInterface.hpp:406
OsiClpSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiClpSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiClpSolverInterface::setColumnStatus
void setColumnStatus(int iColumn, ClpSimplex::Status status)
Set column status in ClpSimplex and warmStart.
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
OsiClpSolverInterface::getBInvARow
virtual void getBInvARow(int row, double *z, double *slack=NULL) const
Get a row of the tableau (slack part in slack if not NULL)
OsiClpSolverInterface::integerType
int integerType(int colIndex) const
Return integer type (0,1,2=optional,3=sc,4=scint)
Definition: OsiClpSolverInterface.hpp:497
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:374
OsiClpSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
Definition: OsiClpSolverInterface.hpp:371
OsiClpSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
OsiClpSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiClpSolverInterface::rowScale_
CoinDoubleArrayWithLength rowScale_
Row scale factors (has inverse at end)
Definition: OsiClpSolverInterface.hpp:1503
CoinPackedVector
Sparse Vector.
Definition: CoinPackedVector.hpp:123
OsiClpDisasterHandler::saveInfo
virtual void saveInfo()
saves information for next attempt
OsiClpSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiClpSolverInterface::basisIsAvailable
virtual bool basisIsAvailable() const
Returns true if a basis is available AND problem is optimal.
OsiClpSolverInterface::freeCachedResults1
void freeCachedResults1() const
Deletes all mutable stuff for matrix etc.
OsiClpSolverInterface::cleanupScaling
int cleanupScaling() const
Get scaling action option.
Definition: OsiClpSolverInterface.hpp:1092
OsiClpSolverInterface::getEmptyWarmStart
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
OsiClpSolverInterface::getColType
virtual const char * getColType(bool refresh=false) const
Return array of column length 0 - continuous 1 - binary (may get fixed later) 2 - general integer (ma...
OsiClpSolverInterface::setOptionalInteger
void setOptionalInteger(int index)
Set the index-th variable to be an optional integer variable.
OsiClpSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiClpSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiClpDisasterHandler::inTrouble
bool inTrouble() const
are we in trouble
ClpModel::matrix
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:768
OsiClpSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiClpSolverInterface::smallestElementInCut
double smallestElementInCut() const
Get smallest allowed element in cut.
Definition: OsiClpSolverInterface.hpp:1114
CoinWarmStart
Abstract base class for warm start information.
Definition: CoinWarmStart.hpp:21
OsiClpSolverInterface::smallestChangeInCut
double smallestChangeInCut() const
Get smallest change in cut.
Definition: OsiClpSolverInterface.hpp:1130
OsiClpSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
Definition: OsiClpSolverInterface.hpp:446
OsiClpSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiClpSolverInterface.hpp:1359
OsiClpDisasterHandler::osiModel_
OsiClpSolverInterface * osiModel_
Pointer to model.
Definition: OsiClpSolverInterface.hpp:1580
OsiClpSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
CoinPackedMatrix.hpp
OsiClpSolverInterface::loadFromCoinModel
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
This loads a model from a coinModel object - returns number of errors.
OsiClpSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiClpSolverInterface::startFastDual
int startFastDual(int options)
Start faster dual - returns negative if problems 1 if infeasible, Options to pass to solver 1 - creat...
OsiClpSolverInterface::releaseClp
void releaseClp()
Releases so won&#39;t error.
CoinSet
Very simple class for containing data on set.
Definition: CoinMpsIO.hpp:269
OsiClpSolverInterface::saveBaseModel
virtual void saveBaseModel()
If solver wants it can save a copy of &quot;base&quot; (continuous) model here.