Clp 1.17.6

- 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 2643 2020-02-03 10:03:22Z stefan $ */
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);
143 private:
145 void synchronizeMatrix();
146 public:
148 void deleteRows(int number, const int *which);
150 void addRow(int numberInRow, const int *columns,
151 const double *elements, double rowLower = -COIN_DBL_MAX,
152 double rowUpper = COIN_DBL_MAX);
154 void addRows(int number, const double *rowLower,
155 const double *rowUpper,
156 const CoinBigIndex *rowStarts, const int *columns,
157 const double *elements);
159 void addRows(int number, const double *rowLower,
160 const double *rowUpper,
161 const CoinBigIndex *rowStarts, const int *rowLengths,
162 const int *columns,
163 const double *elements);
164 #ifndef CLP_NO_VECTOR
165 void addRows(int number, const double *rowLower,
166 const double *rowUpper,
167 const CoinPackedVectorBase *const *rows);
168 #endif
169
174 int addRows(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
175 bool checkDuplicates = true);
184 int addRows(CoinModel &modelObject, bool tryPlusMinusOne = false,
185 bool checkDuplicates = true);
186
188 void deleteColumns(int number, const int *which);
190 void deleteRowsAndColumns(int numberRows, const int *whichRows,
191 int numberColumns, const int *whichColumns);
193 void addColumn(int numberInColumn,
194 const int *rows,
195 const double *elements,
196 double columnLower = 0.0,
197 double columnUpper = COIN_DBL_MAX,
198 double objective = 0.0);
200 void addColumns(int number, const double *columnLower,
201 const double *columnUpper,
202 const double *objective,
203 const CoinBigIndex *columnStarts, const int *rows,
204 const double *elements);
205 void addColumns(int number, const double *columnLower,
206 const double *columnUpper,
207 const double *objective,
208 const CoinBigIndex *columnStarts, const int *columnLengths,
209 const int *rows,
210 const double *elements);
211 #ifndef CLP_NO_VECTOR
212 void addColumns(int number, const double *columnLower,
213 const double *columnUpper,
214 const double *objective,
215 const CoinPackedVectorBase *const *columns);
216 #endif
217
222 int addColumns(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
223 bool checkDuplicates = true);
231 int addColumns(CoinModel &modelObject, bool tryPlusMinusOne = false,
232 bool checkDuplicates = true);
234 inline void modifyCoefficient(int row, int column, double newElement,
235 bool keepZero = false)
236 {
237 matrix_->modifyCoefficient(row, column, newElement, keepZero);
238 }
240 void chgRowLower(const double *rowLower);
242 void chgRowUpper(const double *rowUpper);
244 void chgColumnLower(const double *columnLower);
246 void chgColumnUpper(const double *columnUpper);
248 void chgObjCoefficients(const double *objIn);
252 void borrowModel(ClpModel &otherModel);
255 void returnModel(ClpModel &otherModel);
256
258 void createEmptyMatrix();
266 CoinBigIndex cleanMatrix(double threshold = 1.0e-20);
268 void copy(const ClpMatrixBase *from, ClpMatrixBase *&to);
269 #ifndef CLP_NO_STD
270 void dropNames();
273 void copyNames(const std::vector< std::string > &rowNames,
274 const std::vector< std::string > &columnNames);
276 void copyRowNames(const std::vector< std::string > &rowNames, int first, int last);
278 void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last);
280 void copyRowNames(const char *const *rowNames, int first, int last);
282 void copyColumnNames(const char *const *columnNames, int first, int last);
284 void setRowName(int rowIndex, std::string &name);
286 void setColumnName(int colIndex, std::string &name);
287 #endif
288
295 int findNetwork(char *rotate, double fractionNeeded = 0.75);
298 CoinModel *createCoinModel() const;
299
312 int writeMps(const char *filename,
313 int formatType = 0, int numberAcross = 2,
314 double objSense = 0.0) const;
316
318 inline int numberRows() const
320 {
321 return numberRows_;
322 }
323 inline int getNumRows() const
324 {
325 return numberRows_;
326 }
328 inline int getNumCols() const
329 {
330 return numberColumns_;
331 }
332 inline int numberColumns() const
333 {
334 return numberColumns_;
335 }
337 inline double primalTolerance() const
338 {
339 return dblParam_[ClpPrimalTolerance];
340 }
341 void setPrimalTolerance(double value);
343 inline double dualTolerance() const
344 {
345 return dblParam_[ClpDualTolerance];
346 }
347 void setDualTolerance(double value);
349 inline double primalObjectiveLimit() const
350 {
351 return dblParam_[ClpPrimalObjectiveLimit];
352 }
353 void setPrimalObjectiveLimit(double value);
355 inline double dualObjectiveLimit() const
356 {
357 return dblParam_[ClpDualObjectiveLimit];
358 }
359 void setDualObjectiveLimit(double value);
361 inline double objectiveOffset() const
362 {
363 return dblParam_[ClpObjOffset];
364 }
365 void setObjectiveOffset(double value);
367 inline double presolveTolerance() const
368 {
369 return dblParam_[ClpPresolveTolerance];
370 }
371 #ifndef CLP_NO_STD
372 inline const std::string &problemName() const
373 {
374 return strParam_[ClpProbName];
375 }
376 #endif
377 inline int numberIterations() const
379 {
380 return numberIterations_;
381 }
382 inline int getIterationCount() const
383 {
384 return numberIterations_;
385 }
386 inline void setNumberIterations(int numberIterationsNew)
387 {
388 numberIterations_ = numberIterationsNew;
389 }
391 inline int solveType() const
392 {
393 return solveType_;
394 }
395 inline void setSolveType(int type)
396 {
397 solveType_ = type;
398 }
400 inline int maximumIterations() const
401 {
402 return intParam_[ClpMaxNumIteration];
403 }
404 void setMaximumIterations(int value);
406 inline double maximumSeconds() const
407 {
408 return dblParam_[ClpMaxSeconds];
409 }
410 void setMaximumSeconds(double value);
411 void setMaximumWallSeconds(double value);
413 bool hitMaximumIterations() const;
423 inline int status() const
424 {
425 return problemStatus_;
426 }
427 inline int problemStatus() const
428 {
429 return problemStatus_;
430 }
432 inline void setProblemStatus(int problemStatusNew)
433 {
434 problemStatus_ = problemStatusNew;
435 }
451 inline int secondaryStatus() const
452 {
453 return secondaryStatus_;
454 }
455 inline void setSecondaryStatus(int newstatus)
456 {
457 secondaryStatus_ = newstatus;
458 }
460 inline bool isAbandoned() const
461 {
462 return problemStatus_ == 4;
463 }
465 inline bool isProvenOptimal() const
466 {
467 return problemStatus_ == 0;
468 }
470 inline bool isProvenPrimalInfeasible() const
471 {
472 return problemStatus_ == 1;
473 }
475 inline bool isProvenDualInfeasible() const
476 {
477 return problemStatus_ == 2;
478 }
480 bool isPrimalObjectiveLimitReached() const;
482 bool isDualObjectiveLimitReached() const;
484 inline bool isIterationLimitReached() const
485 {
486 return problemStatus_ == 3;
487 }
489 inline double optimizationDirection() const
490 {
491 return optimizationDirection_;
492 }
493 inline double getObjSense() const
494 {
495 return optimizationDirection_;
496 }
497 void setOptimizationDirection(double value);
499 inline double *primalRowSolution() const
500 {
501 return rowActivity_;
502 }
503 inline const double *getRowActivity() const
504 {
505 return rowActivity_;
506 }
508 inline double *primalColumnSolution() const
509 {
510 return columnActivity_;
511 }
512 inline const double *getColSolution() const
513 {
514 return columnActivity_;
515 }
516 inline void setColSolution(const double *input)
517 {
518 memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
519 }
521 inline double *dualRowSolution() const
522 {
523 return dual_;
524 }
525 inline const double *getRowPrice() const
526 {
527 return dual_;
528 }
530 inline double *dualColumnSolution() const
531 {
532 return reducedCost_;
533 }
534 inline const double *getReducedCost() const
535 {
536 return reducedCost_;
537 }
539 inline double *rowLower() const
540 {
541 return rowLower_;
542 }
543 inline const double *getRowLower() const
544 {
545 return rowLower_;
546 }
548 inline double *rowUpper() const
549 {
550 return rowUpper_;
551 }
552 inline const double *getRowUpper() const
553 {
554 return rowUpper_;
555 }
556 //-------------------------------------------------------------------------
560 void setObjectiveCoefficient(int elementIndex, double elementValue);
562 inline void setObjCoeff(int elementIndex, double elementValue)
563 {
564 setObjectiveCoefficient(elementIndex, elementValue);
565 }
566
569 void setColumnLower(int elementIndex, double elementValue);
570
573 void setColumnUpper(int elementIndex, double elementValue);
574
576 void setColumnBounds(int elementIndex,
577 double lower, double upper);
578
587 void setColumnSetBounds(const int *indexFirst,
588 const int *indexLast,
589 const double *boundList);
590
593 inline void setColLower(int elementIndex, double elementValue)
594 {
595 setColumnLower(elementIndex, elementValue);
596 }
599 inline void setColUpper(int elementIndex, double elementValue)
600 {
601 setColumnUpper(elementIndex, elementValue);
602 }
603
605 inline void setColBounds(int elementIndex,
606 double lower, double upper)
607 {
608 setColumnBounds(elementIndex, lower, upper);
609 }
610
617 inline void setColSetBounds(const int *indexFirst,
618 const int *indexLast,
619 const double *boundList)
620 {
621 setColumnSetBounds(indexFirst, indexLast, boundList);
622 }
623
626 void setRowLower(int elementIndex, double elementValue);
627
630 void setRowUpper(int elementIndex, double elementValue);
631
633 void setRowBounds(int elementIndex,
634 double lower, double upper);
635
642 void setRowSetBounds(const int *indexFirst,
643 const int *indexLast,
644 const double *boundList);
645
647 inline const double *rowScale() const
649 {
650 return rowScale_;
651 }
652 inline const double *columnScale() const
653 {
654 return columnScale_;
655 }
656 inline const double *inverseRowScale() const
657 {
658 return inverseRowScale_;
659 }
660 inline const double *inverseColumnScale() const
661 {
662 return inverseColumnScale_;
663 }
664 inline double *mutableRowScale() const
665 {
666 return rowScale_;
667 }
668 inline double *mutableColumnScale() const
669 {
670 return columnScale_;
671 }
672 inline double *mutableInverseRowScale() const
673 {
674 return inverseRowScale_;
675 }
676 inline double *mutableInverseColumnScale() const
677 {
678 return inverseColumnScale_;
679 }
680 inline double *swapRowScale(double *newScale)
681 {
682 double *oldScale = rowScale_;
683 rowScale_ = newScale;
684 return oldScale;
685 }
686 void setRowScale(double *scale);
687 void setColumnScale(double *scale);
689 inline double objectiveScale() const
690 {
691 return objectiveScale_;
692 }
693 inline void setObjectiveScale(double value)
694 {
695 objectiveScale_ = value;
696 }
698 inline double rhsScale() const
699 {
700 return rhsScale_;
701 }
702 inline void setRhsScale(double value)
703 {
704 rhsScale_ = value;
705 }
707 void scaling(int mode = 1);
710 void unscale();
712 inline int scalingFlag() const
713 {
714 return scalingFlag_;
715 }
717 inline double *objective() const
718 {
719 if (objective_) {
720 double offset;
721 return objective_->gradient(NULL, NULL, offset, false);
722 } else {
723 return NULL;
724 }
725 }
726 inline double *objective(const double *solution, double &offset, bool refresh = true) const
727 {
728 offset = 0.0;
729 if (objective_) {
730 return objective_->gradient(NULL, solution, offset, refresh);
731 } else {
732 return NULL;
733 }
734 }
735 inline const double *getObjCoefficients() const
736 {
737 if (objective_) {
738 double offset;
739 return objective_->gradient(NULL, NULL, offset, false);
740 } else {
741 return NULL;
742 }
743 }
745 inline double *rowObjective() const
746 {
747 return rowObjective_;
748 }
749 inline const double *getRowObjCoefficients() const
750 {
751 return rowObjective_;
752 }
754 inline double *columnLower() const
755 {
756 return columnLower_;
757 }
758 inline const double *getColLower() const
759 {
760 return columnLower_;
761 }
763 inline double *columnUpper() const
764 {
765 return columnUpper_;
766 }
767 inline const double *getColUpper() const
768 {
769 return columnUpper_;
770 }
772 inline CoinPackedMatrix *matrix() const
773 {
774 if (matrix_ == NULL)
775 return NULL;
776 else
777 return matrix_->getPackedMatrix();
778 }
780 inline CoinBigIndex getNumElements() const
781 {
782 return matrix_->getNumElements();
783 }
786 inline double getSmallElementValue() const
787 {
788 return smallElement_;
789 }
790 inline void setSmallElementValue(double value)
791 {
792 smallElement_ = value;
793 }
795 inline ClpMatrixBase *rowCopy() const
796 {
797 return rowCopy_;
798 }
800 void setNewRowCopy(ClpMatrixBase *newCopy);
802 inline ClpMatrixBase *clpMatrix() const
803 {
804 return matrix_;
805 }
807 inline ClpPackedMatrix *clpScaledMatrix() const
808 {
809 return scaledMatrix_;
810 }
812 inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
813 {
814 delete scaledMatrix_;
815 scaledMatrix_ = scaledMatrix;
816 }
818 inline ClpPackedMatrix *swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
819 {
820 ClpPackedMatrix *oldMatrix = scaledMatrix_;
821 scaledMatrix_ = scaledMatrix;
822 return oldMatrix;
823 }
829 void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent = false);
835 inline void replaceMatrix(CoinPackedMatrix *newmatrix,
836 bool deleteCurrent = false)
837 {
838 replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
839 }
841 inline double objectiveValue() const
842 {
843 return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
844 }
845 inline void setObjectiveValue(double value)
846 {
847 objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
848 }
849 inline double getObjValue() const
850 {
851 return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
852 }
854 inline char *integerInformation() const
855 {
856 return integerType_;
857 }
860 double *infeasibilityRay(bool fullRay = false) const;
861 double *unboundedRay() const;
863 inline double *ray() const
864 {
865 return ray_;
866 }
868 inline bool rayExists() const
869 {
870 return (ray_ != NULL);
871 }
873 inline void deleteRay()
874 {
875 delete[] ray_;
876 ray_ = NULL;
877 }
879 inline const double *internalRay() const
880 {
881 return ray_;
882 }
884 inline bool statusExists() const
885 {
886 return (status_ != NULL);
887 }
889 inline unsigned char *statusArray() const
890 {
891 return status_;
892 }
895 unsigned char *statusCopy() const;
897 void copyinStatus(const unsigned char *statusArray);
898
900 inline void setUserPointer(void *pointer)
901 {
902 userPointer_ = pointer;
903 }
904 inline void *getUserPointer() const
905 {
906 return userPointer_;
907 }
909 inline void setTrustedUserPointer(ClpTrustedData *pointer)
910 {
911 trustedUserPointer_ = pointer;
912 }
913 inline ClpTrustedData *getTrustedUserPointer() const
914 {
915 return trustedUserPointer_;
916 }
918 inline int whatsChanged() const
919 {
920 return whatsChanged_;
921 }
922 inline void setWhatsChanged(int value)
923 {
924 whatsChanged_ = value;
925 }
927 inline int numberThreads() const
928 {
929 return numberThreads_;
930 }
931 inline void setNumberThreads(int value)
932 {
933 numberThreads_ = value;
934 }
936
938 void passInMessageHandler(CoinMessageHandler *handler);
941 CoinMessageHandler *pushMessageHandler(CoinMessageHandler *handler,
942 bool &oldDefault);
944 void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault);
946 void newLanguage(CoinMessages::Language language);
947 inline void setLanguage(CoinMessages::Language language)
948 {
949 newLanguage(language);
950 }
952 void setDefaultMessageHandler();
954 inline CoinMessageHandler *messageHandler() const
955 {
956 return handler_;
957 }
959 inline CoinMessages messages() const
960 {
961 return messages_;
962 }
964 inline CoinMessages *messagesPointer()
965 {
966 return &messages_;
967 }
969 inline CoinMessages coinMessages() const
970 {
971 return coinMessages_;
972 }
974 inline CoinMessages *coinMessagesPointer()
975 {
976 return &coinMessages_;
977 }
986 inline void setLogLevel(int value)
987 {
988 handler_->setLogLevel(value);
989 }
990 inline int logLevel() const
991 {
992 return handler_->logLevel();
993 }
995 inline bool defaultHandler() const
996 {
997 return defaultHandler_;
998 }
1000 void passInEventHandler(const ClpEventHandler *eventHandler);
1002 inline ClpEventHandler *eventHandler() const
1003 {
1004 return eventHandler_;
1005 }
1007 inline CoinThreadRandom *randomNumberGenerator()
1008 {
1009 return &randomNumberGenerator_;
1010 }
1012 inline CoinThreadRandom &mutableRandomNumberGenerator()
1013 {
1014 return randomNumberGenerator_;
1015 }
1017 inline void setRandomSeed(int value)
1018 {
1019 randomNumberGenerator_.setSeed(value);
1020 }
1022 inline int lengthNames() const
1023 {
1024 return lengthNames_;
1025 }
1026 #ifndef CLP_NO_STD
1027 inline void setLengthNames(int value)
1029 {
1030 lengthNames_ = value;
1031 }
1033 inline const std::vector< std::string > *rowNames() const
1034 {
1035 return &rowNames_;
1036 }
1037 inline const std::string &rowName(int iRow) const
1038 {
1039 return rowNames_[iRow];
1040 }
1042 std::string getRowName(int iRow) const;
1044 inline const std::vector< std::string > *columnNames() const
1045 {
1046 return &columnNames_;
1047 }
1048 inline const std::string &columnName(int iColumn) const
1049 {
1050 return columnNames_[iColumn];
1051 }
1053 std::string getColumnName(int iColumn) const;
1054 #endif
1055 inline ClpObjective *objectiveAsObject() const
1057 {
1058 return objective_;
1059 }
1060 void setObjective(ClpObjective *objective);
1061 inline void setObjectivePointer(ClpObjective *newobjective)
1062 {
1063 objective_ = newobjective;
1064 }
1067 int emptyProblem(int *infeasNumber = NULL, double *infeasSum = NULL, bool printMessage = true);
1068
1070
1079 void times(double scalar,
1080 const double *x, double *y) const;
1084 void transposeTimes(double scalar,
1085 const double *x, double *y) const;
1087
1088 //---------------------------------------------------------------------------
1106 bool setIntParam(ClpIntParam key, int value);
1109 bool setDblParam(ClpDblParam key, double value);
1110 #ifndef CLP_NO_STD
1111 bool setStrParam(ClpStrParam key, const std::string &value);
1113 #endif
1114 // Get an integer parameter
1115 inline bool getIntParam(ClpIntParam key, int &value) const
1116 {
1117 if (key < ClpLastIntParam) {
1118 value = intParam_[key];
1119 return true;
1120 } else {
1121 return false;
1122 }
1123 }
1124 // Get an double parameter
1125 inline bool getDblParam(ClpDblParam key, double &value) const
1126 {
1127 if (key < ClpLastDblParam) {
1128 value = dblParam_[key];
1129 return true;
1130 } else {
1131 return false;
1132 }
1133 }
1134 #ifndef CLP_NO_STD
1135 // Get a string parameter
1136 inline bool getStrParam(ClpStrParam key, std::string &value) const
1137 {
1138 if (key < ClpLastStrParam) {
1139 value = strParam_[key];
1140 return true;
1141 } else {
1142 return false;
1143 }
1144 }
1145 #endif
1146 void generateCpp(FILE *fp);
1184 inline unsigned int specialOptions() const
1185 {
1186 return specialOptions_;
1187 }
1188 void setSpecialOptions(unsigned int value);
1189 #define COIN_CBC_USING_CLP 0x01000000
1190 inline bool inCbcBranchAndBound() const
1191 {
1192 return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1193 }
1195
1198 protected:
1200 void gutsOfDelete(int type);
1204 void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1206 void getRowBound(int iRow, double &lower, double &upper) const;
1208 void gutsOfLoadModel(int numberRows, int numberColumns,
1209 const double *collb, const double *colub,
1210 const double *obj,
1211 const double *rowlb, const double *rowub,
1212 const double *rowObjective = NULL);
1214 void gutsOfScaling();
1216 inline double rawObjectiveValue() const
1217 {
1218 return objectiveValue_;
1219 }
1221 inline bool permanentArrays() const
1222 {
1223 return (specialOptions_ & 65536) != 0;
1224 }
1226 void startPermanentArrays();
1228 void stopPermanentArrays();
1230 const char *const *rowNamesAsChar() const;
1232 const char *const *columnNamesAsChar() const;
1234 void deleteNamesAsChar(const char *const *names, int number) const;
1236 void onStopped();
1238
1240 protected:
1243 double optimizationDirection_;
1246 double dblParam_[ClpLastDblParam];
1248 double objectiveValue_;
1250 double smallElement_;
1252 double objectiveScale_;
1254 double rhsScale_;
1256 int numberRows_;
1258 int numberColumns_;
1260 double *rowActivity_;
1262 double *columnActivity_;
1264 double *dual_;
1266 double *reducedCost_;
1268 double *rowLower_;
1270 double *rowUpper_;
1272 ClpObjective *objective_;
1274 double *rowObjective_;
1276 double *columnLower_;
1278 double *columnUpper_;
1280 ClpMatrixBase *matrix_;
1282 ClpMatrixBase *rowCopy_;
1284 ClpPackedMatrix *scaledMatrix_;
1286 double *ray_;
1288 double *rowScale_;
1290 double *columnScale_;
1292 double *inverseRowScale_;
1294 double *inverseColumnScale_;
1297 int scalingFlag_;
1305 unsigned char *status_;
1307 char *integerType_;
1309 void *userPointer_;
1311 ClpTrustedData *trustedUserPointer_;
1313 int intParam_[ClpLastIntParam];
1315 int numberIterations_;
1317 int solveType_;
1334 #define ROW_COLUMN_COUNTS_SAME 1
1335 #define MATRIX_SAME 2
1336 #define MATRIX_JUST_ROWS_ADDED 4
1337 #define MATRIX_JUST_COLUMNS_ADDED 8
1338 #define ROW_LOWER_SAME 16
1339 #define ROW_UPPER_SAME 32
1340 #define OBJECTIVE_SAME 64
1341 #define COLUMN_LOWER_SAME 128
1342 #define COLUMN_UPPER_SAME 256
1343 #define BASIS_SAME 512
1344 #define ALL_SAME 65339
1345 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1346 unsigned int whatsChanged_;
1348 int problemStatus_;
1350 int secondaryStatus_;
1352 int lengthNames_;
1354 int numberThreads_;
1358 unsigned int specialOptions_;
1360 CoinMessageHandler *handler_;
1362 bool defaultHandler_;
1364 CoinThreadRandom randomNumberGenerator_;
1366 ClpEventHandler *eventHandler_;
1367 #ifndef CLP_NO_STD
1368 std::vector< std::string > rowNames_;
1371 std::vector< std::string > columnNames_;
1372 #endif
1373 CoinMessages messages_;
1376 CoinMessages coinMessages_;
1378 int maximumColumns_;
1380 int maximumRows_;
1382 int maximumInternalColumns_;
1384 int maximumInternalRows_;
1386 CoinPackedMatrix baseMatrix_;
1388 CoinPackedMatrix baseRowCopy_;
1390 double *savedRowScale_;
1392 double *savedColumnScale_;
1393 #ifndef CLP_NO_STD
1394 std::string strParam_[ClpLastStrParam];
1396 #endif
1397
1398 };
1401 class ClpDataSave {
1402
1403 public:
1407 ClpDataSave();
1409
1411 ClpDataSave(const ClpDataSave &);
1413 ClpDataSave &operator=(const ClpDataSave &rhs);
1415 ~ClpDataSave();
1416
1418
1420 public:
1423 double dualBound_;
1424 double infeasibilityCost_;
1425 double pivotTolerance_;
1426 double zeroFactorizationTolerance_;
1427 double zeroSimplexTolerance_;
1428 double acceptablePivot_;
1429 double objectiveScale_;
1430 int sparseThreshold_;
1431 int perturbation_;
1432 int forceFactorization_;
1433 int scalingFlag_;
1434 unsigned int specialOptions_;
1436 };
1437
1438 #endif
1439
1440 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1441 */
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:863
CoinHelperFunctions.hpp
ClpModel::randomNumberGenerator
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1007
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:1244
ClpModel::primalTolerance
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:337
ClpModel::lengthNames
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:1022
ClpModel::savedColumnScale_
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1392
ClpModel::setClpScaledMatrix
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:812
ClpModel::objectiveScale_
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1252
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:672
ClpModel::getColSolution
const double * getColSolution() const
Definition: ClpModel.hpp:512
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:1294
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:323
ClpModel::rowCopy
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:795
ClpModel::rowUpper_
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1270
ClpModel::mutableRowScale
double * mutableRowScale() const
Definition: ClpModel.hpp:664
ClpModel::dblParam_
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1246
ClpModel::secondaryStatus_
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1350
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:451
ClpModel::integerInformation
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:854
ClpModel::columnScale_
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1290
ClpModel::setColumnName
void setColumnName(int colIndex, std::string &name)
Set name of col.
ClpModel::getColLower
const double * getColLower() const
Definition: ClpModel.hpp:758
ClpModel::setObjectivePointer
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:1061
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:1282
ClpModel::objective
double * objective() const
Objective.
Definition: ClpModel.hpp:717
ClpDataSave::sparseThreshold_
int sparseThreshold_
Definition: ClpModel.hpp:1430
ClpModel::columnScale
const double * columnScale() const
Definition: ClpModel.hpp:652
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:599
ClpModel::strParam_
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1395
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:884
ClpDataSave::perturbation_
int perturbation_
Definition: ClpModel.hpp:1431
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:343
ClpModel::dualObjectiveLimit
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:355
ClpModel::maximumRows_
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1380
CoinTypes.hpp
ClpModel::setMaximumSeconds
void setMaximumSeconds(double value)
ClpModel::columnLower
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:754
ClpModel::messages_
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1374
ClpModel::dual_
double * dual_
Duals.
Definition: ClpModel.hpp:1264
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:648
ClpModel::reducedCost_
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1266
ClpModel::findNetwork
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
ClpModel::rowUpper
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:548
ClpDblParam
ClpDblParam
Definition: ClpParameters.hpp:43
ClpModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:489
ClpTrustedData
For a structure to be used by trusted code.
Definition: ClpParameters.hpp:124
ClpModel::mutableColumnScale
double * mutableColumnScale() const
Definition: ClpModel.hpp:668
ClpModel::matrix_
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1280
ClpModel::coinMessages_
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1376
ClpModel::objectiveAsObject
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:1056
ClpModel::coinMessagesPointer
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:974
ClpParameters.hpp
ClpModel::numberThreads
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:927
ClpModel::setObjectiveScale
void setObjectiveScale(double value)
Definition: ClpModel.hpp:693
ClpModel::objectiveValue
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:841
ClpModel::primalObjectiveLimit
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:349
ClpPackedMatrix
Definition: ClpPackedMatrix.hpp:23
ClpModel::getReducedCost
const double * getReducedCost() const
Definition: ClpModel.hpp:534
ClpModel::dualColumnSolution
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:530
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:1256
ClpModel::rowNames
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:1033
ClpModel::solveType_
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1317
ClpModel::getColumnName
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpModel::getTrustedUserPointer
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:913
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:1315
ClpModel::synchronizeMatrix
void synchronizeMatrix()
Makes sure matrix dimensions are at least model dimensions.
ClpModel::eventHandler
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:1002
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:484
ClpModel::~ClpModel
~ClpModel()
Destructor.
ClpDataSave::objectiveScale_
double objectiveScale_
Definition: ClpModel.hpp:1429
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:1274
ClpModel::getRowActivity
const double * getRowActivity() const
Definition: ClpModel.hpp:503
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:345
ClpModel::problemName
const std::string & problemName() const
Definition: ClpModel.hpp:372
ClpModel::objectiveOffset
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:361
ClpModel::setColSolution
void setColSolution(const double *input)
Definition: ClpModel.hpp:516
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:918
ClpModel::gutsOfScaling
void gutsOfScaling()
Does much of scaling.
ClpModel::maximumInternalRows_
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1384
ClpModel::clpScaledMatrix
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:807
ClpModel::maximumInternalColumns_
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1382
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:922
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:835
ClpModel::stopPermanentArrays
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:332
ClpModel::swapRowScale
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:680
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:964
ClpModel::isDualObjectiveLimitReached
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
ClpModel::randomNumberGenerator_
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1364
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:617
ClpModel::newLanguage
void newLanguage(CoinMessages::Language language)
Set language.
ClpModel::whatsChanged_
unsigned int whatsChanged_
Definition: ClpModel.hpp:1346
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:990
ClpModel::setRhsScale
void setRhsScale(double value)
Definition: ClpModel.hpp:702
ClpModel::getObjCoefficients
const double * getObjCoefficients() const
Definition: ClpModel.hpp:735
ClpModel::columnName
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:1048
ClpModel::getObjValue
double getObjValue() const
Definition: ClpModel.hpp:849
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:1189
ClpModel::maximumSeconds
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:406
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:1292
ClpModel::integerType_
char * integerType_
Integer information.
Definition: ClpModel.hpp:1307
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:328
CoinMessageHandler::logLevel
int logLevel() const
Get current log (detail) level.
Definition: CoinMessageHandler.hpp:383
ClpModel::setNumberIterations
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:386
ClpModel::rowNames_
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1369
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:552
ClpModel::generateCpp
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
ClpModel::columnUpper
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:763
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:1425
ClpModel::scaledMatrix_
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1284
ClpModel::dualRowSolution
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:521
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:1352
ClpModel::problemStatus
int problemStatus() const
Definition: ClpModel.hpp:427
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:1184
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:1278
ClpModel::statusArray
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:889
ClpModel::primalColumnSolution
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:508
ClpModel::baseMatrix_
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1386
ClpModel::scalingFlag
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:712
ClpModel::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpModel::setSolveType
void setSolveType(int type)
Definition: ClpModel.hpp:395
ClpModel::defaultHandler
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:995
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:539
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:786
ClpModel::ray_
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1286
ClpDataSave::zeroSimplexTolerance_
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1427
ClpModel::createCoinModel
CoinModel * createCoinModel() const
This creates a coinModel object.
ClpModel::getRowPrice
const double * getRowPrice() const
Definition: ClpModel.hpp:525
ClpModel::presolveTolerance
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:367
ClpDataSave::forceFactorization_
int forceFactorization_
Definition: ClpModel.hpp:1432
ClpModel::isAbandoned
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:460
ClpModel::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1258
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:1297
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1401
ClpModel::setObjCoeff
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:562
ClpModel::messages
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:959
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:1362
ClpModel::rhsScale
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:698
ClpModel::rowObjective
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:745
ClpModel::setNumberThreads
void setNumberThreads(int value)
Definition: ClpModel.hpp:931
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:1028
ClpModel::rowScale_
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1288
ClpModel::deleteRows
void deleteRows(int number, const int *which)
Deletes rows.
ClpModel::getUserPointer
void * getUserPointer() const
Definition: ClpModel.hpp:904
ClpModel::chgRowLower
void chgRowLower(const double *rowLower)
Change row lower bounds.
ClpModel::setNewRowCopy
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
ClpModel::getStrParam
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1136
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:391
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:790
ClpDataSave::acceptablePivot_
double acceptablePivot_
Definition: ClpModel.hpp:1428
ClpModel::chgRowUpper
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
ClpModel::isProvenDualInfeasible
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:475
ClpModel::coinMessages
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:969
ClpDataSave::ClpDataSave
ClpDataSave()
Default constructor.
ClpDataSave::dualBound_
double dualBound_
Definition: ClpModel.hpp:1423
ClpModel::setObjectiveValue
void setObjectiveValue(double value)
Definition: ClpModel.hpp:845
ClpDataSave::specialOptions_
unsigned int specialOptions_
Definition: ClpModel.hpp:1434
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:1366
ClpModel::getObjSense
double getObjSense() const
Definition: ClpModel.hpp:493
ClpModel::setLanguage
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:947
ClpModel::setProblemStatus
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:432
ClpModel::getColUpper
const double * getColUpper() const
Definition: ClpModel.hpp:767
ClpModel::cleanMatrix
CoinBigIndex cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
ClpModel::inCbcBranchAndBound
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1190
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:1388
ClpModel::deleteRay
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:873
CoinThreadRandom::setSeed
void setSeed(int seed)
Set seed.
Definition: CoinHelperFunctions.hpp:1126
ClpModel::setPrimalTolerance
void setPrimalTolerance(double value)
ClpModel::numberThreads_
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1354
ClpModel::rawObjectiveValue
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1216
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:319
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:593
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:234
ClpModel::mutableRandomNumberGenerator
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1012
ClpModel::getIntParam
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:1115
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:1424
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:1250
ClpDataSave::scalingFlag_
int scalingFlag_
Definition: ClpModel.hpp:1433
ClpModel::isProvenPrimalInfeasible
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:470
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:1360
ClpModel::objective
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:726
ClpModel::clpMatrix
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:802
ClpModel::status_
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1305
ClpModel::status
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:423
ClpModel::objectiveScale
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:689
ClpModel::rhsScale_
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1254
ClpModel::getNumElements
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:780
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:986
ClpModel::inverseColumnScale
const double * inverseColumnScale() const
Definition: ClpModel.hpp:660
ClpModel::maximumIterations
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:400
ClpModel::getDblParam
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:1125
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:1017
ClpModel::rowActivity_
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1260
ClpModel::deleteColumns
void deleteColumns(int number, const int *which)
Deletes columns.
ClpModel::columnActivity_
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1262
ClpModel::unboundedRay
double * unboundedRay() const
ClpModel::objective_
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1272
ClpDataSave::zeroFactorizationTolerance_
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1426
ClpModel::isProvenOptimal
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:465
ClpModel::columnNames_
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1371
ClpModel::rayExists
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:868
ClpModel::problemStatus_
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1348
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:879
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:1221
ClpModel::rowLower_
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1268
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:455
ClpModel::chgColumnUpper
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
ClpModel::mutableInverseColumnScale
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:676
ClpModel::setColBounds
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:605
ClpModel::setRowScale
void setRowScale(double *scale)
ClpModel::messageHandler
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:954
ClpModel::primalRowSolution
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:499
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:378
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:1037
ClpModel::inverseRowScale
const double * inverseRowScale() const
Definition: ClpModel.hpp:656
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:818
ClpModel::objectiveValue_
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1248
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:543
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:909
ClpModel::matrix
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:772
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:1378
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:1309
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:900
ClpModel::chgColumnLower
void chgColumnLower(const double *columnLower)
Change column lower bounds.
ClpModel::columnLower_
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1276
ClpModel::getIterationCount
int getIterationCount() const
Definition: ClpModel.hpp:382
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:1044
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:1311
ClpModel::intParam_
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1313
CoinThreadRandom
Class for thread specific random numbers.
Definition: CoinHelperFunctions.hpp:1089
ClpModel::savedRowScale_
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1390
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:1358
ClpModel::getRowObjCoefficients
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:749