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
ClpModel.hpp
Go to the documentation of this file.
1 /* $Id: ClpModel.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
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:
46 ClpModel(bool emptyMessages = false);
48
53 ClpModel(const ClpModel &rhs, int scalingMode = -1);
55 ClpModel &operator=(const ClpModel &rhs);
60 ClpModel(const ClpModel *wholeModel,
61 int numberRows, const int *whichRows,
62 int numberColumns, const int *whichColumns,
63 bool dropNames = true, bool dropIntegers = true);
65 ~ClpModel();
67
81 void loadProblem(const ClpMatrixBase &matrix,
82 const double *collb, const double *colub,
83 const double *obj,
84 const double *rowlb, const double *rowub,
85 const double *rowObjective = NULL);
86 void loadProblem(const CoinPackedMatrix &matrix,
87 const double *collb, const double *colub,
88 const double *obj,
89 const double *rowlb, const double *rowub,
90 const double *rowObjective = NULL);
91
94 void loadProblem(const int numcols, const int numrows,
95 const CoinBigIndex *start, const int *index,
96 const double *value,
97 const double *collb, const double *colub,
98 const double *obj,
99 const double *rowlb, const double *rowub,
100 const double *rowObjective = NULL);
106 int loadProblem(CoinModel &modelObject, bool tryPlusMinusOne = false);
108 void loadProblem(const int numcols, const int numrows,
109 const CoinBigIndex *start, const int *index,
110 const double *value, const int *length,
111 const double *collb, const double *colub,
112 const double *obj,
113 const double *rowlb, const double *rowub,
114 const double *rowObjective = NULL);
116 void loadQuadraticObjective(const int numberColumns,
117 const CoinBigIndex *start,
118 const int *column, const double *element);
119 void loadQuadraticObjective(const CoinPackedMatrix &matrix);
121 void deleteQuadraticObjective();
123 void setRowObjective(const double *rowObjective);
125 int readMps(const char *filename,
126 bool keepNames = false,
127 bool ignoreErrors = false);
129 int readGMPL(const char *filename, const char *dataName,
130 bool keepNames = false);
132 void copyInIntegerInformation(const char *information);
134 void deleteIntegerInformation();
136 void setContinuous(int index);
138 void setInteger(int index);
140 bool isInteger(int index) const;
142 void resize(int newNumberRows, int newNumberColumns);
144 void deleteRows(int number, const int *which);
146 void addRow(int numberInRow, const int *columns,
147 const double *elements, double rowLower = -COIN_DBL_MAX,
148 double rowUpper = COIN_DBL_MAX);
150 void addRows(int number, const double *rowLower,
151 const double *rowUpper,
152 const CoinBigIndex *rowStarts, const int *columns,
153 const double *elements);
155 void addRows(int number, const double *rowLower,
156 const double *rowUpper,
157 const CoinBigIndex *rowStarts, const int *rowLengths,
158 const int *columns,
159 const double *elements);
160 #ifndef CLP_NO_VECTOR
161 void addRows(int number, const double *rowLower,
162 const double *rowUpper,
163 const CoinPackedVectorBase *const *rows);
164 #endif
165
170 int addRows(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
171 bool checkDuplicates = true);
180 int addRows(CoinModel &modelObject, bool tryPlusMinusOne = false,
181 bool checkDuplicates = true);
182
184 void deleteColumns(int number, const int *which);
186 void deleteRowsAndColumns(int numberRows, const int *whichRows,
187 int numberColumns, const int *whichColumns);
189 void addColumn(int numberInColumn,
190 const int *rows,
191 const double *elements,
192 double columnLower = 0.0,
193 double columnUpper = COIN_DBL_MAX,
194 double objective = 0.0);
196 void addColumns(int number, const double *columnLower,
197 const double *columnUpper,
198 const double *objective,
199 const CoinBigIndex *columnStarts, const int *rows,
200 const double *elements);
201 void addColumns(int number, const double *columnLower,
202 const double *columnUpper,
203 const double *objective,
204 const CoinBigIndex *columnStarts, const int *columnLengths,
205 const int *rows,
206 const double *elements);
207 #ifndef CLP_NO_VECTOR
208 void addColumns(int number, const double *columnLower,
209 const double *columnUpper,
210 const double *objective,
211 const CoinPackedVectorBase *const *columns);
212 #endif
213
218 int addColumns(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
219 bool checkDuplicates = true);
227 int addColumns(CoinModel &modelObject, bool tryPlusMinusOne = false,
228 bool checkDuplicates = true);
230 inline void modifyCoefficient(int row, int column, double newElement,
231 bool keepZero = false)
232 {
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 CoinBigIndex 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 {
317 return numberRows_;
318 }
319 inline int getNumRows() const
320 {
321 return numberRows_;
322 }
324 inline int getNumCols() const
325 {
326 return numberColumns_;
327 }
328 inline int numberColumns() const
329 {
330 return numberColumns_;
331 }
333 inline double primalTolerance() const
334 {
335 return dblParam_[ClpPrimalTolerance];
336 }
337 void setPrimalTolerance(double value);
339 inline double dualTolerance() const
340 {
341 return dblParam_[ClpDualTolerance];
342 }
343 void setDualTolerance(double value);
345 inline double primalObjectiveLimit() const
346 {
347 return dblParam_[ClpPrimalObjectiveLimit];
348 }
349 void setPrimalObjectiveLimit(double value);
351 inline double dualObjectiveLimit() const
352 {
353 return dblParam_[ClpDualObjectiveLimit];
354 }
355 void setDualObjectiveLimit(double value);
357 inline double objectiveOffset() const
358 {
359 return dblParam_[ClpObjOffset];
360 }
361 void setObjectiveOffset(double value);
363 inline double presolveTolerance() const
364 {
365 return dblParam_[ClpPresolveTolerance];
366 }
367 #ifndef CLP_NO_STD
368 inline const std::string &problemName() const
369 {
370 return strParam_[ClpProbName];
371 }
372 #endif
373 inline int numberIterations() const
375 {
376 return numberIterations_;
377 }
378 inline int getIterationCount() const
379 {
380 return numberIterations_;
381 }
382 inline void setNumberIterations(int numberIterationsNew)
383 {
384 numberIterations_ = numberIterationsNew;
385 }
387 inline int solveType() const
388 {
389 return solveType_;
390 }
391 inline void setSolveType(int type)
392 {
393 solveType_ = type;
394 }
396 inline int maximumIterations() const
397 {
398 return intParam_[ClpMaxNumIteration];
399 }
400 void setMaximumIterations(int value);
402 inline double maximumSeconds() const
403 {
404 return dblParam_[ClpMaxSeconds];
405 }
406 void setMaximumSeconds(double value);
407 void setMaximumWallSeconds(double value);
409 bool hitMaximumIterations() const;
419 inline int status() const
420 {
421 return problemStatus_;
422 }
423 inline int problemStatus() const
424 {
425 return problemStatus_;
426 }
428 inline void setProblemStatus(int problemStatusNew)
429 {
430 problemStatus_ = problemStatusNew;
431 }
447 inline int secondaryStatus() const
448 {
449 return secondaryStatus_;
450 }
451 inline void setSecondaryStatus(int newstatus)
452 {
453 secondaryStatus_ = newstatus;
454 }
456 inline bool isAbandoned() const
457 {
458 return problemStatus_ == 4;
459 }
461 inline bool isProvenOptimal() const
462 {
463 return problemStatus_ == 0;
464 }
466 inline bool isProvenPrimalInfeasible() const
467 {
468 return problemStatus_ == 1;
469 }
471 inline bool isProvenDualInfeasible() const
472 {
473 return problemStatus_ == 2;
474 }
476 bool isPrimalObjectiveLimitReached() const;
478 bool isDualObjectiveLimitReached() const;
480 inline bool isIterationLimitReached() const
481 {
482 return problemStatus_ == 3;
483 }
485 inline double optimizationDirection() const
486 {
487 return optimizationDirection_;
488 }
489 inline double getObjSense() const
490 {
491 return optimizationDirection_;
492 }
493 void setOptimizationDirection(double value);
495 inline double *primalRowSolution() const
496 {
497 return rowActivity_;
498 }
499 inline const double *getRowActivity() const
500 {
501 return rowActivity_;
502 }
504 inline double *primalColumnSolution() const
505 {
506 return columnActivity_;
507 }
508 inline const double *getColSolution() const
509 {
510 return columnActivity_;
511 }
512 inline void setColSolution(const double *input)
513 {
514 memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
515 }
517 inline double *dualRowSolution() const
518 {
519 return dual_;
520 }
521 inline const double *getRowPrice() const
522 {
523 return dual_;
524 }
526 inline double *dualColumnSolution() const
527 {
528 return reducedCost_;
529 }
530 inline const double *getReducedCost() const
531 {
532 return reducedCost_;
533 }
535 inline double *rowLower() const
536 {
537 return rowLower_;
538 }
539 inline const double *getRowLower() const
540 {
541 return rowLower_;
542 }
544 inline double *rowUpper() const
545 {
546 return rowUpper_;
547 }
548 inline const double *getRowUpper() const
549 {
550 return rowUpper_;
551 }
552 //-------------------------------------------------------------------------
556 void setObjectiveCoefficient(int elementIndex, double elementValue);
558 inline void setObjCoeff(int elementIndex, double elementValue)
559 {
560 setObjectiveCoefficient(elementIndex, elementValue);
561 }
562
565 void setColumnLower(int elementIndex, double elementValue);
566
569 void setColumnUpper(int elementIndex, double elementValue);
570
572 void setColumnBounds(int elementIndex,
573 double lower, double upper);
574
583 void setColumnSetBounds(const int *indexFirst,
584 const int *indexLast,
585 const double *boundList);
586
589 inline void setColLower(int elementIndex, double elementValue)
590 {
591 setColumnLower(elementIndex, elementValue);
592 }
595 inline void setColUpper(int elementIndex, double elementValue)
596 {
597 setColumnUpper(elementIndex, elementValue);
598 }
599
601 inline void setColBounds(int elementIndex,
602 double lower, double upper)
603 {
604 setColumnBounds(elementIndex, lower, upper);
605 }
606
613 inline void setColSetBounds(const int *indexFirst,
614 const int *indexLast,
615 const double *boundList)
616 {
617 setColumnSetBounds(indexFirst, indexLast, boundList);
618 }
619
622 void setRowLower(int elementIndex, double elementValue);
623
626 void setRowUpper(int elementIndex, double elementValue);
627
629 void setRowBounds(int elementIndex,
630 double lower, double upper);
631
638 void setRowSetBounds(const int *indexFirst,
639 const int *indexLast,
640 const double *boundList);
641
643 inline const double *rowScale() const
645 {
646 return rowScale_;
647 }
648 inline const double *columnScale() const
649 {
650 return columnScale_;
651 }
652 inline const double *inverseRowScale() const
653 {
654 return inverseRowScale_;
655 }
656 inline const double *inverseColumnScale() const
657 {
658 return inverseColumnScale_;
659 }
660 inline double *mutableRowScale() const
661 {
662 return rowScale_;
663 }
664 inline double *mutableColumnScale() const
665 {
666 return columnScale_;
667 }
668 inline double *mutableInverseRowScale() const
669 {
670 return inverseRowScale_;
671 }
672 inline double *mutableInverseColumnScale() const
673 {
674 return inverseColumnScale_;
675 }
676 inline double *swapRowScale(double *newScale)
677 {
678 double *oldScale = rowScale_;
679 rowScale_ = newScale;
680 return oldScale;
681 }
682 void setRowScale(double *scale);
683 void setColumnScale(double *scale);
685 inline double objectiveScale() const
686 {
687 return objectiveScale_;
688 }
689 inline void setObjectiveScale(double value)
690 {
691 objectiveScale_ = value;
692 }
694 inline double rhsScale() const
695 {
696 return rhsScale_;
697 }
698 inline void setRhsScale(double value)
699 {
700 rhsScale_ = value;
701 }
703 void scaling(int mode = 1);
706 void unscale();
708 inline int scalingFlag() const
709 {
710 return scalingFlag_;
711 }
713 inline double *objective() const
714 {
715 if (objective_) {
716 double offset;
717 return objective_->gradient(NULL, NULL, offset, false);
718 } else {
719 return NULL;
720 }
721 }
722 inline double *objective(const double *solution, double &offset, bool refresh = true) const
723 {
724 offset = 0.0;
725 if (objective_) {
726 return objective_->gradient(NULL, solution, offset, refresh);
727 } else {
728 return NULL;
729 }
730 }
731 inline const double *getObjCoefficients() const
732 {
733 if (objective_) {
734 double offset;
735 return objective_->gradient(NULL, NULL, offset, false);
736 } else {
737 return NULL;
738 }
739 }
741 inline double *rowObjective() const
742 {
743 return rowObjective_;
744 }
745 inline const double *getRowObjCoefficients() const
746 {
747 return rowObjective_;
748 }
750 inline double *columnLower() const
751 {
752 return columnLower_;
753 }
754 inline const double *getColLower() const
755 {
756 return columnLower_;
757 }
759 inline double *columnUpper() const
760 {
761 return columnUpper_;
762 }
763 inline const double *getColUpper() const
764 {
765 return columnUpper_;
766 }
768 inline CoinPackedMatrix *matrix() const
769 {
770 if (matrix_ == NULL)
771 return NULL;
772 else
773 return matrix_->getPackedMatrix();
774 }
776 inline CoinBigIndex getNumElements() const
777 {
778 return matrix_->getNumElements();
779 }
782 inline double getSmallElementValue() const
783 {
784 return smallElement_;
785 }
786 inline void setSmallElementValue(double value)
787 {
788 smallElement_ = value;
789 }
791 inline ClpMatrixBase *rowCopy() const
792 {
793 return rowCopy_;
794 }
796 void setNewRowCopy(ClpMatrixBase *newCopy);
798 inline ClpMatrixBase *clpMatrix() const
799 {
800 return matrix_;
801 }
803 inline ClpPackedMatrix *clpScaledMatrix() const
804 {
805 return scaledMatrix_;
806 }
808 inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
809 {
810 delete scaledMatrix_;
811 scaledMatrix_ = scaledMatrix;
812 }
814 inline ClpPackedMatrix *swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
815 {
816 ClpPackedMatrix *oldMatrix = scaledMatrix_;
817 scaledMatrix_ = scaledMatrix;
818 return oldMatrix;
819 }
825 void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent = false);
831 inline void replaceMatrix(CoinPackedMatrix *newmatrix,
832 bool deleteCurrent = false)
833 {
834 replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
835 }
837 inline double objectiveValue() const
838 {
839 return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
840 }
841 inline void setObjectiveValue(double value)
842 {
843 objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
844 }
845 inline double getObjValue() const
846 {
847 return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
848 }
850 inline char *integerInformation() const
851 {
852 return integerType_;
853 }
856 double *infeasibilityRay(bool fullRay = false) const;
857 double *unboundedRay() const;
859 inline double *ray() const
860 {
861 return ray_;
862 }
864 inline bool rayExists() const
865 {
866 return (ray_ != NULL);
867 }
869 inline void deleteRay()
870 {
871 delete[] ray_;
872 ray_ = NULL;
873 }
875 inline const double *internalRay() const
876 {
877 return ray_;
878 }
880 inline bool statusExists() const
881 {
882 return (status_ != NULL);
883 }
885 inline unsigned char *statusArray() const
886 {
887 return status_;
888 }
891 unsigned char *statusCopy() const;
893 void copyinStatus(const unsigned char *statusArray);
894
896 inline void setUserPointer(void *pointer)
897 {
898 userPointer_ = pointer;
899 }
900 inline void *getUserPointer() const
901 {
902 return userPointer_;
903 }
905 inline void setTrustedUserPointer(ClpTrustedData *pointer)
906 {
907 trustedUserPointer_ = pointer;
908 }
909 inline ClpTrustedData *getTrustedUserPointer() const
910 {
911 return trustedUserPointer_;
912 }
914 inline int whatsChanged() const
915 {
916 return whatsChanged_;
917 }
918 inline void setWhatsChanged(int value)
919 {
920 whatsChanged_ = value;
921 }
923 inline int numberThreads() const
924 {
925 return numberThreads_;
926 }
927 inline void setNumberThreads(int value)
928 {
929 numberThreads_ = value;
930 }
932
934 void passInMessageHandler(CoinMessageHandler *handler);
937 CoinMessageHandler *pushMessageHandler(CoinMessageHandler *handler,
938 bool &oldDefault);
940 void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault);
942 void newLanguage(CoinMessages::Language language);
943 inline void setLanguage(CoinMessages::Language language)
944 {
945 newLanguage(language);
946 }
948 void setDefaultMessageHandler();
950 inline CoinMessageHandler *messageHandler() const
951 {
952 return handler_;
953 }
955 inline CoinMessages messages() const
956 {
957 return messages_;
958 }
960 inline CoinMessages *messagesPointer()
961 {
962 return &messages_;
963 }
965 inline CoinMessages coinMessages() const
966 {
967 return coinMessages_;
968 }
970 inline CoinMessages *coinMessagesPointer()
971 {
972 return &coinMessages_;
973 }
982 inline void setLogLevel(int value)
983 {
984 handler_->setLogLevel(value);
985 }
986 inline int logLevel() const
987 {
988 return handler_->logLevel();
989 }
991 inline bool defaultHandler() const
992 {
993 return defaultHandler_;
994 }
996 void passInEventHandler(const ClpEventHandler *eventHandler);
998 inline ClpEventHandler *eventHandler() const
999 {
1000 return eventHandler_;
1001 }
1003 inline CoinThreadRandom *randomNumberGenerator()
1004 {
1005 return &randomNumberGenerator_;
1006 }
1008 inline CoinThreadRandom &mutableRandomNumberGenerator()
1009 {
1010 return randomNumberGenerator_;
1011 }
1013 inline void setRandomSeed(int value)
1014 {
1015 randomNumberGenerator_.setSeed(value);
1016 }
1018 inline int lengthNames() const
1019 {
1020 return lengthNames_;
1021 }
1022 #ifndef CLP_NO_STD
1023 inline void setLengthNames(int value)
1025 {
1026 lengthNames_ = value;
1027 }
1029 inline const std::vector< std::string > *rowNames() const
1030 {
1031 return &rowNames_;
1032 }
1033 inline const std::string &rowName(int iRow) const
1034 {
1035 return rowNames_[iRow];
1036 }
1038 std::string getRowName(int iRow) const;
1040 inline const std::vector< std::string > *columnNames() const
1041 {
1042 return &columnNames_;
1043 }
1044 inline const std::string &columnName(int iColumn) const
1045 {
1046 return columnNames_[iColumn];
1047 }
1049 std::string getColumnName(int iColumn) const;
1050 #endif
1051 inline ClpObjective *objectiveAsObject() const
1053 {
1054 return objective_;
1055 }
1056 void setObjective(ClpObjective *objective);
1057 inline void setObjectivePointer(ClpObjective *newobjective)
1058 {
1059 objective_ = newobjective;
1060 }
1063 int emptyProblem(int *infeasNumber = NULL, double *infeasSum = NULL, bool printMessage = true);
1064
1066
1075 void times(double scalar,
1076 const double *x, double *y) const;
1080 void transposeTimes(double scalar,
1081 const double *x, double *y) const;
1083
1084 //---------------------------------------------------------------------------
1102 bool setIntParam(ClpIntParam key, int value);
1105 bool setDblParam(ClpDblParam key, double value);
1106 #ifndef CLP_NO_STD
1107 bool setStrParam(ClpStrParam key, const std::string &value);
1109 #endif
1110 // Get an integer parameter
1111 inline bool getIntParam(ClpIntParam key, int &value) const
1112 {
1113 if (key < ClpLastIntParam) {
1114 value = intParam_[key];
1115 return true;
1116 } else {
1117 return false;
1118 }
1119 }
1120 // Get an double parameter
1121 inline bool getDblParam(ClpDblParam key, double &value) const
1122 {
1123 if (key < ClpLastDblParam) {
1124 value = dblParam_[key];
1125 return true;
1126 } else {
1127 return false;
1128 }
1129 }
1130 #ifndef CLP_NO_STD
1131 // Get a string parameter
1132 inline bool getStrParam(ClpStrParam key, std::string &value) const
1133 {
1134 if (key < ClpLastStrParam) {
1135 value = strParam_[key];
1136 return true;
1137 } else {
1138 return false;
1139 }
1140 }
1141 #endif
1142 void generateCpp(FILE *fp);
1180 inline unsigned int specialOptions() const
1181 {
1182 return specialOptions_;
1183 }
1184 void setSpecialOptions(unsigned int value);
1185 #define COIN_CBC_USING_CLP 0x01000000
1186 inline bool inCbcBranchAndBound() const
1187 {
1188 return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1189 }
1191
1194 protected:
1196 void gutsOfDelete(int type);
1200 void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1202 void getRowBound(int iRow, double &lower, double &upper) const;
1204 void gutsOfLoadModel(int numberRows, int numberColumns,
1205 const double *collb, const double *colub,
1206 const double *obj,
1207 const double *rowlb, const double *rowub,
1208 const double *rowObjective = NULL);
1210 void gutsOfScaling();
1212 inline double rawObjectiveValue() const
1213 {
1214 return objectiveValue_;
1215 }
1217 inline bool permanentArrays() const
1218 {
1219 return (specialOptions_ & 65536) != 0;
1220 }
1222 void startPermanentArrays();
1224 void stopPermanentArrays();
1226 const char *const *rowNamesAsChar() const;
1228 const char *const *columnNamesAsChar() const;
1230 void deleteNamesAsChar(const char *const *names, int number) const;
1232 void onStopped();
1234
1236 protected:
1239 double optimizationDirection_;
1242 double dblParam_[ClpLastDblParam];
1244 double objectiveValue_;
1246 double smallElement_;
1248 double objectiveScale_;
1250 double rhsScale_;
1252 int numberRows_;
1254 int numberColumns_;
1256 double *rowActivity_;
1258 double *columnActivity_;
1260 double *dual_;
1262 double *reducedCost_;
1264 double *rowLower_;
1266 double *rowUpper_;
1268 ClpObjective *objective_;
1270 double *rowObjective_;
1272 double *columnLower_;
1274 double *columnUpper_;
1276 ClpMatrixBase *matrix_;
1278 ClpMatrixBase *rowCopy_;
1280 ClpPackedMatrix *scaledMatrix_;
1282 double *ray_;
1284 double *rowScale_;
1286 double *columnScale_;
1288 double *inverseRowScale_;
1290 double *inverseColumnScale_;
1293 int scalingFlag_;
1301 unsigned char *status_;
1303 char *integerType_;
1305 void *userPointer_;
1307 ClpTrustedData *trustedUserPointer_;
1309 int intParam_[ClpLastIntParam];
1311 int numberIterations_;
1313 int solveType_;
1330 #define ROW_COLUMN_COUNTS_SAME 1
1331 #define MATRIX_SAME 2
1332 #define MATRIX_JUST_ROWS_ADDED 4
1333 #define MATRIX_JUST_COLUMNS_ADDED 8
1334 #define ROW_LOWER_SAME 16
1335 #define ROW_UPPER_SAME 32
1336 #define OBJECTIVE_SAME 64
1337 #define COLUMN_LOWER_SAME 128
1338 #define COLUMN_UPPER_SAME 256
1339 #define BASIS_SAME 512
1340 #define ALL_SAME 65339
1341 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1342 unsigned int whatsChanged_;
1344 int problemStatus_;
1346 int secondaryStatus_;
1348 int lengthNames_;
1350 int numberThreads_;
1354 unsigned int specialOptions_;
1356 CoinMessageHandler *handler_;
1358 bool defaultHandler_;
1360 CoinThreadRandom randomNumberGenerator_;
1362 ClpEventHandler *eventHandler_;
1363 #ifndef CLP_NO_STD
1364 std::vector< std::string > rowNames_;
1367 std::vector< std::string > columnNames_;
1368 #endif
1369 CoinMessages messages_;
1372 CoinMessages coinMessages_;
1374 int maximumColumns_;
1376 int maximumRows_;
1378 int maximumInternalColumns_;
1380 int maximumInternalRows_;
1382 CoinPackedMatrix baseMatrix_;
1384 CoinPackedMatrix baseRowCopy_;
1386 double *savedRowScale_;
1388 double *savedColumnScale_;
1389 #ifndef CLP_NO_STD
1390 std::string strParam_[ClpLastStrParam];
1392 #endif
1393
1394 };
1397 class ClpDataSave {
1398
1399 public:
1403 ClpDataSave();
1405
1407 ClpDataSave(const ClpDataSave &);
1409 ClpDataSave &operator=(const ClpDataSave &rhs);
1411 ~ClpDataSave();
1412
1414
1416 public:
1419 double dualBound_;
1420 double infeasibilityCost_;
1421 double pivotTolerance_;
1422 double zeroFactorizationTolerance_;
1423 double zeroSimplexTolerance_;
1424 double acceptablePivot_;
1425 double objectiveScale_;
1426 int sparseThreshold_;
1427 int perturbation_;
1428 int forceFactorization_;
1429 int scalingFlag_;
1430 unsigned int specialOptions_;
1432 };
1433
1434 #endif
1435
1436 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1437 */
ClpModel::isPrimalObjectiveLimitReached
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:859
CoinHelperFunctions.hpp
ClpModel::randomNumberGenerator
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1003
ClpDataSave::operator=
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
ClpDataSave::~ClpDataSave
~ClpDataSave()
Destructor.
ClpModel::optimizationDirection_
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1240
ClpModel::primalTolerance
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:333
ClpModel::lengthNames
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:1018
ClpModel::savedColumnScale_
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1388
ClpModel::setClpScaledMatrix
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:808
ClpModel::objectiveScale_
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1248
ClpPrimalTolerance
The maximum amount the primal constraints can be violated and still be considered feasible...
Definition: ClpParameters.hpp:57
ClpModel::mutableInverseRowScale
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:668
ClpModel::getColSolution
const double * getColSolution() const
Definition: ClpModel.hpp:508
ClpModel::startPermanentArrays
void startPermanentArrays()
Start using maximumRows_ and Columns_.
ClpMaxNumIteration
The maximum number of iterations Clp can execute in the simplex methods.
Definition: ClpParameters.hpp:15
ClpModel::inverseColumnScale_
double * inverseColumnScale_
Inverse column scale factors for matrix (end of columnScale_)
Definition: ClpModel.hpp:1290
ClpModel::copy
void copy(const ClpMatrixBase *from, ClpMatrixBase *&to)
Copy contents - resizing if necessary - otherwise re-use memory.
ClpModel::setIntParam
bool setIntParam(ClpIntParam key, int value)
Set an integer parameter.
ClpModel::gutsOfDelete
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most)
ClpModel::getNumRows
int getNumRows() const
Definition: ClpModel.hpp:319
ClpModel::rowCopy
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:791
ClpModel::rowUpper_
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1266
ClpModel::mutableRowScale
double * mutableRowScale() const
Definition: ClpModel.hpp:660
ClpModel::dblParam_
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1242
ClpModel::secondaryStatus_
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1346
ClpModel::copyColumnNames
void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
ClpModel::secondaryStatus
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition: ClpModel.hpp:447
ClpModel::integerInformation
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:850
ClpModel::columnScale_
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1286
ClpModel::setColumnName
void setColumnName(int colIndex, std::string &name)
Set name of col.
ClpModel::getColLower
const double * getColLower() const
Definition: ClpModel.hpp:754
ClpModel::setObjectivePointer
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:1057
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::setContinuous
void setContinuous(int index)
Set the index-th variable to be a continuous variable.
ClpModel::rowCopy_
ClpMatrixBase * rowCopy_
Row copy if wanted.
Definition: ClpModel.hpp:1278
ClpModel::objective
double * objective() const
Objective.
Definition: ClpModel.hpp:713
ClpDataSave::sparseThreshold_
int sparseThreshold_
Definition: ClpModel.hpp:1426
ClpModel::columnScale
const double * columnScale() const
Definition: ClpModel.hpp:648
ClpModel::setRowUpper
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
ClpModel::setColUpper
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition: ClpModel.hpp:595
ClpModel::strParam_
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1391
ClpIntParam
ClpIntParam
This is where to put any useful stuff.
Definition: ClpParameters.hpp:12
ClpModel::statusExists
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition: ClpModel.hpp:880
ClpDataSave::perturbation_
int perturbation_
Definition: ClpModel.hpp:1427
ClpModel::copyInIntegerInformation
void copyInIntegerInformation(const char *information)
Copy in integer informations.
ClpModel::setMaximumWallSeconds
void setMaximumWallSeconds(double value)
ClpModel::setObjectiveOffset
void setObjectiveOffset(double value)
ClpModel::copyRowNames
void copyRowNames(const std::vector< std::string > &rowNames, int first, int last)
Copies in Row names - modifies names first .. last-1.
ClpModel::deleteIntegerInformation
void deleteIntegerInformation()
Drop integer informations.
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpModel
Definition: ClpModel.hpp:38
ClpModel::dualTolerance
double dualTolerance() const
Dual tolerance to use.
Definition: ClpModel.hpp:339
ClpModel::dualObjectiveLimit
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:351
ClpModel::maximumRows_
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1376
CoinTypes.hpp
ClpModel::setMaximumSeconds
void setMaximumSeconds(double value)
ClpModel::columnLower
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:750
ClpModel::messages_
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1370
ClpModel::dual_
double * dual_
Duals.
Definition: ClpModel.hpp:1260
ClpModel::setObjectiveCoefficient
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
ClpModel::setStrParam
bool setStrParam(ClpStrParam key, const std::string &value)
Set an string parameter.
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::rowScale
const double * rowScale() const
Scaling.
Definition: ClpModel.hpp:644
ClpModel::reducedCost_
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1262
ClpModel::findNetwork
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
ClpModel::rowUpper
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:544
ClpDblParam
ClpDblParam
Definition: ClpParameters.hpp:43
ClpModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:485
ClpTrustedData
For a structure to be used by trusted code.
Definition: ClpParameters.hpp:124
ClpModel::mutableColumnScale
double * mutableColumnScale() const
Definition: ClpModel.hpp:664
ClpModel::matrix_
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1276
ClpModel::coinMessages_
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1372
ClpModel::objectiveAsObject
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:1052
ClpModel::coinMessagesPointer
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:970
ClpParameters.hpp
ClpModel::numberThreads
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:923
ClpModel::setObjectiveScale
void setObjectiveScale(double value)
Definition: ClpModel.hpp:689
ClpModel::objectiveValue
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:837
ClpModel::primalObjectiveLimit
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:345
ClpPackedMatrix
Definition: ClpPackedMatrix.hpp:23
ClpModel::getReducedCost
const double * getReducedCost() const
Definition: ClpModel.hpp:530
ClpModel::dualColumnSolution
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:526
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
ClpModel::numberRows_
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1252
ClpModel::rowNames
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:1029
ClpModel::solveType_
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1313
ClpModel::getColumnName
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpModel::getTrustedUserPointer
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:909
ClpModel::pushMessageHandler
CoinMessageHandler * pushMessageHandler(CoinMessageHandler *handler, bool &oldDefault)
Pass in Message handler (not deleted at end) and return current.
ClpModel::setDefaultMessageHandler
void setDefaultMessageHandler()
Overrides message handler with a default one.
ClpModel::setPrimalObjectiveLimit
void setPrimalObjectiveLimit(double value)
ClpMaxSeconds
Maximum time in seconds - after, this action is as max iterations.
Definition: ClpParameters.hpp:62
ClpModel::numberIterations_
int numberIterations_
Number of iterations.
Definition: ClpModel.hpp:1311
ClpModel::eventHandler
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:998
ClpModel::setRowSetBounds
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
ClpModel::isIterationLimitReached
bool isIterationLimitReached() const
Iteration limit reached?
Definition: ClpModel.hpp:480
ClpModel::~ClpModel
~ClpModel()
Destructor.
ClpDataSave::objectiveScale_
double objectiveScale_
Definition: ClpModel.hpp:1425
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::rowObjective_
double * rowObjective_
Row Objective (? sign) - may be NULL.
Definition: ClpModel.hpp:1270
ClpModel::getRowActivity
const double * getRowActivity() const
Definition: ClpModel.hpp:499
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:345
ClpModel::problemName
const std::string & problemName() const
Definition: ClpModel.hpp:368
ClpModel::objectiveOffset
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:357
ClpModel::setColSolution
void setColSolution(const double *input)
Definition: ClpModel.hpp:512
ClpObjective
Objective Abstract Base Class.
Definition: ClpObjective.hpp:18
ClpModel::whatsChanged
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:914
ClpModel::gutsOfScaling
void gutsOfScaling()
Does much of scaling.
ClpModel::maximumInternalRows_
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1380
ClpModel::clpScaledMatrix
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:803
ClpModel::maximumInternalColumns_
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1378
CoinFinite.hpp
ClpModel::setInteger
void setInteger(int index)
Set the index-th variable to be an integer variable.
ClpModel::setWhatsChanged
void setWhatsChanged(int value)
Definition: ClpModel.hpp:918
ClpMatrixBase::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const =0
Return a complete CoinPackedMatrix.
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:831
ClpModel::stopPermanentArrays
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:328
ClpModel::swapRowScale
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:676
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...
ClpModel::messagesPointer
CoinMessages * messagesPointer()
Return pointer to messages.
Definition: ClpModel.hpp:960
ClpModel::isDualObjectiveLimitReached
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
ClpModel::randomNumberGenerator_
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1360
ClpDualObjectiveLimit
Set Dual objective limit.
Definition: ClpParameters.hpp:47
ClpConfig.h
ClpModel::setRowName
void setRowName(int rowIndex, std::string &name)
Set name of row.
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:613
ClpModel::newLanguage
void newLanguage(CoinMessages::Language language)
Set language.
ClpModel::whatsChanged_
unsigned int whatsChanged_
Definition: ClpModel.hpp:1342
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
ClpModel::onStopped
void onStopped()
On stopped - sets secondary status.
ClpModel::logLevel
int logLevel() const
Definition: ClpModel.hpp:986
ClpModel::setRhsScale
void setRhsScale(double value)
Definition: ClpModel.hpp:698
ClpModel::getObjCoefficients
const double * getObjCoefficients() const
Definition: ClpModel.hpp:731
ClpModel::columnName
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:1044
ClpModel::getObjValue
double getObjValue() const
Definition: ClpModel.hpp:845
ClpModel::readMps
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
ClpModel::createEmptyMatrix
void createEmptyMatrix()
Create empty ClpPackedMatrix.
COIN_CBC_USING_CLP
#define COIN_CBC_USING_CLP
Definition: ClpModel.hpp:1185
ClpModel::maximumSeconds
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:402
ClpModel::setColumnBounds
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
ClpModel::rowNamesAsChar
const char *const * rowNamesAsChar() const
Create row names as char **.
ClpModel::inverseRowScale_
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
Definition: ClpModel.hpp:1288
ClpModel::integerType_
char * integerType_
Integer information.
Definition: ClpModel.hpp:1303
ClpDualTolerance
The maximum amount the dual constraints can be violated and still be considered feasible.
Definition: ClpParameters.hpp:54
ClpModel::setDualObjectiveLimit
void setDualObjectiveLimit(double value)
ClpModel::getNumCols
int getNumCols() const
Number of columns.
Definition: ClpModel.hpp:324
CoinMessageHandler::logLevel
int logLevel() const
Get current log (detail) level.
Definition: CoinMessageHandler.hpp:383
ClpModel::setNumberIterations
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:382
ClpModel::rowNames_
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1365
ClpModel::setObjective
void setObjective(ClpObjective *objective)
ClpModel::setRowBounds
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
ClpModel::popMessageHandler
void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault)
back to previous message handler
ClpLastIntParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:40
ClpModel::getRowUpper
const double * getRowUpper() const
Definition: ClpModel.hpp:548
ClpModel::generateCpp
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
ClpModel::columnUpper
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:759
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::getRowBound
void getRowBound(int iRow, double &lower, double &upper) const
gets lower and upper bounds on rows
ClpDataSave::pivotTolerance_
double pivotTolerance_
Definition: ClpModel.hpp:1421
ClpModel::scaledMatrix_
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1280
ClpModel::dualRowSolution
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:517
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...
ClpStrParam
ClpStrParam
Definition: ClpParameters.hpp:72
CoinMessageHandler.hpp
This is a first attempt at a message handler.
ClpModel::isInteger
bool isInteger(int index) const
Return true if the index-th variable is an integer variable.
ClpModel::setOptimizationDirection
void setOptimizationDirection(double value)
ClpModel::lengthNames_
int lengthNames_
length of names (0 means no names)
Definition: ClpModel.hpp:1348
ClpModel::problemStatus
int problemStatus() const
Definition: ClpModel.hpp:423
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:1180
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::columnNamesAsChar
const char *const * columnNamesAsChar() const
Create column names as char **.
ClpModel::loadQuadraticObjective
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
Load up quadratic objective.
ClpModel::chgObjCoefficients
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
ClpModel::columnUpper_
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1274
ClpModel::statusArray
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:885
ClpModel::primalColumnSolution
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:504
ClpModel::baseMatrix_
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1382
ClpModel::scalingFlag
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:708
ClpModel::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpModel::setSolveType
void setSolveType(int type)
Definition: ClpModel.hpp:391
ClpModel::defaultHandler
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:991
ClpModel::setRowLower
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
ClpModel::rowLower
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:535
ClpModel::setSpecialOptions
void setSpecialOptions(unsigned int value)
ClpModel::setMaximumIterations
void setMaximumIterations(int value)
ClpModel::getSmallElementValue
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition: ClpModel.hpp:782
ClpModel::ray_
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1282
ClpDataSave::zeroSimplexTolerance_
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1423
ClpModel::createCoinModel
CoinModel * createCoinModel() const
This creates a coinModel object.
ClpModel::getRowPrice
const double * getRowPrice() const
Definition: ClpModel.hpp:521
ClpModel::presolveTolerance
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:363
ClpDataSave::forceFactorization_
int forceFactorization_
Definition: ClpModel.hpp:1428
ClpModel::isAbandoned
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:456
ClpModel::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1254
ClpObjOffset
Objective function constant.
Definition: ClpParameters.hpp:60
ClpModel::scalingFlag_
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows...
Definition: ClpModel.hpp:1293
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1397
ClpModel::setObjCoeff
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:558
ClpModel::messages
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:955
ClpModel::times
void times(double scalar, const double *x, double *y) const
Return y + A * x * scalar in y.
ClpModel::defaultHandler_
bool defaultHandler_
Flag to say if default handler (so delete)
Definition: ClpModel.hpp:1358
ClpModel::rhsScale
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:694
ClpModel::rowObjective
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:741
ClpModel::setNumberThreads
void setNumberThreads(int value)
Definition: ClpModel.hpp:927
ClpModel::hitMaximumIterations
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
ClpModel::setLengthNames
void setLengthNames(int value)
length of names (0 means no names0
Definition: ClpModel.hpp:1024
ClpModel::rowScale_
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1284
ClpModel::deleteRows
void deleteRows(int number, const int *which)
Deletes rows.
ClpModel::getUserPointer
void * getUserPointer() const
Definition: ClpModel.hpp:900
ClpModel::chgRowLower
void chgRowLower(const double *rowLower)
Change row lower bounds.
LAP::scale
void scale(OsiRowCut &cut)
scale the cut passed as argument
ClpModel::setNewRowCopy
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
ClpModel::getStrParam
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1132
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::solveType
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:387
ClpMatrixBase::getNumElements
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
ClpModel::setDualTolerance
void setDualTolerance(double value)
ClpModel::setSmallElementValue
void setSmallElementValue(double value)
Definition: ClpModel.hpp:786
ClpDataSave::acceptablePivot_
double acceptablePivot_
Definition: ClpModel.hpp:1424
ClpModel::chgRowUpper
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
ClpModel::isProvenDualInfeasible
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:471
ClpModel::coinMessages
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:965
ClpDataSave::ClpDataSave
ClpDataSave()
Default constructor.
ClpDataSave::dualBound_
double dualBound_
Definition: ClpModel.hpp:1419
ClpModel::setObjectiveValue
void setObjectiveValue(double value)
Definition: ClpModel.hpp:841
ClpDataSave::specialOptions_
unsigned int specialOptions_
Definition: ClpModel.hpp:1430
ClpModel::transposeTimes
void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpModel::operator=
ClpModel & operator=(const ClpModel &rhs)
Assignment operator. This copies the data.
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...
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
ClpModel::eventHandler_
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1362
ClpModel::getObjSense
double getObjSense() const
Definition: ClpModel.hpp:489
ClpModel::setLanguage
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:943
ClpModel::setProblemStatus
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:428
ClpModel::getColUpper
const double * getColUpper() const
Definition: ClpModel.hpp:763
ClpModel::cleanMatrix
CoinBigIndex cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
ClpModel::inCbcBranchAndBound
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1186
ClpModel::resize
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
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).
ClpObjective.hpp
ClpModel::baseRowCopy_
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1384
ClpModel::deleteRay
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:869
CoinThreadRandom::setSeed
void setSeed(int seed)
Set seed.
Definition: CoinHelperFunctions.hpp:1119
ClpModel::setPrimalTolerance
void setPrimalTolerance(double value)
ClpModel::numberThreads_
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1350
ClpModel::rawObjectiveValue
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1212
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
ClpEventHandler
Base class for Clp event handling.
Definition: ClpEventHandler.hpp:27
ClpModel::setColLower
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition: ClpModel.hpp:589
ClpModel::setRowObjective
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
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
ClpModel::mutableRandomNumberGenerator
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1008
ClpModel::getIntParam
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:1111
ClpPrimalObjectiveLimit
Primal objective limit.
Definition: ClpParameters.hpp:51
ClpLastDblParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:69
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
ClpDataSave::infeasibilityCost_
double infeasibilityCost_
Definition: ClpModel.hpp:1420
ClpModel::copyNames
void copyNames(const std::vector< std::string > &rowNames, const std::vector< std::string > &columnNames)
Copies in names.
ClpModel::smallElement_
double smallElement_
Small element value.
Definition: ClpModel.hpp:1246
ClpDataSave::scalingFlag_
int scalingFlag_
Definition: ClpModel.hpp:1429
ClpModel::isProvenPrimalInfeasible
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:466
ClpModel::passInEventHandler
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
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::copyinStatus
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
ClpModel::handler_
CoinMessageHandler * handler_
Message handler.
Definition: ClpModel.hpp:1356
ClpModel::objective
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:722
ClpModel::clpMatrix
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:798
ClpModel::status_
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1301
ClpModel::status
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:419
ClpModel::objectiveScale
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:685
ClpModel::rhsScale_
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1250
ClpModel::getNumElements
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:776
ClpModel::setDblParam
bool setDblParam(ClpDblParam key, double value)
Set an double parameter.
ClpPackedMatrix.hpp
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:982
ClpModel::inverseColumnScale
const double * inverseColumnScale() const
Definition: ClpModel.hpp:656
ClpModel::maximumIterations
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:396
ClpModel::getDblParam
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:1121
ClpModel::deleteRowsAndColumns
void deleteRowsAndColumns(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Deletes rows AND columns (keeps old sizes)
ClpModel::setRandomSeed
void setRandomSeed(int value)
Set seed for thread specific random number generator.
Definition: ClpModel.hpp:1013
ClpModel::rowActivity_
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1256
ClpModel::deleteColumns
void deleteColumns(int number, const int *which)
Deletes columns.
ClpModel::columnActivity_
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1258
ClpModel::unboundedRay
double * unboundedRay() const
ClpModel::objective_
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1268
ClpDataSave::zeroFactorizationTolerance_
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1422
ClpModel::isProvenOptimal
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:461
ClpModel::columnNames_
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1367
ClpModel::rayExists
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:864
ClpModel::problemStatus_
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1344
ClpModel::ClpModel
ClpModel(bool emptyMessages=false)
Default constructor.
ClpModel::internalRay
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead...
Definition: ClpModel.hpp:875
ClpModel::addRows
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
Add rows.
ClpModel::permanentArrays
bool permanentArrays() const
If we are using maximumRows_ and Columns_.
Definition: ClpModel.hpp:1217
ClpModel::rowLower_
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1264
ClpModel::deleteNamesAsChar
void deleteNamesAsChar(const char *const *names, int number) const
Delete char * version of names.
ClpModel::setColumnUpper
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
ClpModel::setSecondaryStatus
void setSecondaryStatus(int newstatus)
Definition: ClpModel.hpp:451
ClpModel::chgColumnUpper
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
ClpModel::mutableInverseColumnScale
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:672
ClpModel::setColBounds
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:601
ClpModel::setRowScale
void setRowScale(double *scale)
ClpModel::messageHandler
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:950
ClpModel::primalRowSolution
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:495
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:374
ClpModel::statusCopy
unsigned char * statusCopy() const
Return copy of status (i.e.
ClpModel::setColumnScale
void setColumnScale(double *scale)
ClpModel::getRowName
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
ClpModel::rowName
const std::string & rowName(int iRow) const
Definition: ClpModel.hpp:1033
ClpModel::inverseRowScale
const double * inverseRowScale() const
Definition: ClpModel.hpp:652
ClpModel::dropNames
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpModel::swapScaledMatrix
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:814
ClpModel::objectiveValue_
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1244
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::getRowLower
const double * getRowLower() const
Definition: ClpModel.hpp:539
ClpModel::returnModel
void returnModel(ClpModel &otherModel)
Return model - nulls all arrays so can be deleted safely also updates any scalars.
ClpProbName
Name of the problem.
Definition: ClpParameters.hpp:75
ClpPresolveTolerance
Tolerance to use in presolve.
Definition: ClpParameters.hpp:66
ClpModel::setTrustedUserPointer
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition: ClpModel.hpp:905
ClpModel::matrix
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:768
ClpModel::readGMPL
int readGMPL(const char *filename, const char *dataName, bool keepNames=false)
Read GMPL files from the given filenames.
ClpModel::borrowModel
void borrowModel(ClpModel &otherModel)
Borrow model.
ClpModel::maximumColumns_
int maximumColumns_
Maximum number of columns in model.
Definition: ClpModel.hpp:1374
ClpLastStrParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:78
ClpObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
CoinBuild
In many cases it is natural to build a model by adding one row at a time.
Definition: CoinBuild.hpp:25
ClpModel::userPointer_
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1305
ClpModel::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
ClpModel::setUserPointer
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:896
ClpModel::chgColumnLower
void chgColumnLower(const double *columnLower)
Change column lower bounds.
ClpModel::columnLower_
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1272
ClpModel::getIterationCount
int getIterationCount() const
Definition: ClpModel.hpp:378
ClpModel::unscale
void unscale()
If we constructed a &quot;really&quot; scaled model then this reverses the operation.
ClpModel::columnNames
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:1040
CoinMessages
Class to hold and manipulate an array of massaged messages.
Definition: CoinMessageHandler.hpp:140
CoinMessageHandler::setLogLevel
void setLogLevel(int value)
Set current log (detail) level.
ClpMatrixBase::modifyCoefficient
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
ClpModel::trustedUserPointer_
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
Definition: ClpModel.hpp:1307
ClpModel::intParam_
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1309
CoinThreadRandom
Class for thread specific random numbers.
Definition: CoinHelperFunctions.hpp:1082
ClpModel::savedRowScale_
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1386
ClpModel::setColumnLower
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
ClpModel::specialOptions_
unsigned int specialOptions_
For advanced options See get and set for meaning.
Definition: ClpModel.hpp:1354
ClpModel::getRowObjCoefficients
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:745