Clp 1.17.5
Loading...
Searching...
No Matches
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"
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 }
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 }
484 inline bool isIterationLimitReached() const
485 {
486 return problemStatus_ == 3;
487 }
489 inline double optimizationDirection() const
490 {
492 }
493 inline double getObjSense() const
494 {
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
648 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 }
802 inline ClpMatrixBase *clpMatrix() const
803 {
804 return matrix_;
805 }
808 {
809 return scaledMatrix_;
810 }
812 inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
813 {
814 delete scaledMatrix_;
815 scaledMatrix_ = scaledMatrix;
816 }
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 {
844 }
845 inline void setObjectiveValue(double value)
846 {
848 }
849 inline double getObjValue() const
850 {
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 }
910 {
911 trustedUserPointer_ = pointer;
912 }
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
939 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 }
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 }
1003 {
1004 return eventHandler_;
1005 }
1007 inline CoinThreadRandom *randomNumberGenerator()
1008 {
1009 return &randomNumberGenerator_;
1010 }
1012 inline CoinThreadRandom &mutableRandomNumberGenerator()
1013 {
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
1028 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
1057 {
1058 return objective_;
1059 }
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
1107 bool setIntParam(ClpIntParam key, int value);
1109 bool setDblParam(ClpDblParam key, double value);
1110#ifndef CLP_NO_STD
1112 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
1147 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
1198protected:
1200 void gutsOfDelete(int type);
1204 void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1206 void getRowBound(int iRow, double &lower, double &upper) const;
1209 const double *collb, const double *colub,
1210 const double *obj,
1211 const double *rowlb, const double *rowub,
1212 const double *rowObjective = NULL);
1216 inline double rawObjectiveValue() const
1217 {
1218 return objectiveValue_;
1219 }
1221 inline bool permanentArrays() const
1222 {
1223 return (specialOptions_ & 65536) != 0;
1224 }
1230 const char *const *rowNamesAsChar() const;
1232 const char *const *columnNamesAsChar() const;
1234 void deleteNamesAsChar(const char *const *names, int number) const;
1238
1240protected:
1264 double *dual_;
1268 double *rowLower_;
1270 double *rowUpper_;
1286 double *ray_;
1288 double *rowScale_;
1305 unsigned char *status_;
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_;
1358 unsigned int specialOptions_;
1360 CoinMessageHandler *handler_;
1364 CoinThreadRandom randomNumberGenerator_;
1367#ifndef CLP_NO_STD
1369 std::vector< std::string > rowNames_;
1371 std::vector< std::string > columnNames_;
1372#endif
1374 CoinMessages messages_;
1376 CoinMessages coinMessages_;
1386 CoinPackedMatrix baseMatrix_;
1388 CoinPackedMatrix baseRowCopy_;
1393#ifndef CLP_NO_STD
1396#endif
1398};
1437
1438#endif
1439
1440/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1441*/
#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:790
const double * inverseColumnScale() const
Definition ClpModel.hpp:660
void chgRowLower(const double *rowLower)
Change row lower bounds.
double * dualColumnSolution() const
Reduced costs.
Definition ClpModel.hpp:530
const double * getColUpper() const
Definition ClpModel.hpp:767
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:849
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition ClpModel.hpp:909
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition ClpModel.hpp:780
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:735
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:863
void gutsOfScaling()
Does much of scaling.
void setObjectiveValue(double value)
Definition ClpModel.hpp:845
const std::string & columnName(int iColumn) const
CoinPackedMatrix baseMatrix_
Base packed matrix.
double * primalColumnSolution() const
Primal column solution.
Definition ClpModel.hpp:508
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:841
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:534
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:868
char * integerInformation() const
Integer information.
Definition ClpModel.hpp:854
void setDualTolerance(double value)
double * rowLower_
Row lower.
void setLanguage(CoinMessages::Language language)
Definition ClpModel.hpp:947
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:986
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:617
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:964
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:726
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:990
double * savedColumnScale_
Saved column scale factors.
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
Definition ClpModel.hpp:879
int scalingFlag() const
Gets scalingFlag.
Definition ClpModel.hpp:712
int secondaryStatus_
Secondary status of problem.
void setNumberThreads(int value)
Definition ClpModel.hpp:931
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:668
int numberThreads_
Number of threads (not very operational)
double getObjSense() const
Definition ClpModel.hpp:493
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:503
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:904
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:698
int numberIterations_
Number of iterations.
void setObjectiveScale(double value)
Definition ClpModel.hpp:693
void setSecondaryStatus(int newstatus)
Definition ClpModel.hpp:455
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:763
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:499
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:884
void onStopped()
On stopped - sets secondary status.
const double * getColSolution() const
Definition ClpModel.hpp:512
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:802
int numberRows_
Number of rows.
double dblParam_[ClpLastDblParam]
Array of double parameters.
const double * inverseRowScale() const
Definition ClpModel.hpp:656
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:745
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:648
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:475
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:489
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition ClpModel.hpp:818
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition ClpModel.hpp:470
CoinMessages coinMessages() const
Return Coin messages.
Definition ClpModel.hpp:969
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:786
double * rowLower() const
Row lower.
Definition ClpModel.hpp:539
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:959
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition ClpModel.hpp:795
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition ClpModel.hpp:889
double * objective() const
Objective.
Definition ClpModel.hpp:717
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition ClpModel.hpp:605
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:689
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:900
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:702
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition ClpModel.hpp:599
ClpMatrixBase * matrix_
Packed matrix.
void setColumnName(int colIndex, std::string &name)
Set name of col.
const double * getRowLower() const
Definition ClpModel.hpp:543
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:772
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:754
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:593
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:465
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:807
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition ClpModel.hpp:974
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition ClpModel.hpp:562
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:995
void setPrimalTolerance(double value)
double * rowUpper() const
Row upper.
Definition ClpModel.hpp:548
void setColSolution(const double *input)
Definition ClpModel.hpp:516
int numberThreads() const
Number of threads (not really being used)
Definition ClpModel.hpp:927
const double * getColLower() const
Definition ClpModel.hpp:758
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:680
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:451
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:664
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:521
double * mutableInverseColumnScale() const
Definition ClpModel.hpp:676
ClpEventHandler * eventHandler() const
Event handler.
void createEmptyMatrix()
Create empty ClpPackedMatrix.
bool isIterationLimitReached() const
Iteration limit reached?
Definition ClpModel.hpp:484
const double * getRowObjCoefficients() const
Definition ClpModel.hpp:749
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:552
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:835
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:918
void deleteRay()
just delete ray if exists
Definition ClpModel.hpp:873
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:525
unsigned char * statusCopy() const
Return copy of status (i.e.
const double * columnScale() const
Definition ClpModel.hpp:652
double * dual_
Duals.
bool isAbandoned() const
Are there a numerical difficulties?
Definition ClpModel.hpp:460
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:954
ClpTrustedData * getTrustedUserPointer() const
Definition ClpModel.hpp:913
ClpModel(const ClpModel &rhs, int scalingMode=-1)
Copy constructor.
double * mutableInverseRowScale() const
Definition ClpModel.hpp:672
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition ClpModel.hpp:812
void setWhatsChanged(int value)
Definition ClpModel.hpp:922
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.