Clp 1.17.10
Loading...
Searching...
No Matches
ClpModel.hpp
Go to the documentation of this file.
1/* $Id$ */
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"
26class ClpEventHandler;
36class CoinBuild;
37class CoinModel;
38class ClpModel {
39
40public:
47 ClpModel(bool emptyMessages = false);
48
53 ClpModel(const ClpModel &rhs, int scalingMode = -1);
60 ClpModel(const ClpModel *wholeModel,
61 int numberRows, const int *whichRows,
62 int numberColumns, const int *whichColumns,
63 bool dropNames = true, bool dropIntegers = true);
67
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);
117 const CoinBigIndex *start,
118 const int *column, const double *element);
119 void loadQuadraticObjective(const CoinPackedMatrix &matrix);
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);
136 void setContinuous(int index);
138 void setInteger(int index);
140 bool isInteger(int index) const;
142 void resize(int newNumberRows, int newNumberColumns);
143private:
146public:
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
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
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
266 CoinBigIndex cleanMatrix(double threshold = 1.0e-20);
268 void copy(const ClpMatrixBase *from, ClpMatrixBase *&to);
269#ifndef CLP_NO_STD
271 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
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
319 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 {
340 }
341 void setPrimalTolerance(double value);
343 inline double dualTolerance() const
344 {
346 }
347 void setDualTolerance(double value);
349 inline double primalObjectiveLimit() const
350 {
352 }
353 void setPrimalObjectiveLimit(double value);
355 inline double dualObjectiveLimit() const
356 {
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 {
370 }
371#ifndef CLP_NO_STD
372 inline const std::string &problemName() const
373 {
374 return strParam_[ClpProbName];
375 }
376#endif
378 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 {
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);
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 }
452 inline int secondaryStatus() const
453 {
454 return secondaryStatus_;
455 }
456 inline void setSecondaryStatus(int newstatus)
457 {
458 secondaryStatus_ = newstatus;
459 }
461 inline bool isAbandoned() const
462 {
463 return problemStatus_ == 4;
464 }
466 inline bool isProvenOptimal() const
467 {
468 return problemStatus_ == 0;
469 }
471 inline bool isProvenPrimalInfeasible() const
472 {
473 return problemStatus_ == 1;
474 }
476 inline bool isProvenDualInfeasible() const
477 {
478 return problemStatus_ == 2;
479 }
485 inline bool isIterationLimitReached() const
486 {
487 return problemStatus_ == 3;
488 }
490 inline double optimizationDirection() const
491 {
493 }
494 inline double getObjSense() const
495 {
497 }
498 void setOptimizationDirection(double value);
500 inline double *primalRowSolution() const
501 {
502 return rowActivity_;
503 }
504 inline const double *getRowActivity() const
505 {
506 return rowActivity_;
507 }
509 inline double *primalColumnSolution() const
510 {
511 return columnActivity_;
512 }
513 inline const double *getColSolution() const
514 {
515 return columnActivity_;
516 }
517 inline void setColSolution(const double *input)
518 {
519 memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
520 }
522 inline double *dualRowSolution() const
523 {
524 return dual_;
525 }
526 inline const double *getRowPrice() const
527 {
528 return dual_;
529 }
531 inline double *dualColumnSolution() const
532 {
533 return reducedCost_;
534 }
535 inline const double *getReducedCost() const
536 {
537 return reducedCost_;
538 }
540 inline double *rowLower() const
541 {
542 return rowLower_;
543 }
544 inline const double *getRowLower() const
545 {
546 return rowLower_;
547 }
549 inline double *rowUpper() const
550 {
551 return rowUpper_;
552 }
553 inline const double *getRowUpper() const
554 {
555 return rowUpper_;
556 }
557 //-------------------------------------------------------------------------
561 void setObjectiveCoefficient(int elementIndex, double elementValue);
563 inline void setObjCoeff(int elementIndex, double elementValue)
564 {
565 setObjectiveCoefficient(elementIndex, elementValue);
566 }
567
570 void setColumnLower(int elementIndex, double elementValue);
571
574 void setColumnUpper(int elementIndex, double elementValue);
575
577 void setColumnBounds(int elementIndex,
578 double lower, double upper);
579
588 void setColumnSetBounds(const int *indexFirst,
589 const int *indexLast,
590 const double *boundList);
591
594 inline void setColLower(int elementIndex, double elementValue)
595 {
596 setColumnLower(elementIndex, elementValue);
597 }
600 inline void setColUpper(int elementIndex, double elementValue)
601 {
602 setColumnUpper(elementIndex, elementValue);
603 }
604
606 inline void setColBounds(int elementIndex,
607 double lower, double upper)
608 {
609 setColumnBounds(elementIndex, lower, upper);
610 }
611
618 inline void setColSetBounds(const int *indexFirst,
619 const int *indexLast,
620 const double *boundList)
621 {
622 setColumnSetBounds(indexFirst, indexLast, boundList);
623 }
624
627 void setRowLower(int elementIndex, double elementValue);
628
631 void setRowUpper(int elementIndex, double elementValue);
632
634 void setRowBounds(int elementIndex,
635 double lower, double upper);
636
643 void setRowSetBounds(const int *indexFirst,
644 const int *indexLast,
645 const double *boundList);
646
648
649 inline const double *rowScale() const
650 {
651 return rowScale_;
652 }
653 inline const double *columnScale() const
654 {
655 return columnScale_;
656 }
657 inline const double *inverseRowScale() const
658 {
659 return inverseRowScale_;
660 }
661 inline const double *inverseColumnScale() const
662 {
663 return inverseColumnScale_;
664 }
665 inline double *mutableRowScale() const
666 {
667 return rowScale_;
668 }
669 inline double *mutableColumnScale() const
670 {
671 return columnScale_;
672 }
673 inline double *mutableInverseRowScale() const
674 {
675 return inverseRowScale_;
676 }
677 inline double *mutableInverseColumnScale() const
678 {
679 return inverseColumnScale_;
680 }
681 inline double *swapRowScale(double *newScale)
682 {
683 double *oldScale = rowScale_;
684 rowScale_ = newScale;
685 return oldScale;
686 }
687 void setRowScale(double *scale);
688 void setColumnScale(double *scale);
690 inline double objectiveScale() const
691 {
692 return objectiveScale_;
693 }
694 inline void setObjectiveScale(double value)
695 {
696 objectiveScale_ = value;
697 }
699 inline double rhsScale() const
700 {
701 return rhsScale_;
702 }
703 inline void setRhsScale(double value)
704 {
705 rhsScale_ = value;
706 }
708 void scaling(int mode = 1);
711 void unscale();
713 inline int scalingFlag() const
714 {
715 return scalingFlag_;
716 }
718 inline double *objective() const
719 {
720 if (objective_) {
721 double offset;
722 return objective_->gradient(NULL, NULL, offset, false);
723 } else {
724 return NULL;
725 }
726 }
727 inline double *objective(const double *solution, double &offset, bool refresh = true) const
728 {
729 offset = 0.0;
730 if (objective_) {
731 return objective_->gradient(NULL, solution, offset, refresh);
732 } else {
733 return NULL;
734 }
735 }
736 inline const double *getObjCoefficients() const
737 {
738 if (objective_) {
739 double offset;
740 return objective_->gradient(NULL, NULL, offset, false);
741 } else {
742 return NULL;
743 }
744 }
746 inline double *rowObjective() const
747 {
748 return rowObjective_;
749 }
750 inline const double *getRowObjCoefficients() const
751 {
752 return rowObjective_;
753 }
755 inline double *columnLower() const
756 {
757 return columnLower_;
758 }
759 inline const double *getColLower() const
760 {
761 return columnLower_;
762 }
764 inline double *columnUpper() const
765 {
766 return columnUpper_;
767 }
768 inline const double *getColUpper() const
769 {
770 return columnUpper_;
771 }
773 inline CoinPackedMatrix *matrix() const
774 {
775 if (matrix_ == NULL)
776 return NULL;
777 else
778 return matrix_->getPackedMatrix();
779 }
781 inline CoinBigIndex getNumElements() const
782 {
783 return matrix_->getNumElements();
784 }
787 inline double getSmallElementValue() const
788 {
789 return smallElement_;
790 }
791 inline void setSmallElementValue(double value)
792 {
793 smallElement_ = value;
794 }
796 inline ClpMatrixBase *rowCopy() const
797 {
798 return rowCopy_;
799 }
803 inline ClpMatrixBase *clpMatrix() const
804 {
805 return matrix_;
806 }
809 {
810 return scaledMatrix_;
811 }
813 inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
814 {
815 delete scaledMatrix_;
816 scaledMatrix_ = scaledMatrix;
817 }
820 {
821 ClpPackedMatrix *oldMatrix = scaledMatrix_;
822 scaledMatrix_ = scaledMatrix;
823 return oldMatrix;
824 }
830 void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent = false);
836 inline void replaceMatrix(CoinPackedMatrix *newmatrix,
837 bool deleteCurrent = false)
838 {
839 replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
840 }
842 inline double objectiveValue() const
843 {
845 }
846 inline void setObjectiveValue(double value)
847 {
849 }
850 inline double getObjValue() const
851 {
853 }
855 inline char *integerInformation() const
856 {
857 return integerType_;
858 }
861 double *infeasibilityRay(bool fullRay = false) const;
862 double *unboundedRay() const;
864 inline double *ray() const
865 {
866 return ray_;
867 }
869 inline bool rayExists() const
870 {
871 return (ray_ != NULL);
872 }
874 inline void deleteRay()
875 {
876 delete[] ray_;
877 ray_ = NULL;
878 }
880 inline const double *internalRay() const
881 {
882 return ray_;
883 }
885 inline bool statusExists() const
886 {
887 return (status_ != NULL);
888 }
890 inline unsigned char *statusArray() const
891 {
892 return status_;
893 }
896 unsigned char *statusCopy() const;
898 void copyinStatus(const unsigned char *statusArray);
899
901 inline void setUserPointer(void *pointer)
902 {
903 userPointer_ = pointer;
904 }
905 inline void *getUserPointer() const
906 {
907 return userPointer_;
908 }
911 {
912 trustedUserPointer_ = pointer;
913 }
915 {
916 return trustedUserPointer_;
917 }
919 inline int whatsChanged() const
920 {
921 return whatsChanged_;
922 }
923 inline void setWhatsChanged(int value)
924 {
925 whatsChanged_ = value;
926 }
928 inline int numberThreads() const
929 {
930 return numberThreads_;
931 }
932 inline void setNumberThreads(int value)
933 {
934 numberThreads_ = value;
935 }
937
940 void passInMessageHandler(CoinMessageHandler *handler);
942 CoinMessageHandler *pushMessageHandler(CoinMessageHandler *handler,
943 bool &oldDefault);
945 void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault);
947 void newLanguage(CoinMessages::Language language);
948 inline void setLanguage(CoinMessages::Language language)
949 {
950 newLanguage(language);
951 }
955 inline CoinMessageHandler *messageHandler() const
956 {
957 return handler_;
958 }
960 inline CoinMessages messages() const
961 {
962 return messages_;
963 }
965 inline CoinMessages *messagesPointer()
966 {
967 return &messages_;
968 }
970 inline CoinMessages coinMessages() const
971 {
972 return coinMessages_;
973 }
975 inline CoinMessages *coinMessagesPointer()
976 {
977 return &coinMessages_;
978 }
987 inline void setLogLevel(int value)
988 {
989 handler_->setLogLevel(value);
990 }
991 inline int logLevel() const
992 {
993 return handler_->logLevel();
994 }
996 inline bool defaultHandler() const
997 {
998 return defaultHandler_;
999 }
1004 {
1005 return eventHandler_;
1006 }
1008 inline CoinThreadRandom *randomNumberGenerator()
1009 {
1010 return &randomNumberGenerator_;
1011 }
1013 inline CoinThreadRandom &mutableRandomNumberGenerator()
1014 {
1016 }
1018 inline void setRandomSeed(int value)
1019 {
1020 randomNumberGenerator_.setSeed(value);
1021 }
1023 inline int lengthNames() const
1024 {
1025 return lengthNames_;
1026 }
1027#ifndef CLP_NO_STD
1029 inline void setLengthNames(int value)
1030 {
1031 lengthNames_ = value;
1032 }
1034 inline const std::vector< std::string > *rowNames() const
1035 {
1036 return &rowNames_;
1037 }
1038 inline const std::string &rowName(int iRow) const
1039 {
1040 return rowNames_[iRow];
1041 }
1043 std::string getRowName(int iRow) const;
1045 inline const std::vector< std::string > *columnNames() const
1046 {
1047 return &columnNames_;
1048 }
1049 inline const std::string &columnName(int iColumn) const
1050 {
1051 return columnNames_[iColumn];
1052 }
1054 std::string getColumnName(int iColumn) const;
1055#endif
1058 {
1059 return objective_;
1060 }
1062 inline void setObjectivePointer(ClpObjective *newobjective)
1063 {
1064 objective_ = newobjective;
1065 }
1068 int emptyProblem(int *infeasNumber = NULL, double *infeasSum = NULL, bool printMessage = true);
1069
1071
1080 void times(double scalar,
1081 const double *x, double *y) const;
1085 void transposeTimes(double scalar,
1086 const double *x, double *y) const;
1088
1089 //---------------------------------------------------------------------------
1107
1108 bool setIntParam(ClpIntParam key, int value);
1110 bool setDblParam(ClpDblParam key, double value);
1111#ifndef CLP_NO_STD
1113 bool setStrParam(ClpStrParam key, const std::string &value);
1114#endif
1115 // Get an integer parameter
1116 inline bool getIntParam(ClpIntParam key, int &value) const
1117 {
1118 if (key < ClpLastIntParam) {
1119 value = intParam_[key];
1120 return true;
1121 } else {
1122 return false;
1123 }
1124 }
1125 // Get an double parameter
1126 inline bool getDblParam(ClpDblParam key, double &value) const
1127 {
1128 if (key < ClpLastDblParam) {
1129 value = dblParam_[key];
1130 return true;
1131 } else {
1132 return false;
1133 }
1134 }
1135#ifndef CLP_NO_STD
1136 // Get a string parameter
1137 inline bool getStrParam(ClpStrParam key, std::string &value) const
1138 {
1139 if (key < ClpLastStrParam) {
1140 value = strParam_[key];
1141 return true;
1142 } else {
1143 return false;
1144 }
1145 }
1146#endif
1148 void generateCpp(FILE *fp);
1185 inline unsigned int specialOptions() const
1186 {
1187 return specialOptions_;
1188 }
1189 void setSpecialOptions(unsigned int value);
1190#define COIN_CBC_USING_CLP 0x01000000
1191 inline bool inCbcBranchAndBound() const
1192 {
1193 return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1194 }
1196
1199protected:
1201 void gutsOfDelete(int type);
1205 void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1207 void getRowBound(int iRow, double &lower, double &upper) const;
1210 const double *collb, const double *colub,
1211 const double *obj,
1212 const double *rowlb, const double *rowub,
1213 const double *rowObjective = NULL);
1217 inline double rawObjectiveValue() const
1218 {
1219 return objectiveValue_;
1220 }
1222 inline bool permanentArrays() const
1223 {
1224 return (specialOptions_ & 65536) != 0;
1225 }
1231 const char *const *rowNamesAsChar() const;
1233 const char *const *columnNamesAsChar() const;
1235 void deleteNamesAsChar(const char *const *names, int number) const;
1239
1241protected:
1265 double *dual_;
1269 double *rowLower_;
1271 double *rowUpper_;
1287 double *ray_;
1289 double *rowScale_;
1306 unsigned char *status_;
1335#define ROW_COLUMN_COUNTS_SAME 1
1336#define MATRIX_SAME 2
1337#define MATRIX_JUST_ROWS_ADDED 4
1338#define MATRIX_JUST_COLUMNS_ADDED 8
1339#define ROW_LOWER_SAME 16
1340#define ROW_UPPER_SAME 32
1341#define OBJECTIVE_SAME 64
1342#define COLUMN_LOWER_SAME 128
1343#define COLUMN_UPPER_SAME 256
1344#define BASIS_SAME 512
1345#define ALL_SAME 65339
1346#define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1347 unsigned int whatsChanged_;
1359 unsigned int specialOptions_;
1361 CoinMessageHandler *handler_;
1365 CoinThreadRandom randomNumberGenerator_;
1368#ifndef CLP_NO_STD
1370 std::vector< std::string > rowNames_;
1372 std::vector< std::string > columnNames_;
1373#endif
1375 CoinMessages messages_;
1377 CoinMessages coinMessages_;
1387 CoinPackedMatrix baseMatrix_;
1389 CoinPackedMatrix baseRowCopy_;
1394#ifndef CLP_NO_STD
1397#endif
1399};
1438
1439#endif
1440
1441/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1442*/
#define COIN_CBC_USING_CLP
ClpIntParam
This is where to put any useful stuff.
@ ClpMaxNumIteration
The maximum number of iterations Clp can execute in the simplex methods.
@ ClpLastIntParam
Just a marker, so that we can allocate a static sized array to store parameters.
ClpStrParam
@ ClpLastStrParam
Just a marker, so that we can allocate a static sized array to store parameters.
@ ClpProbName
Name of the problem.
ClpDblParam
@ ClpPresolveTolerance
Tolerance to use in presolve.
@ ClpDualTolerance
The maximum amount the dual constraints can be violated and still be considered feasible.
@ ClpPrimalObjectiveLimit
Primal objective limit.
@ ClpMaxSeconds
Maximum time in seconds - after, this action is as max iterations.
@ ClpDualObjectiveLimit
Set Dual objective limit.
@ ClpLastDblParam
Just a marker, so that we can allocate a static sized array to store parameters.
@ ClpPrimalTolerance
The maximum amount the primal constraints can be violated and still be considered feasible.
@ ClpObjOffset
Objective function constant.
This is a tiny class where data can be saved round calls.
unsigned int specialOptions_
double acceptablePivot_
double pivotTolerance_
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
int sparseThreshold_
ClpDataSave()
Default constructor.
~ClpDataSave()
Destructor.
ClpDataSave(const ClpDataSave &)
Copy constructor.
double zeroSimplexTolerance_
double dualBound_
double zeroFactorizationTolerance_
double infeasibilityCost_
double objectiveScale_
int forceFactorization_
Base class for Clp event handling.
Abstract base class for Clp Matrices.
virtual CoinPackedMatrix * getPackedMatrix() const =0
Return a complete CoinPackedMatrix.
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
bool inCbcBranchAndBound() const
bool getIntParam(ClpIntParam key, int &value) const
void setSmallElementValue(double value)
Definition ClpModel.hpp:791
const double * inverseColumnScale() const
Definition ClpModel.hpp:661
void chgRowLower(const double *rowLower)
Change row lower bounds.
double * dualColumnSolution() const
Reduced costs.
Definition ClpModel.hpp:531
const double * getColUpper() const
Definition ClpModel.hpp:768
const char *const * columnNamesAsChar() const
Create column names as char **.
void * userPointer_
User pointer for whatever reason.
std::string strParam_[ClpLastStrParam]
Array of string parameters.
int numberColumns_
Number of columns.
CoinBigIndex cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
void setColumnScale(double *scale)
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most)
int getNumRows() const
Definition ClpModel.hpp:323
bool setDblParam(ClpDblParam key, double value)
Set an double parameter.
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
double getObjValue() const
Definition ClpModel.hpp:850
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition ClpModel.hpp:910
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition ClpModel.hpp:781
ClpObjective * objectiveAsObject() const
Objective methods.
void setContinuous(int index)
Set the index-th variable to be a continuous variable.
bool defaultHandler_
Flag to say if default handler (so delete)
void copyRowNames(const std::vector< std::string > &rowNames, int first, int last)
Copies in Row names - modifies names first .. last-1.
const double * getObjCoefficients() const
Definition ClpModel.hpp:736
int emptyProblem(int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
Solve a problem with no elements - return status and dual and primal infeasibilites.
unsigned char * status_
Status (i.e.
bool isInteger(int index) const
Return true if the index-th variable is an integer variable.
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
CoinMessages messages_
Messages.
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int problemStatus_
Status of problem.
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
bool setIntParam(ClpIntParam key, int value)
Set an integer parameter.
int addRows(CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
Add rows from a model object.
double dualTolerance() const
Dual tolerance to use.
Definition ClpModel.hpp:343
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition ClpModel.hpp:864
void gutsOfScaling()
Does much of scaling.
void setObjectiveValue(double value)
Definition ClpModel.hpp:846
const std::string & columnName(int iColumn) const
CoinPackedMatrix baseMatrix_
Base packed matrix.
double * primalColumnSolution() const
Primal column solution.
Definition ClpModel.hpp:509
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
int intParam_[ClpLastIntParam]
Array of integer parameters.
CoinMessageHandler * handler_
Message handler.
double objectiveValue() const
Objective value.
Definition ClpModel.hpp:842
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
const char *const * rowNamesAsChar() const
Create row names as char **.
void returnModel(ClpModel &otherModel)
Return model - nulls all arrays so can be deleted safely also updates any scalars.
void deleteNamesAsChar(const char *const *names, int number) const
Delete char * version of names.
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *columnLengths, const int *rows, const double *elements)
int status() const
Status of problem: -1 - unknown e.g.
Definition ClpModel.hpp:423
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
Load up quadratic objective.
void setRowScale(double *scale)
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
std::vector< std::string > columnNames_
Column names.
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
~ClpModel()
Destructor.
bool setStrParam(ClpStrParam key, const std::string &value)
Set an string parameter.
char * integerType_
Integer information.
void scaling(int mode=1)
Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab...
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
void setSpecialOptions(unsigned int value)
double * rowUpper_
Row upper.
ClpMatrixBase * rowCopy_
Row copy if wanted.
const double * getReducedCost() const
Definition ClpModel.hpp:535
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).
double primalTolerance() const
Primal tolerance to use.
Definition ClpModel.hpp:337
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition ClpModel.hpp:869
char * integerInformation() const
Integer information.
Definition ClpModel.hpp:855
void setDualTolerance(double value)
double * rowLower_
Row lower.
void setLanguage(CoinMessages::Language language)
Definition ClpModel.hpp:948
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
void setMaximumWallSeconds(double value)
double * unboundedRay() const
double objectiveOffset() const
Objective offset.
Definition ClpModel.hpp:361
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
Add columns.
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
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.
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:987
unsigned int specialOptions() const
For advanced options 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
Definition ClpModel.hpp:618
double rhsScale_
Scaling of rhs and bounds.
void copyInIntegerInformation(const char *information)
Copy in integer informations.
CoinMessages * messagesPointer()
Return pointer to messages.
Definition ClpModel.hpp:965
void times(double scalar, const double *x, double *y) const
Return y + A * x * scalar in y.
void getRowBound(int iRow, double &lower, double &upper) const
gets lower and upper bounds on rows
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition ClpModel.hpp:727
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...
int logLevel() const
Definition ClpModel.hpp:991
double * savedColumnScale_
Saved column scale factors.
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
Definition ClpModel.hpp:880
int scalingFlag() const
Gets scalingFlag.
Definition ClpModel.hpp:713
int secondaryStatus_
Secondary status of problem.
void setNumberThreads(int value)
Definition ClpModel.hpp:932
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
double * columnUpper_
Column Upper.
int maximumColumns_
Maximum number of columns in model.
double * mutableColumnScale() const
Definition ClpModel.hpp:669
int numberThreads_
Number of threads (not very operational)
double getObjSense() const
Definition ClpModel.hpp:494
void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault)
back to previous message handler
const double * getRowActivity() const
Definition ClpModel.hpp:504
void deleteRowsAndColumns(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Deletes rows AND columns (keeps old sizes)
const std::vector< std::string > * columnNames() const
Column names.
void * getUserPointer() const
Definition ClpModel.hpp:905
double * infeasibilityRay(bool fullRay=false) const
Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays...
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinPackedVectorBase *const *columns)
double rhsScale() const
Scaling of rhs and bounds.
Definition ClpModel.hpp:699
int numberIterations_
Number of iterations.
void setObjectiveScale(double value)
Definition ClpModel.hpp:694
void setSecondaryStatus(int newstatus)
Definition ClpModel.hpp:456
int getIterationCount() const
Definition ClpModel.hpp:382
ClpModel(const ClpModel *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true)
Subproblem constructor.
void newLanguage(CoinMessages::Language language)
Set language.
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
void setObjectivePointer(ClpObjective *newobjective)
double * columnUpper() const
Column Upper.
Definition ClpModel.hpp:764
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition ClpModel.hpp:234
double rawObjectiveValue() const
Objective value - always minimize.
bool getStrParam(ClpStrParam key, std::string &value) const
ClpObjective * objective_
Objective.
bool getDblParam(ClpDblParam key, double &value) const
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
Add one row.
double * primalRowSolution() const
Primal row solution.
Definition ClpModel.hpp:500
int maximumIterations() const
Maximum number of iterations.
Definition ClpModel.hpp:400
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition ClpModel.hpp:885
void onStopped()
On stopped - sets secondary status.
const double * getColSolution() const
Definition ClpModel.hpp:513
void loadProblem(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const int *length, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
This one is for after presolve to save memory.
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition ClpModel.hpp:803
int numberRows_
Number of rows.
double dblParam_[ClpLastDblParam]
Array of double parameters.
const double * inverseRowScale() const
Definition ClpModel.hpp:657
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
int maximumRows_
Maximum number of rows in model.
double * savedRowScale_
Saved row scale factors for matrix.
int lengthNames_
length of names (0 means no names)
void loadProblem(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
Just like the other loadProblem() method except that the matrix is given in a standard column major o...
double * rowObjective() const
Row Objective.
Definition ClpModel.hpp:746
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
double objectiveScale_
Scaling of objective.
double dualObjectiveLimit() const
Dual objective limit.
Definition ClpModel.hpp:355
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
void deleteIntegerInformation()
Drop integer informations.
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition ClpModel.hpp:406
void setLengthNames(int value)
length of names (0 means no names0
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
const double * rowScale() const
Scaling.
Definition ClpModel.hpp:649
void deleteRows(int number, const int *which)
Deletes rows.
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...
void loadQuadraticObjective(const CoinPackedMatrix &matrix)
CoinMessages coinMessages_
Coin messages.
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition ClpModel.hpp:476
int getNumCols() const
Number of columns.
Definition ClpModel.hpp:328
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinPackedVectorBase *const *rows)
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
Add rows.
double * columnScale_
Column scale factors.
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition ClpModel.hpp:490
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition ClpModel.hpp:819
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition ClpModel.hpp:471
CoinMessages coinMessages() const
Return Coin messages.
Definition ClpModel.hpp:970
void setNumberIterations(int numberIterationsNew)
Definition ClpModel.hpp:386
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition ClpModel.hpp:787
double * rowLower() const
Row lower.
Definition ClpModel.hpp:540
double presolveTolerance() const
Presolve tolerance to use.
Definition ClpModel.hpp:367
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
const std::string & rowName(int iRow) const
CoinMessages messages() const
Return messages.
Definition ClpModel.hpp:960
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition ClpModel.hpp:796
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition ClpModel.hpp:890
double * objective() const
Objective.
Definition ClpModel.hpp:718
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition ClpModel.hpp:606
const std::vector< std::string > * rowNames() const
Row names.
void setSolveType(int type)
Definition ClpModel.hpp:395
void setDefaultMessageHandler()
Overrides message handler with a default one.
ClpModel & operator=(const ClpModel &rhs)
Assignment operator. This copies the data.
void synchronizeMatrix()
Makes sure matrix dimensions are at least model dimensions.
double * rowActivity_
Row activities.
unsigned int whatsChanged_
double objectiveScale() const
Scaling of objective.
Definition ClpModel.hpp:690
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
int numberColumns() const
Definition ClpModel.hpp:332
void deleteQuadraticObjective()
Get rid of quadratic objective.
void setObjective(ClpObjective *objective)
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition ClpModel.hpp:901
int numberRows() const
Number of rows.
Definition ClpModel.hpp:319
void startPermanentArrays()
Start using maximumRows_ and Columns_.
double * inverseColumnScale_
Inverse column scale factors for matrix (end of columnScale_)
void setRhsScale(double value)
Definition ClpModel.hpp:703
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition ClpModel.hpp:600
ClpMatrixBase * matrix_
Packed matrix.
void setColumnName(int colIndex, std::string &name)
Set name of col.
const double * getRowLower() const
Definition ClpModel.hpp:544
void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
bool permanentArrays() const
If we are using maximumRows_ and Columns_.
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition ClpModel.hpp:773
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
void deleteColumns(int number, const int *which)
Deletes columns.
int readGMPL(const char *filename, const char *dataName, bool keepNames=false)
Read GMPL files from the given filenames.
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
void setDualObjectiveLimit(double value)
int addColumns(const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
Add columns from a build object If tryPlusMinusOne then will try adding as +-1 matrix if no matrix ex...
void setOptimizationDirection(double value)
double * columnLower() const
Column Lower.
Definition ClpModel.hpp:755
CoinPackedMatrix baseRowCopy_
Base row copy.
double primalObjectiveLimit() const
Primal objective limit.
Definition ClpModel.hpp:349
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows.
void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
double objectiveValue_
Objective value.
void copyColumnNames(const char *const *columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
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.
void chgColumnLower(const double *columnLower)
Change column lower bounds.
void setPrimalObjectiveLimit(double value)
int addRows(const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
Add rows from a build object.
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition ClpModel.hpp:594
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition ClpModel.hpp:391
int problemStatus() const
Definition ClpModel.hpp:427
bool isProvenOptimal() const
Is optimality proven?
Definition ClpModel.hpp:466
void copyRowNames(const char *const *rowNames, int first, int last)
Copies in Row names - modifies names first .. last-1.
CoinMessageHandler * pushMessageHandler(CoinMessageHandler *handler, bool &oldDefault)
Pass in Message handler (not deleted at end) and return current.
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition ClpModel.hpp:808
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition ClpModel.hpp:975
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition ClpModel.hpp:563
int numberIterations() const
Number of iterations.
Definition ClpModel.hpp:378
void setObjectiveOffset(double value)
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *rowLengths, const int *columns, const double *elements)
Add rows.
ClpModel(bool emptyMessages=false)
Default constructor.
int lengthNames() const
length of names (0 means no names0
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
double * columnLower_
Column Lower.
bool defaultHandler() const
Return true if default handler.
Definition ClpModel.hpp:996
void setPrimalTolerance(double value)
double * rowUpper() const
Row upper.
Definition ClpModel.hpp:549
void setColSolution(const double *input)
Definition ClpModel.hpp:517
int numberThreads() const
Number of threads (not really being used)
Definition ClpModel.hpp:928
const double * getColLower() const
Definition ClpModel.hpp:759
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.
double * swapRowScale(double *newScale)
Definition ClpModel.hpp:681
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
void setMaximumIterations(int value)
double * rowObjective_
Row Objective (? sign) - may be NULL.
double * columnActivity_
Column activities.
ClpEventHandler * eventHandler_
Event handler.
double * rowScale_
Row scale factors for matrix.
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition ClpModel.hpp:452
const std::string & problemName() const
Definition ClpModel.hpp:372
int loadProblem(CoinModel &modelObject, bool tryPlusMinusOne=false)
This loads a model from a coinModel object - returns number of errors.
double * mutableRowScale() const
Definition ClpModel.hpp:665
void unscale()
If we constructed a "really" scaled model then this reverses the operation.
void setMaximumSeconds(double value)
double * reducedCost_
Reduced costs.
double * dualRowSolution() const
Dual row solution.
Definition ClpModel.hpp:522
double * mutableInverseColumnScale() const
Definition ClpModel.hpp:677
ClpEventHandler * eventHandler() const
Event handler.
void createEmptyMatrix()
Create empty ClpPackedMatrix.
bool isIterationLimitReached() const
Iteration limit reached?
Definition ClpModel.hpp:485
const double * getRowObjCoefficients() const
Definition ClpModel.hpp:750
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
int addColumns(CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
Add columns from a model object.
const double * getRowUpper() const
Definition ClpModel.hpp:553
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
double * ray_
Infeasible/unbounded ray.
void copyNames(const std::vector< std::string > &rowNames, const std::vector< std::string > &columnNames)
Copies in names.
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:836
void setRandomSeed(int value)
Set seed for thread specific random number generator.
void copy(const ClpMatrixBase *from, ClpMatrixBase *&to)
Copy contents - resizing if necessary - otherwise re-use memory.
CoinModel * createCoinModel() const
This creates a coinModel object.
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition ClpModel.hpp:919
void deleteRay()
just delete ray if exists
Definition ClpModel.hpp:874
double smallElement_
Small element value.
void setInteger(int index)
Set the index-th variable to be an integer variable.
void borrowModel(ClpModel &otherModel)
Borrow model.
void setRowName(int rowIndex, std::string &name)
Set name of row.
const double * getRowPrice() const
Definition ClpModel.hpp:526
unsigned char * statusCopy() const
Return copy of status (i.e.
const double * columnScale() const
Definition ClpModel.hpp:653
double * dual_
Duals.
bool isAbandoned() const
Are there a numerical difficulties?
Definition ClpModel.hpp:461
std::vector< std::string > rowNames_
Row names.
unsigned int specialOptions_
For advanced options See get and set for meaning.
CoinMessageHandler * messageHandler() const
Return handler.
Definition ClpModel.hpp:955
ClpTrustedData * getTrustedUserPointer() const
Definition ClpModel.hpp:914
ClpModel(const ClpModel &rhs, int scalingMode=-1)
Copy constructor.
double * mutableInverseRowScale() const
Definition ClpModel.hpp:673
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition ClpModel.hpp:813
void setWhatsChanged(int value)
Definition ClpModel.hpp:923
void dropNames()
Drops names - makes lengthnames 0 and names empty.
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition ClpModel.hpp:432
Objective Abstract Base Class.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
For a structure to be used by trusted code.