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

- File List
- File Members

ClpModel.hpp
Go to the documentation of this file.
1 /* $Id: ClpModel.hpp 2074 2014-12-10 09:43:54Z forrest $ */
2 // Copyright (C) 2002, 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 ClpModel_H
7 #define ClpModel_H
8
9 #include "ClpConfig.h"
10
11 #include <iostream>
12 #include <cassert>
13 #include <cmath>
14 #include <vector>
15 #include <string>
16 //#ifndef COIN_USE_CLP
17 //#define COIN_USE_CLP
18 //#endif
19 #include "ClpPackedMatrix.hpp"
20 #include "CoinMessageHandler.hpp"
21 #include "CoinHelperFunctions.hpp"
22 #include "CoinTypes.hpp"
23 #include "CoinFinite.hpp"
24 #include "ClpParameters.hpp"
25 #include "ClpObjective.hpp"
26 class ClpEventHandler;
36 class CoinBuild;
37 class CoinModel;
38 class ClpModel {
39
40 public:
41
47 ClpModel (bool emptyMessages = false );
49
54 ClpModel(const ClpModel & rhs, int scalingMode = -1);
56 ClpModel & operator=(const ClpModel & rhs);
61 ClpModel (const ClpModel * wholeModel,
62 int numberRows, const int * whichRows,
63 int numberColumns, const int * whichColumns,
64 bool dropNames = true, bool dropIntegers = true);
66 ~ClpModel ( );
68
82 void loadProblem ( const ClpMatrixBase& matrix,
83 const double* collb, const double* colub,
84 const double* obj,
85 const double* rowlb, const double* rowub,
86 const double * rowObjective = NULL);
87 void loadProblem ( const CoinPackedMatrix& matrix,
88 const double* collb, const double* colub,
89 const double* obj,
90 const double* rowlb, const double* rowub,
91 const double * rowObjective = NULL);
92
95 void loadProblem ( const int numcols, const int numrows,
96 const CoinBigIndex* start, const int* index,
97 const double* value,
98 const double* collb, const double* colub,
99 const double* obj,
100 const double* rowlb, const double* rowub,
101 const double * rowObjective = NULL);
107 int loadProblem ( CoinModel & modelObject, bool tryPlusMinusOne = false);
109 void loadProblem ( const int numcols, const int numrows,
110 const CoinBigIndex* start, const int* index,
111 const double* value, const int * length,
112 const double* collb, const double* colub,
113 const double* obj,
114 const double* rowlb, const double* rowub,
115 const double * rowObjective = NULL);
117 void loadQuadraticObjective(const int numberColumns,
118 const CoinBigIndex * start,
119 const int * column, const double * element);
120 void loadQuadraticObjective ( const CoinPackedMatrix& matrix);
122 void deleteQuadraticObjective();
124 void setRowObjective(const double * rowObjective);
126 int readMps(const char *filename,
127 bool keepNames = false,
128 bool ignoreErrors = false);
130 int readGMPL(const char *filename, const char * dataName,
131 bool keepNames = false);
133 void copyInIntegerInformation(const char * information);
135 void deleteIntegerInformation();
137 void setContinuous(int index);
139 void setInteger(int index);
141 bool isInteger(int index) const;
143 void resize (int newNumberRows, int newNumberColumns);
145 void deleteRows(int number, const int * which);
147 void addRow(int numberInRow, const int * columns,
148 const double * elements, double rowLower = -COIN_DBL_MAX,
149 double rowUpper = COIN_DBL_MAX);
151 void addRows(int number, const double * rowLower,
152 const double * rowUpper,
153 const CoinBigIndex * rowStarts, const int * columns,
154 const double * elements);
156 void addRows(int number, const double * rowLower,
157 const double * rowUpper,
158 const CoinBigIndex * rowStarts, const int * rowLengths,
159 const int * columns,
160 const double * elements);
161 #ifndef CLP_NO_VECTOR
162 void addRows(int number, const double * rowLower,
163 const double * rowUpper,
164 const CoinPackedVectorBase * const * rows);
165 #endif
166
171 int addRows(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
172 bool checkDuplicates = true);
181 int addRows(CoinModel & modelObject, bool tryPlusMinusOne = false,
182 bool checkDuplicates = true);
183
185 void deleteColumns(int number, const int * which);
187 void deleteRowsAndColumns(int numberRows, const int * whichRows,
188 int numberColumns, const int * whichColumns);
190 void addColumn(int numberInColumn,
191 const int * rows,
192 const double * elements,
193 double columnLower = 0.0,
194 double columnUpper = COIN_DBL_MAX,
195 double objective = 0.0);
197 void addColumns(int number, const double * columnLower,
198 const double * columnUpper,
199 const double * objective,
200 const CoinBigIndex * columnStarts, const int * rows,
201 const double * elements);
202 void addColumns(int number, const double * columnLower,
203 const double * columnUpper,
204 const double * objective,
205 const CoinBigIndex * columnStarts, const int * columnLengths,
206 const int * rows,
207 const double * elements);
208 #ifndef CLP_NO_VECTOR
209 void addColumns(int number, const double * columnLower,
210 const double * columnUpper,
211 const double * objective,
212 const CoinPackedVectorBase * const * columns);
213 #endif
214
219 int addColumns(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
220 bool checkDuplicates = true);
228 int addColumns(CoinModel & modelObject, bool tryPlusMinusOne = false,
229 bool checkDuplicates = true);
231 inline void modifyCoefficient(int row, int column, double newElement,
232 bool keepZero = false) {
233 matrix_->modifyCoefficient(row, column, newElement, keepZero);
234 }
236 void chgRowLower(const double * rowLower);
238 void chgRowUpper(const double * rowUpper);
240 void chgColumnLower(const double * columnLower);
242 void chgColumnUpper(const double * columnUpper);
244 void chgObjCoefficients(const double * objIn);
248 void borrowModel(ClpModel & otherModel);
251 void returnModel(ClpModel & otherModel);
252
254 void createEmptyMatrix();
262 int cleanMatrix(double threshold = 1.0e-20);
264 void copy(const ClpMatrixBase * from, ClpMatrixBase * & to);
265 #ifndef CLP_NO_STD
266 void dropNames();
269 void copyNames(const std::vector<std::string> & rowNames,
270 const std::vector<std::string> & columnNames);
272 void copyRowNames(const std::vector<std::string> & rowNames, int first, int last);
274 void copyColumnNames(const std::vector<std::string> & columnNames, int first, int last);
276 void copyRowNames(const char * const * rowNames, int first, int last);
278 void copyColumnNames(const char * const * columnNames, int first, int last);
280 void setRowName(int rowIndex, std::string & name) ;
282 void setColumnName(int colIndex, std::string & name) ;
283 #endif
284
291 int findNetwork(char * rotate, double fractionNeeded = 0.75);
294 CoinModel * createCoinModel() const;
295
308 int writeMps(const char *filename,
309 int formatType = 0, int numberAcross = 2,
310 double objSense = 0.0) const ;
312
314 inline int numberRows() const {
316 return numberRows_;
317 }
318 inline int getNumRows() const {
319 return numberRows_;
320 }
322 inline int getNumCols() const {
323 return numberColumns_;
324 }
325 inline int numberColumns() const {
326 return numberColumns_;
327 }
329 inline double primalTolerance() const {
330 return dblParam_[ClpPrimalTolerance];
331 }
332 void setPrimalTolerance( double value) ;
334 inline double dualTolerance() const {
335 return dblParam_[ClpDualTolerance];
336 }
337 void setDualTolerance( double value) ;
339 inline double primalObjectiveLimit() const {
340 return dblParam_[ClpPrimalObjectiveLimit];
341 }
342 void setPrimalObjectiveLimit(double value);
344 inline double dualObjectiveLimit() const {
345 return dblParam_[ClpDualObjectiveLimit];
346 }
347 void setDualObjectiveLimit(double value);
349 inline double objectiveOffset() const {
350 return dblParam_[ClpObjOffset];
351 }
352 void setObjectiveOffset(double value);
354 inline double presolveTolerance() const {
355 return dblParam_[ClpPresolveTolerance];
356 }
357 #ifndef CLP_NO_STD
358 inline const std::string & problemName() const {
359 return strParam_[ClpProbName];
360 }
361 #endif
362 inline int numberIterations() const {
364 return numberIterations_;
365 }
366 inline int getIterationCount() const {
367 return numberIterations_;
368 }
369 inline void setNumberIterations(int numberIterationsNew) {
370 numberIterations_ = numberIterationsNew;
371 }
373 inline int solveType() const {
374 return solveType_;
375 }
376 inline void setSolveType(int type) {
377 solveType_ = type;
378 }
380 inline int maximumIterations() const {
381 return intParam_[ClpMaxNumIteration];
382 }
383 void setMaximumIterations(int value);
385 inline double maximumSeconds() const {
386 return dblParam_[ClpMaxSeconds];
387 }
388 void setMaximumSeconds(double value);
389 void setMaximumWallSeconds(double value);
391 bool hitMaximumIterations() const;
401 inline int status() const {
402 return problemStatus_;
403 }
404 inline int problemStatus() const {
405 return problemStatus_;
406 }
408 inline void setProblemStatus(int problemStatusNew) {
409 problemStatus_ = problemStatusNew;
410 }
426 inline int secondaryStatus() const {
427 return secondaryStatus_;
428 }
429 inline void setSecondaryStatus(int newstatus) {
430 secondaryStatus_ = newstatus;
431 }
433 inline bool isAbandoned() const {
434 return problemStatus_ == 4;
435 }
437 inline bool isProvenOptimal() const {
438 return problemStatus_ == 0;
439 }
441 inline bool isProvenPrimalInfeasible() const {
442 return problemStatus_ == 1;
443 }
445 inline bool isProvenDualInfeasible() const {
446 return problemStatus_ == 2;
447 }
449 bool isPrimalObjectiveLimitReached() const ;
451 bool isDualObjectiveLimitReached() const ;
453 inline bool isIterationLimitReached() const {
454 return problemStatus_ == 3;
455 }
457 inline double optimizationDirection() const {
458 return optimizationDirection_;
459 }
460 inline double getObjSense() const {
461 return optimizationDirection_;
462 }
463 void setOptimizationDirection(double value);
465 inline double * primalRowSolution() const {
466 return rowActivity_;
467 }
468 inline const double * getRowActivity() const {
469 return rowActivity_;
470 }
472 inline double * primalColumnSolution() const {
473 return columnActivity_;
474 }
475 inline const double * getColSolution() const {
476 return columnActivity_;
477 }
478 inline void setColSolution(const double * input) {
479 memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
480 }
482 inline double * dualRowSolution() const {
483 return dual_;
484 }
485 inline const double * getRowPrice() const {
486 return dual_;
487 }
489 inline double * dualColumnSolution() const {
490 return reducedCost_;
491 }
492 inline const double * getReducedCost() const {
493 return reducedCost_;
494 }
496 inline double* rowLower() const {
497 return rowLower_;
498 }
499 inline const double* getRowLower() const {
500 return rowLower_;
501 }
503 inline double* rowUpper() const {
504 return rowUpper_;
505 }
506 inline const double* getRowUpper() const {
507 return rowUpper_;
508 }
509 //-------------------------------------------------------------------------
513 void setObjectiveCoefficient( int elementIndex, double elementValue );
515 inline void setObjCoeff( int elementIndex, double elementValue ) {
516 setObjectiveCoefficient( elementIndex, elementValue);
517 }
518
521 void setColumnLower( int elementIndex, double elementValue );
522
525 void setColumnUpper( int elementIndex, double elementValue );
526
528 void setColumnBounds( int elementIndex,
529 double lower, double upper );
530
539 void setColumnSetBounds(const int* indexFirst,
540 const int* indexLast,
541 const double* boundList);
542
545 inline void setColLower( int elementIndex, double elementValue ) {
546 setColumnLower(elementIndex, elementValue);
547 }
550 inline void setColUpper( int elementIndex, double elementValue ) {
551 setColumnUpper(elementIndex, elementValue);
552 }
553
555 inline void setColBounds( int elementIndex,
556 double lower, double upper ) {
557 setColumnBounds(elementIndex, lower, upper);
558 }
559
566 inline void setColSetBounds(const int* indexFirst,
567 const int* indexLast,
568 const double* boundList) {
569 setColumnSetBounds(indexFirst, indexLast, boundList);
570 }
571
574 void setRowLower( int elementIndex, double elementValue );
575
578 void setRowUpper( int elementIndex, double elementValue ) ;
579
581 void setRowBounds( int elementIndex,
582 double lower, double upper ) ;
583
590 void setRowSetBounds(const int* indexFirst,
591 const int* indexLast,
592 const double* boundList);
593
595 inline const double * rowScale() const {
597 return rowScale_;
598 }
599 inline const double * columnScale() const {
600 return columnScale_;
601 }
602 inline const double * inverseRowScale() const {
603 return inverseRowScale_;
604 }
605 inline const double * inverseColumnScale() const {
606 return inverseColumnScale_;
607 }
608 inline double * mutableRowScale() const {
609 return rowScale_;
610 }
611 inline double * mutableColumnScale() const {
612 return columnScale_;
613 }
614 inline double * mutableInverseRowScale() const {
615 return inverseRowScale_;
616 }
617 inline double * mutableInverseColumnScale() const {
618 return inverseColumnScale_;
619 }
620 inline double * swapRowScale(double * newScale) {
621 double * oldScale = rowScale_;
622 rowScale_ = newScale;
623 return oldScale;
624 }
625 void setRowScale(double * scale) ;
626 void setColumnScale(double * scale);
628 inline double objectiveScale() const {
629 return objectiveScale_;
630 }
631 inline void setObjectiveScale(double value) {
632 objectiveScale_ = value;
633 }
635 inline double rhsScale() const {
636 return rhsScale_;
637 }
638 inline void setRhsScale(double value) {
639 rhsScale_ = value;
640 }
642 void scaling(int mode = 1);
645 void unscale();
647 inline int scalingFlag() const {
648 return scalingFlag_;
649 }
651 inline double * objective() const {
652 if (objective_) {
653 double offset;
654 return objective_->gradient(NULL, NULL, offset, false);
655 } else {
656 return NULL;
657 }
658 }
659 inline double * objective(const double * solution, double & offset, bool refresh = true) const {
660 offset = 0.0;
661 if (objective_) {
662 return objective_->gradient(NULL, solution, offset, refresh);
663 } else {
664 return NULL;
665 }
666 }
667 inline const double * getObjCoefficients() const {
668 if (objective_) {
669 double offset;
670 return objective_->gradient(NULL, NULL, offset, false);
671 } else {
672 return NULL;
673 }
674 }
676 inline double * rowObjective() const {
677 return rowObjective_;
678 }
679 inline const double * getRowObjCoefficients() const {
680 return rowObjective_;
681 }
683 inline double * columnLower() const {
684 return columnLower_;
685 }
686 inline const double * getColLower() const {
687 return columnLower_;
688 }
690 inline double * columnUpper() const {
691 return columnUpper_;
692 }
693 inline const double * getColUpper() const {
694 return columnUpper_;
695 }
697 inline CoinPackedMatrix * matrix() const {
698 if ( matrix_ == NULL ) return NULL;
699 else return matrix_->getPackedMatrix();
700 }
702 inline int getNumElements() const {
703 return matrix_->getNumElements();
704 }
707 inline double getSmallElementValue() const {
708 return smallElement_;
709 }
710 inline void setSmallElementValue(double value) {
711 smallElement_ = value;
712 }
714 inline ClpMatrixBase * rowCopy() const {
715 return rowCopy_;
716 }
718 void setNewRowCopy(ClpMatrixBase * newCopy);
720 inline ClpMatrixBase * clpMatrix() const {
721 return matrix_;
722 }
724 inline ClpPackedMatrix * clpScaledMatrix() const {
725 return scaledMatrix_;
726 }
728 inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
729 delete scaledMatrix_;
730 scaledMatrix_ = scaledMatrix;
731 }
733 inline ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix * scaledMatrix) {
734 ClpPackedMatrix * oldMatrix = scaledMatrix_;
735 scaledMatrix_ = scaledMatrix;
736 return oldMatrix;
737 }
743 void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
749 inline void replaceMatrix(CoinPackedMatrix * newmatrix,
750 bool deleteCurrent = false) {
751 replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
752 }
754 inline double objectiveValue() const {
755 return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
756 }
757 inline void setObjectiveValue(double value) {
758 objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
759 }
760 inline double getObjValue() const {
761 return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
762 }
764 inline char * integerInformation() const {
765 return integerType_;
766 }
769 double * infeasibilityRay(bool fullRay=false) const;
770 double * unboundedRay() const;
772 inline double * ray() const
773 { return ray_;}
775 inline bool rayExists() const {
776 return (ray_!=NULL);
777 }
779 inline void deleteRay() {
780 delete [] ray_;
781 ray_=NULL;
782 }
784 inline const double * internalRay() const {
785 return ray_;
786 }
788 inline bool statusExists() const {
789 return (status_ != NULL);
790 }
792 inline unsigned char * statusArray() const {
793 return status_;
794 }
797 unsigned char * statusCopy() const;
799 void copyinStatus(const unsigned char * statusArray);
800
802 inline void setUserPointer (void * pointer) {
803 userPointer_ = pointer;
804 }
805 inline void * getUserPointer () const {
806 return userPointer_;
807 }
809 inline void setTrustedUserPointer (ClpTrustedData * pointer) {
810 trustedUserPointer_ = pointer;
811 }
812 inline ClpTrustedData * getTrustedUserPointer () const {
813 return trustedUserPointer_;
814 }
816 inline int whatsChanged() const {
817 return whatsChanged_;
818 }
819 inline void setWhatsChanged(int value) {
820 whatsChanged_ = value;
821 }
823 inline int numberThreads() const {
824 return numberThreads_;
825 }
826 inline void setNumberThreads(int value) {
827 numberThreads_ = value;
828 }
830
832 void passInMessageHandler(CoinMessageHandler * handler);
835 CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
836 bool & oldDefault);
838 void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
840 void newLanguage(CoinMessages::Language language);
841 inline void setLanguage(CoinMessages::Language language) {
842 newLanguage(language);
843 }
845 void setDefaultMessageHandler();
847 inline CoinMessageHandler * messageHandler() const {
848 return handler_;
849 }
851 inline CoinMessages messages() const {
852 return messages_;
853 }
855 inline CoinMessages * messagesPointer() {
856 return & messages_;
857 }
859 inline CoinMessages coinMessages() const {
860 return coinMessages_;
861 }
863 inline CoinMessages * coinMessagesPointer() {
864 return & coinMessages_;
865 }
874 inline void setLogLevel(int value) {
875 handler_->setLogLevel(value);
876 }
877 inline int logLevel() const {
878 return handler_->logLevel();
879 }
881 inline bool defaultHandler() const {
882 return defaultHandler_;
883 }
885 void passInEventHandler(const ClpEventHandler * eventHandler);
887 inline ClpEventHandler * eventHandler() const {
888 return eventHandler_;
889 }
891 inline CoinThreadRandom * randomNumberGenerator() {
892 return &randomNumberGenerator_;
893 }
895 inline CoinThreadRandom & mutableRandomNumberGenerator() {
896 return randomNumberGenerator_;
897 }
899 inline void setRandomSeed(int value) {
900 randomNumberGenerator_.setSeed(value);
901 }
903 inline int lengthNames() const {
904 return lengthNames_;
905 }
906 #ifndef CLP_NO_STD
907 inline void setLengthNames(int value) {
909 lengthNames_ = value;
910 }
912 inline const std::vector<std::string> * rowNames() const {
913 return &rowNames_;
914 }
915 inline const std::string& rowName(int iRow) const {
916 return rowNames_[iRow];
917 }
919 std::string getRowName(int iRow) const;
921 inline const std::vector<std::string> * columnNames() const {
922 return &columnNames_;
923 }
924 inline const std::string& columnName(int iColumn) const {
925 return columnNames_[iColumn];
926 }
928 std::string getColumnName(int iColumn) const;
929 #endif
930 inline ClpObjective * objectiveAsObject() const {
932 return objective_;
933 }
934 void setObjective(ClpObjective * objective);
935 inline void setObjectivePointer(ClpObjective * newobjective) {
936 objective_ = newobjective;
937 }
940 int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
941
943
952 void times(double scalar,
953 const double * x, double * y) const;
957 void transposeTimes(double scalar,
958 const double * x, double * y) const ;
960
961
962 //---------------------------------------------------------------------------
980 bool setIntParam(ClpIntParam key, int value) ;
983 bool setDblParam(ClpDblParam key, double value) ;
984 #ifndef CLP_NO_STD
985 bool setStrParam(ClpStrParam key, const std::string & value);
987 #endif
988 // Get an integer parameter
989 inline bool getIntParam(ClpIntParam key, int& value) const {
990 if (key < ClpLastIntParam) {
991 value = intParam_[key];
992 return true;
993 } else {
994 return false;
995 }
996 }
997 // Get an double parameter
998 inline bool getDblParam(ClpDblParam key, double& value) const {
999 if (key < ClpLastDblParam) {
1000 value = dblParam_[key];
1001 return true;
1002 } else {
1003 return false;
1004 }
1005 }
1006 #ifndef CLP_NO_STD
1007 // Get a string parameter
1008 inline bool getStrParam(ClpStrParam key, std::string& value) const {
1009 if (key < ClpLastStrParam) {
1010 value = strParam_[key];
1011 return true;
1012 } else {
1013 return false;
1014 }
1015 }
1016 #endif
1017 void generateCpp( FILE * fp);
1054 inline unsigned int specialOptions() const {
1055 return specialOptions_;
1056 }
1057 void setSpecialOptions(unsigned int value);
1058 #define COIN_CBC_USING_CLP 0x01000000
1059 inline bool inCbcBranchAndBound() const {
1060 return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1061 }
1063
1066 protected:
1068 void gutsOfDelete(int type);
1072 void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
1074 void getRowBound(int iRow, double& lower, double& upper) const;
1076 void gutsOfLoadModel ( int numberRows, int numberColumns,
1077 const double* collb, const double* colub,
1078 const double* obj,
1079 const double* rowlb, const double* rowub,
1080 const double * rowObjective = NULL);
1082 void gutsOfScaling();
1084 inline double rawObjectiveValue() const {
1085 return objectiveValue_;
1086 }
1088 inline bool permanentArrays() const {
1089 return (specialOptions_ & 65536) != 0;
1090 }
1092 void startPermanentArrays();
1094 void stopPermanentArrays();
1096 const char * const * rowNamesAsChar() const;
1098 const char * const * columnNamesAsChar() const;
1100 void deleteNamesAsChar(const char * const * names, int number) const;
1102 void onStopped();
1104
1105
1107 protected:
1108
1111 double optimizationDirection_;
1114 double dblParam_[ClpLastDblParam];
1116 double objectiveValue_;
1118 double smallElement_;
1120 double objectiveScale_;
1122 double rhsScale_;
1124 int numberRows_;
1126 int numberColumns_;
1128 double * rowActivity_;
1130 double * columnActivity_;
1132 double * dual_;
1134 double * reducedCost_;
1136 double* rowLower_;
1138 double* rowUpper_;
1140 ClpObjective * objective_;
1142 double * rowObjective_;
1144 double * columnLower_;
1146 double * columnUpper_;
1148 ClpMatrixBase * matrix_;
1150 ClpMatrixBase * rowCopy_;
1152 ClpPackedMatrix * scaledMatrix_;
1154 double * ray_;
1156 double * rowScale_;
1158 double * columnScale_;
1160 double * inverseRowScale_;
1162 double * inverseColumnScale_;
1165 int scalingFlag_;
1173 unsigned char * status_;
1175 char * integerType_;
1177 void * userPointer_;
1179 ClpTrustedData * trustedUserPointer_;
1181 int intParam_[ClpLastIntParam];
1183 int numberIterations_;
1185 int solveType_;
1202 #define ROW_COLUMN_COUNTS_SAME 1
1203 #define MATRIX_SAME 2
1204 #define MATRIX_JUST_ROWS_ADDED 4
1205 #define MATRIX_JUST_COLUMNS_ADDED 8
1206 #define ROW_LOWER_SAME 16
1207 #define ROW_UPPER_SAME 32
1208 #define OBJECTIVE_SAME 64
1209 #define COLUMN_LOWER_SAME 128
1210 #define COLUMN_UPPER_SAME 256
1211 #define BASIS_SAME 512
1212 #define ALL_SAME 65339
1213 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1214 unsigned int whatsChanged_;
1216 int problemStatus_;
1218 int secondaryStatus_;
1220 int lengthNames_;
1222 int numberThreads_;
1226 unsigned int specialOptions_;
1228 CoinMessageHandler * handler_;
1230 bool defaultHandler_;
1232 CoinThreadRandom randomNumberGenerator_;
1234 ClpEventHandler * eventHandler_;
1235 #ifndef CLP_NO_STD
1236 std::vector<std::string> rowNames_;
1239 std::vector<std::string> columnNames_;
1240 #endif
1241 CoinMessages messages_;
1244 CoinMessages coinMessages_;
1246 int maximumColumns_;
1248 int maximumRows_;
1250 int maximumInternalColumns_;
1252 int maximumInternalRows_;
1254 CoinPackedMatrix baseMatrix_;
1256 CoinPackedMatrix baseRowCopy_;
1258 double * savedRowScale_;
1260 double * savedColumnScale_;
1261 #ifndef CLP_NO_STD
1262 std::string strParam_[ClpLastStrParam];
1264 #endif
1265
1266 };
1269 class ClpDataSave {
1270
1271 public:
1275 ClpDataSave ( );
1277
1279 ClpDataSave(const ClpDataSave &);
1281 ClpDataSave & operator=(const ClpDataSave & rhs);
1283 ~ClpDataSave ( );
1284
1286
1288 public:
1289
1292 double dualBound_;
1293 double infeasibilityCost_;
1294 double pivotTolerance_;
1295 double zeroFactorizationTolerance_;
1296 double zeroSimplexTolerance_;
1297 double acceptablePivot_;
1298 double objectiveScale_;
1299 int sparseThreshold_;
1300 int perturbation_;
1301 int forceFactorization_;
1302 int scalingFlag_;
1303 unsigned int specialOptions_;
1305 };
1306
1307 #endif
ClpModel::rowNamesAsChar
const char *const * rowNamesAsChar() const
Create row names as char **.
ClpModel::mutableInverseRowScale
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:614
ClpModel::maximumIterations
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:380
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
ClpModel::copyColumnNames
void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
ClpModel::getNumCols
int getNumCols() const
Number of columns.
Definition: ClpModel.hpp:322
ClpDblParam
ClpDblParam
Definition: ClpParameters.hpp:43
ClpModel::trustedUserPointer_
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
Definition: ClpModel.hpp:1179
ClpModel::isAbandoned
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:433
ClpDataSave::sparseThreshold_
int sparseThreshold_
Definition: ClpModel.hpp:1299
ClpModel::setColumnSetBounds
void setColumnSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously The default implementation just invokes setColL...
ClpModel::getUserPointer
void * getUserPointer() const
Definition: ClpModel.hpp:805
ClpModel::getColLower
const double * getColLower() const
Definition: ClpModel.hpp:686
ClpDataSave::pivotTolerance_
double pivotTolerance_
Definition: ClpModel.hpp:1294
ClpModel::integerInformation
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:764
ClpDataSave::scalingFlag_
int scalingFlag_
Definition: ClpModel.hpp:1302
CoinModel
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:161
ClpModel::setSmallElementValue
void setSmallElementValue(double value)
Definition: ClpModel.hpp:710
ClpModel::ray_
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1154
ClpDataSave::acceptablePivot_
double acceptablePivot_
Definition: ClpModel.hpp:1297
ClpDataSave::operator=
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
ClpModel::~ClpModel
~ClpModel()
Destructor.
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:363
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:327
ClpModel::setUserPointer
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:802
ClpModel::setObjectiveCoefficient
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
ClpModel::baseMatrix_
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1254
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1269
ClpModel::numberThreads_
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1222
ClpModel::dualRowSolution
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:482
ClpModel::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1126
ClpDataSave::infeasibilityCost_
double infeasibilityCost_
Definition: ClpModel.hpp:1293
ClpModel::rowUpper_
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1138
ClpModel::primalRowSolution
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:465
ClpModel::objectiveAsObject
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:931
ClpModel::deleteRowsAndColumns
void deleteRowsAndColumns(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Deletes rows AND columns (keeps old sizes)
ClpModel::eventHandler_
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1234
ClpModel::gutsOfDelete
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most)
ClpModel::defaultHandler_
bool defaultHandler_
Flag to say if default handler (so delete)
Definition: ClpModel.hpp:1230
ClpModel::chgRowLower
void chgRowLower(const double *rowLower)
Change row lower bounds.
ClpModel::setColBounds
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:555
ClpModel::rowUpper
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:503
ClpModel::setColumnUpper
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
ClpModel::writeMps
int writeMps(const char *filename, int formatType=0, int numberAcross=2, double objSense=0.0) const
Write the problem in MPS format to the specified file.
ClpModel::solveType
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:373
ClpTrustedData
For a structure to be used by trusted code.
Definition: ClpParameters.hpp:121
ClpObjective
Objective Abstract Base Class.
Definition: ClpObjective.hpp:19
ClpModel::savedColumnScale_
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1260
ClpModel::setNumberThreads
void setNumberThreads(int value)
Definition: ClpModel.hpp:826
ClpModel::setRowSetBounds
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
ClpModel::reducedCost_
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1134
ClpModel::integerType_
char * integerType_
Integer information.
Definition: ClpModel.hpp:1175
ClpModel::copyinStatus
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
ClpModel::isInteger
bool isInteger(int index) const
Return true if the index-th variable is an integer variable.
ClpModel::setDualTolerance
void setDualTolerance(double value)
Number of rows.
ClpPrimalTolerance
The maximum amount the primal constraints can be violated and still be considered feasible...
Definition: ClpParameters.hpp:57
ClpModel::scalingFlag
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:647
ClpModel::dual_
double * dual_
Duals.
Definition: ClpModel.hpp:1132
ClpModel::specialOptions_
unsigned int specialOptions_
For advanced options See get and set for meaning.
Definition: ClpModel.hpp:1226
ClpModel::matrix
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:697
ClpLastStrParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:79
ClpModel::isPrimalObjectiveLimitReached
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
ClpModel::messageHandler
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:847
ClpModel::getTrustedUserPointer
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:812
ClpDataSave::specialOptions_
unsigned int specialOptions_
Definition: ClpModel.hpp:1303
ClpModel::objectiveScale
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:628
ClpModel::objective_
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1140
ClpDataSave::dualBound_
double dualBound_
Definition: ClpModel.hpp:1292
ClpModel::problemStatus_
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1216
ClpModel::objectiveOffset
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:349
ClpModel::status_
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1173
CoinFinite.hpp
ClpModel::onStopped
void onStopped()
On stopped - sets secondary status.
ClpModel::clpScaledMatrix
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:724
ClpModel::loadProblem
void loadProblem(const ClpMatrixBase &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
Loads a problem (the constraints on the rows are given by lower and upper bounds).
ClpModel::findNetwork
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
ClpModel::getIntParam
bool getIntParam(ClpIntParam key, int &value) const
Set an integer parameter.
Definition: ClpModel.hpp:989
ClpModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:457
ClpModel::setColUpper
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition: ClpModel.hpp:550
ClpModel::rowObjective_
double * rowObjective_
Row Objective (? sign) - may be NULL.
Definition: ClpModel.hpp:1142
ClpModel::maximumInternalColumns_
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1250
ClpModel::setColLower
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition: ClpModel.hpp:545
ClpModel::messagesPointer
CoinMessages * messagesPointer()
Return pointer to messages.
Definition: ClpModel.hpp:855
ClpModel::primalColumnSolution
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:472
ClpModel::mutableRandomNumberGenerator
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:895
ClpDataSave::ClpDataSave
ClpDataSave()
Default constructor.
ClpModel::setRowName
void setRowName(int rowIndex, std::string &name)
Set name of row.
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
ClpPrimalObjectiveLimit
Primal objective limit.
Definition: ClpParameters.hpp:51
ClpModel::loadQuadraticObjective
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
Load up quadratic objective.
ClpModel::statusCopy
unsigned char * statusCopy() const
Return copy of status (i.e.
ClpModel::strParam_
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1263
ClpModel::optimizationDirection_
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1112
ClpStrParam
ClpStrParam
Definition: ClpParameters.hpp:73
ClpModel::setObjCoeff
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:515
ClpModel::setTrustedUserPointer
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition: ClpModel.hpp:809
ClpModel::copy
void copy(const ClpMatrixBase *from, ClpMatrixBase *&to)
Copy contents - resizing if necessary - otherwise re-use memory.
ClpModel::returnModel
void returnModel(ClpModel &otherModel)
Return model - nulls all arrays so can be deleted safely also updates any scalars.
CoinHelperFunctions.hpp
ClpModel::status
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:401
ClpMatrixBase::modifyCoefficient
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
ClpLastIntParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:40
ClpModel::isDualObjectiveLimitReached
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
ClpModel::setPrimalObjectiveLimit
void setPrimalObjectiveLimit(double value)
Number of rows.
ClpModel::getColSolution
const double * getColSolution() const
Number of rows.
Definition: ClpModel.hpp:475
ClpModel::replaceMatrix
void replaceMatrix(CoinPackedMatrix *newmatrix, bool deleteCurrent=false)
Replace Clp Matrix (current is not deleted unless told to and new is used) So up to user to delete cu...
Definition: ClpModel.hpp:749
ClpModel::whatsChanged
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:816
ClpModel::dualTolerance
double dualTolerance() const
Dual tolerance to use.
Definition: ClpModel.hpp:334
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
ClpModel::eventHandler
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:887
ClpObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
ClpModel::presolveTolerance
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:354
ClpModel::mutableRowScale
double * mutableRowScale() const
Definition: ClpModel.hpp:608
ClpModel::columnActivity_
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1130
ClpModel::scaling
void scaling(int mode=1)
Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab...
ClpModel::columnScale
const double * columnScale() const
Definition: ClpModel.hpp:599
ClpModel::secondaryStatus
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition: ClpModel.hpp:426
ClpModel::isProvenOptimal
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:437
ClpModel::columnUpper_
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1146
ClpModel::setRowObjective
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
ClpModel::inverseColumnScale
const double * inverseColumnScale() const
Definition: ClpModel.hpp:605
CoinMessageHandler::logLevel
int logLevel() const
Get current log (detail) level.
Definition: CoinMessageHandler.hpp:363
ClpModel::objectiveScale_
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1120
ClpModel::numberThreads
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:823
ClpModel::deleteRows
void deleteRows(int number, const int *which)
Deletes rows.
ClpModel::inverseRowScale_
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
Definition: ClpModel.hpp:1160
ClpModel::getRowUpper
const double * getRowUpper() const
Number of rows.
Definition: ClpModel.hpp:506
ClpModel::stopPermanentArrays
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
ClpModel::savedRowScale_
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1258
ClpModel::rowScale
const double * rowScale() const
Scaling.
Definition: ClpModel.hpp:596
ClpModel::setNewRowCopy
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
ClpModel::rowObjective
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:676
ClpConfig.h
CoinThreadRandom::setSeed
void setSeed(int seed)
Set seed.
Definition: CoinHelperFunctions.hpp:986
ClpModel::statusExists
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition: ClpModel.hpp:788
ClpModel::setColSetBounds
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
Definition: ClpModel.hpp:566
ClpModel::dualColumnSolution
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:489
ClpModel::setColumnBounds
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
ClpModel::cleanMatrix
int cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
ClpModel::whatsChanged_
unsigned int whatsChanged_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1214
ClpModel::getRowLower
const double * getRowLower() const
Number of rows.
Definition: ClpModel.hpp:499
ClpModel::setRowScale
void setRowScale(double *scale)
ClpModel::mutableInverseColumnScale
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:617
ClpModel::dualObjectiveLimit
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:344
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
ClpModel::getReducedCost
const double * getReducedCost() const
Number of rows.
Definition: ClpModel.hpp:492
ClpModel::addRow
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
Add one row.
ClpModel::createCoinModel
CoinModel * createCoinModel() const
This creates a coinModel object.
ClpModel::columnLower_
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1144
ClpModel::scalingFlag_
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows...
Definition: ClpModel.hpp:1165
ClpModel::chgObjCoefficients
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
ClpModel::setStrParam
bool setStrParam(ClpStrParam key, const std::string &value)
Set an string parameter.
ClpModel::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
ClpModel::setRhsScale
void setRhsScale(double value)
Definition: ClpModel.hpp:638
ClpModel::maximumColumns_
int maximumColumns_
Maximum number of columns in model.
Definition: ClpModel.hpp:1246
ClpModel::inverseRowScale
const double * inverseRowScale() const
Definition: ClpModel.hpp:602
ClpModel::objective
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:659
ClpModel::copyRowNames
void copyRowNames(const std::vector< std::string > &rowNames, int first, int last)
Copies in Row names - modifies names first .. last-1.
ClpModel::setDblParam
bool setDblParam(ClpDblParam key, double value)
Set an double parameter.
ClpIntParam
ClpIntParam
This is where to put any useful stuff.
Definition: ClpParameters.hpp:12
COIN_CBC_USING_CLP
#define COIN_CBC_USING_CLP
Definition: ClpModel.hpp:1058
ClpModel::deleteIntegerInformation
void deleteIntegerInformation()
Drop integer informations.
ClpModel::deleteRay
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:779
ClpModel::isProvenPrimalInfeasible
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:441
ClpModel::getStrParam
bool getStrParam(ClpStrParam key, std::string &value) const
Set an integer parameter.
Definition: ClpModel.hpp:1008
ClpModel::setWhatsChanged
void setWhatsChanged(int value)
Definition: ClpModel.hpp:819
ClpModel::rawObjectiveValue
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1084
ClpModel::setObjectiveValue
void setObjectiveValue(double value)
Definition: ClpModel.hpp:757
ClpModel::baseRowCopy_
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1256
ClpModel::deleteNamesAsChar
void deleteNamesAsChar(const char *const *names, int number) const
Delete char * version of names.
ClpModel::getObjSense
double getObjSense() const
Number of rows.
Definition: ClpModel.hpp:460
ClpModel::rowLower
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:496
ClpModel::maximumSeconds
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:385
ClpModel::intParam_
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1181
ClpModel::setSolveType
void setSolveType(int type)
Number of rows.
Definition: ClpModel.hpp:376
ClpModel::gutsOfCopy
void gutsOfCopy(const ClpModel &rhs, int trueCopy=1)
Does most of copying If trueCopy 0 then just points to arrays If -1 leaves as much as possible...
ClpModel::numberColumns
int numberColumns() const
Number of rows.
Definition: ClpModel.hpp:325
ClpModel::defaultHandler
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:881
ClpDataSave::forceFactorization_
int forceFactorization_
Definition: ClpModel.hpp:1301
ClpDataSave::zeroFactorizationTolerance_
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1295
ClpModel::internalRay
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead...
Definition: ClpModel.hpp:784
ClpModel::infeasibilityRay
double * infeasibilityRay(bool fullRay=false) const
Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays...
ClpDataSave::zeroSimplexTolerance_
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1296
ClpLastDblParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:69
ClpMatrixBase::getNumElements
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
ClpModel::numberRows_
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1124
ClpModel::startPermanentArrays
void startPermanentArrays()
Start using maximumRows_ and Columns_.
ClpModel::setColumnName
void setColumnName(int colIndex, std::string &name)
Set name of col.
ClpModel
Definition: ClpModel.hpp:38
ClpModel::coinMessagesPointer
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:863
ClpModel::objectiveValue
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:754
ClpModel::getRowBound
void getRowBound(int iRow, double &lower, double &upper) const
gets lower and upper bounds on rows
ClpModel::getNumElements
int getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:702
ClpModel::rowCopy
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:714
ClpModel::columnNames_
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1239
ClpModel::objectiveValue_
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1116
ClpModel::rayExists
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:775
ClpModel::solveType_
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1185
ClpModel::isIterationLimitReached
bool isIterationLimitReached() const
Iteration limit reached?
Definition: ClpModel.hpp:453
ClpModel::ClpModel
ClpModel(bool emptyMessages=false)
Default constructor.
ClpModel::generateCpp
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
ClpModel::rowName
const std::string & rowName(int iRow) const
Pass in Message handler (not deleted at end)
Definition: ClpModel.hpp:915
ClpModel::readMps
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
ClpModel::addColumns
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
Add columns.
ClpModel::setObjectivePointer
void setObjectivePointer(ClpObjective *newobjective)
Pass in Message handler (not deleted at end)
Definition: ClpModel.hpp:935
ClpModel::addRows
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
Add rows.
ClpDualObjectiveLimit
Set Dual objective limit.
Definition: ClpParameters.hpp:47
ClpModel::statusArray
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:792
ClpModel::getObjValue
double getObjValue() const
Definition: ClpModel.hpp:760
ClpModel::columnNames
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:921
CoinMessageHandler.hpp
This is a first attempt at a message handler.
ClpModel::messages
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:851
ClpDualTolerance
The maximum amount the dual constraints can be violated and still be considered feasible.
Definition: ClpParameters.hpp:54
ClpProbName
Name of the problem.
Definition: ClpParameters.hpp:76
ClpModel::rhsScale_
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1122
ClpPackedMatrix
Definition: ClpPackedMatrix.hpp:21
ClpModel::borrowModel
void borrowModel(ClpModel &otherModel)
Borrow model.
ClpModel::gutsOfScaling
void gutsOfScaling()
Does much of scaling.
ClpModel::setColSolution
void setColSolution(const double *input)
Number of rows.
Definition: ClpModel.hpp:478
ClpEventHandler
Base class for Clp event handling.
Definition: ClpEventHandler.hpp:27
ClpModel::getObjCoefficients
const double * getObjCoefficients() const
Definition: ClpModel.hpp:667
ClpModel::chgColumnLower
void chgColumnLower(const double *columnLower)
Change column lower bounds.
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
ClpModel::setDualObjectiveLimit
void setDualObjectiveLimit(double value)
Number of rows.
ClpModel::problemName
const std::string & problemName() const
Number of rows.
Definition: ClpModel.hpp:358
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpModel::setInteger
void setInteger(int index)
Set the index-th variable to be an integer variable.
ClpModel::getRowPrice
const double * getRowPrice() const
Number of rows.
Definition: ClpModel.hpp:485
ClpModel::clpMatrix
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:720
ClpModel::setMaximumWallSeconds
void setMaximumWallSeconds(double value)
Number of rows.
ClpModel::newLanguage
void newLanguage(CoinMessages::Language language)
Set language.
LAP::scale
void scale(OsiRowCut &cut)
scale the cut passed as argument
ClpModel::setObjective
void setObjective(ClpObjective *objective)
Pass in Message handler (not deleted at end)
ClpModel::secondaryStatus_
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1218
ClpModel::numberIterations_
int numberIterations_
Number of iterations.
Definition: ClpModel.hpp:1183
ClpModel::setOptimizationDirection
void setOptimizationDirection(double value)
Number of rows.
ClpModel::columnUpper
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:690
ClpModel::copyNames
void copyNames(const std::vector< std::string > &rowNames, const std::vector< std::string > &columnNames)
Copies in names.
ClpDataSave::~ClpDataSave
~ClpDataSave()
Destructor.
CoinMessages
Class to hold and manipulate an array of massaged messages.
Definition: CoinMessageHandler.hpp:128
ClpModel::unscale
void unscale()
If we constructed a &quot;really&quot; scaled model then this reverses the operation.
ClpModel::swapScaledMatrix
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:733
ClpModel::setRowUpper
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
ClpModel::getDblParam
bool getDblParam(ClpDblParam key, double &value) const
Set an integer parameter.
Definition: ClpModel.hpp:998
ClpModel::setColumnScale
void setColumnScale(double *scale)
ClpModel::setNumberIterations
void setNumberIterations(int numberIterationsNew)
Number of rows.
Definition: ClpModel.hpp:369
ClpModel::lengthNames_
int lengthNames_
length of names (0 means no names)
Definition: ClpModel.hpp:1220
CoinTypes.hpp
ClpModel::columnNamesAsChar
const char *const * columnNamesAsChar() const
Create column names as char **.
ClpModel::resize
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
ClpMatrixBase::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const =0
Return a complete CoinPackedMatrix.
ClpModel::setMaximumIterations
void setMaximumIterations(int value)
Number of rows.
ClpModel::handler_
CoinMessageHandler * handler_
Message handler.
Definition: ClpModel.hpp:1228
ClpModel::coinMessages_
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1244
ClpModel::setProblemStatus
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:408
ClpModel::mutableColumnScale
double * mutableColumnScale() const
Definition: ClpModel.hpp:611
ClpModel::primalObjectiveLimit
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:339
ClpModel::rowScale_
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1156
ClpModel::setLogLevel
void setLogLevel(int value)
Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - ver...
Definition: ClpModel.hpp:874
ClpModel::transposeTimes
void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpModel::rowNames_
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1237
ClpModel::chgColumnUpper
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
ClpModel::setObjectiveScale
void setObjectiveScale(double value)
Definition: ClpModel.hpp:631
CoinThreadRandom
Class for thread specific random numbers.
Definition: CoinHelperFunctions.hpp:953
ClpModel::isProvenDualInfeasible
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:445
ClpModel::setClpScaledMatrix
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:728
ClpModel::getNumRows
int getNumRows() const
Number of rows.
Definition: ClpModel.hpp:318
ClpModel::setLengthNames
void setLengthNames(int value)
length of names (0 means no names0
Definition: ClpModel.hpp:908
ClpParameters.hpp
ClpModel::readGMPL
int readGMPL(const char *filename, const char *dataName, bool keepNames=false)
Read GMPL files from the given filenames.
ClpModel::dropNames
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpModel::rowLower_
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1136
ClpModel::setContinuous
void setContinuous(int index)
Set the index-th variable to be a continuous variable.
ClpModel::maximumInternalRows_
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1252
ClpModel::rhsScale
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:635
CoinBuild
In many cases it is natural to build a model by adding one row at a time.
Definition: CoinBuild.hpp:27
ClpModel::unboundedRay
double * unboundedRay() const
ClpModel::deleteColumns
void deleteColumns(int number, const int *which)
Deletes columns.
CoinMessageHandler::setLogLevel
void setLogLevel(int value)
Set current log (detail) level.
ClpModel::gutsOfLoadModel
void gutsOfLoadModel(int numberRows, int numberColumns, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
puts in format I like - 4 array matrix - may make row copy
ClpModel::getSmallElementValue
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition: ClpModel.hpp:707
ClpPackedMatrix.hpp
ClpModel::modifyCoefficient
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition: ClpModel.hpp:231
ClpModel::setColumnLower
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
ClpModel::times
void times(double scalar, const double *x, double *y) const
Return y + A * x * scalar in y.
ClpModel::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpModel::setRowLower
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
ClpModel::setMaximumSeconds
void setMaximumSeconds(double value)
Number of rows.
ClpModel::smallElement_
double smallElement_
Small element value.
Definition: ClpModel.hpp:1118
ClpModel::setObjectiveOffset
void setObjectiveOffset(double value)
Number of rows.
ClpMaxSeconds
Maximum time in seconds - after, this action is as max iterations.
Definition: ClpParameters.hpp:62
ClpModel::rowActivity_
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1128
ClpModel::setPrimalTolerance
void setPrimalTolerance(double value)
Number of rows.
ClpModel::objective
double * objective() const
Objective.
Definition: ClpModel.hpp:651
ClpModel::columnName
const std::string & columnName(int iColumn) const
Pass in Message handler (not deleted at end)
Definition: ClpModel.hpp:924
ClpModel::swapRowScale
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:620
ClpModel::userPointer_
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1177
ClpModel::setRandomSeed
void setRandomSeed(int value)
Set seed for thread specific random number generator.
Definition: ClpModel.hpp:899
ClpModel::replaceMatrix
void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent=false)
Replace Clp Matrix (current is not deleted unless told to and new is used) So up to user to delete cu...
ClpModel::columnScale_
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1158
ClpModel::messages_
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1242
ClpObjOffset
Objective function constant.
Definition: ClpParameters.hpp:60
ClpModel::maximumRows_
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1248
ClpModel::logLevel
int logLevel() const
Pass in Message handler (not deleted at end)
Definition: ClpModel.hpp:877
ClpModel::rowNames
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:912
ClpModel::getRowName
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
ClpModel::createEmptyMatrix
void createEmptyMatrix()
Create empty ClpPackedMatrix.
ClpModel::pushMessageHandler
CoinMessageHandler * pushMessageHandler(CoinMessageHandler *handler, bool &oldDefault)
Pass in Message handler (not deleted at end) and return current.
ClpModel::addColumn
void addColumn(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objective=0.0)
Add one column.
ClpModel::randomNumberGenerator
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:891
ClpModel::dblParam_
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1114
ClpModel::primalTolerance
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:329
ClpModel::setSecondaryStatus
void setSecondaryStatus(int newstatus)
Number of rows.
Definition: ClpModel.hpp:429
ClpModel::randomNumberGenerator_
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1232
ClpModel::getColumnName
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpModel::inverseColumnScale_
double * inverseColumnScale_
Inverse column scale factors for matrix (end of columnScale_)
Definition: ClpModel.hpp:1162
ClpModel::inCbcBranchAndBound
bool inCbcBranchAndBound() const
Set an integer parameter.
Definition: ClpModel.hpp:1059
ClpModel::hitMaximumIterations
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
ClpModel::popMessageHandler
void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault)
back to previous message handler
ClpModel::lengthNames
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:903
ClpModel::operator=
ClpModel & operator=(const ClpModel &rhs)
Assignment operator. This copies the data.
ClpModel::copyInIntegerInformation
void copyInIntegerInformation(const char *information)
Copy in integer informations.
ClpModel::problemStatus
int problemStatus() const
Number of rows.
Definition: ClpModel.hpp:404
CoinMessages::Language
Language
Supported languages.
Definition: CoinMessageHandler.hpp:136
ClpModel::scaledMatrix_
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1152
ClpDataSave::objectiveScale_
double objectiveScale_
Definition: ClpModel.hpp:1298
ClpModel::setIntParam
bool setIntParam(ClpIntParam key, int value)
Set an integer parameter.
ClpModel::getRowObjCoefficients
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:679
ClpModel::setDefaultMessageHandler
void setDefaultMessageHandler()
Overrides message handler with a default one.
ClpModel::rowCopy_
ClpMatrixBase * rowCopy_
Row copy if wanted.
Definition: ClpModel.hpp:1150
ClpObjective.hpp
ClpModel::matrix_
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1148
ClpModel::chgRowUpper
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
ClpModel::coinMessages
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:859
ClpModel::setRowBounds
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
ClpMaxNumIteration
The maximum number of iterations Clp can execute in the simplex methods.
Definition: ClpParameters.hpp:15
ClpModel::specialOptions
unsigned int specialOptions() const
For advanced options 1 - Don&#39;t keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1054
ClpModel::setSpecialOptions
void setSpecialOptions(unsigned int value)
Set an integer parameter.
ClpModel::getColUpper
const double * getColUpper() const
Definition: ClpModel.hpp:693
ClpModel::getRowActivity
const double * getRowActivity() const
Number of rows.
Definition: ClpModel.hpp:468
ClpModel::getIterationCount
int getIterationCount() const
Number of rows.
Definition: ClpModel.hpp:366
ClpModel::columnLower
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:683
ClpPresolveTolerance
Tolerance to use in presolve.
Definition: ClpParameters.hpp:66
ClpModel::permanentArrays
bool permanentArrays() const
If we are using maximumRows_ and Columns_.
Definition: ClpModel.hpp:1088
ClpModel::setLanguage
void setLanguage(CoinMessages::Language language)
Pass in Message handler (not deleted at end)
Definition: ClpModel.hpp:841
ClpModel::passInEventHandler
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
ClpDataSave::perturbation_
int perturbation_
Definition: ClpModel.hpp:1300
ClpModel::emptyProblem
int emptyProblem(int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
Solve a problem with no elements - return status and dual and primal infeasibilites.
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:772