Clp 1.17.6

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinModel.hpp
Go to the documentation of this file.
1 /* $Id: CoinModel.hpp 2083 2019-01-06 19:38:09Z unxusr $ */
2 // Copyright (C) 2005, 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 CoinModel_H
7 #define CoinModel_H
8
9 #include "CoinModelUseful.hpp"
10 #include "CoinMessageHandler.hpp"
11 #include "CoinPackedMatrix.hpp"
12 #include "CoinFinite.hpp"
13 class CoinBaseModel {
14
15 public:
18 CoinBaseModel();
20
22 CoinBaseModel(const CoinBaseModel &rhs);
23
25 CoinBaseModel &operator=(const CoinBaseModel &rhs);
26
28 virtual CoinBaseModel *clone() const = 0;
29
31 virtual ~CoinBaseModel();
33
36 inline int numberRows() const
38 {
39 return numberRows_;
40 }
42 inline int numberColumns() const
43 {
44 return numberColumns_;
45 }
47 virtual CoinBigIndex numberElements() const = 0;
51 inline double objectiveOffset() const
52 {
53 return objectiveOffset_;
54 }
56 inline void setObjectiveOffset(double value)
57 {
58 objectiveOffset_ = value;
59 }
61 inline double optimizationDirection() const
62 {
63 return optimizationDirection_;
64 }
66 inline void setOptimizationDirection(double value)
67 {
68 optimizationDirection_ = value;
69 }
71 inline int logLevel() const
72 {
73 return logLevel_;
74 }
76 void setLogLevel(int value);
78 inline const char *getProblemName() const
79 {
80 return problemName_.c_str();
81 }
83 void setProblemName(const char *name);
85 void setProblemName(const std::string &name);
87 inline const std::string &getRowBlock() const
88 {
89 return rowBlockName_;
90 }
92 inline void setRowBlock(const std::string &name)
93 {
94 rowBlockName_ = name;
95 }
97 inline const std::string &getColumnBlock() const
98 {
99 return columnBlockName_;
100 }
102 inline void setColumnBlock(const std::string &name)
103 {
104 columnBlockName_ = name;
105 }
107 void setMessageHandler(CoinMessageHandler *handler);
109
110 protected:
113 int numberRows_;
116 int numberColumns_;
118 double optimizationDirection_;
120 double objectiveOffset_;
122 std::string problemName_;
124 std::string rowBlockName_;
126 std::string columnBlockName_;
128 CoinMessageHandler *handler_;
130 CoinMessages messages_;
131
140 int logLevel_;
142 };
144
181 class CoinModel : public CoinBaseModel {
182
183 public:
187 void addRow(int numberInRow, const int *columns,
188 const double *elements, double rowLower = -COIN_DBL_MAX,
189 double rowUpper = COIN_DBL_MAX, const char *name = NULL);
191 void addColumn(int numberInColumn, const int *rows,
192 const double *elements,
193 double columnLower = 0.0,
194 double columnUpper = COIN_DBL_MAX, double objectiveValue = 0.0,
195 const char *name = NULL, bool isInteger = false);
197 inline void addCol(int numberInColumn, const int *rows,
198 const double *elements,
199 double columnLower = 0.0,
200 double columnUpper = COIN_DBL_MAX, double objectiveValue = 0.0,
201 const char *name = NULL, bool isInteger = false)
202 {
203 addColumn(numberInColumn, rows, elements, columnLower, columnUpper, objectiveValue,
204 name, isInteger);
205 }
207 inline void operator()(int i, int j, double value)
208 {
209 setElement(i, j, value);
210 }
212 void setElement(int i, int j, double value);
218 int getRow(int whichRow, int *column, double *element);
224 int getColumn(int whichColumn, int *column, double *element);
226 void setQuadraticElement(int i, int j, double value);
228 inline void operator()(int i, int j, const char *value)
229 {
230 setElement(i, j, value);
231 }
233 void setElement(int i, int j, const char *value);
235 int associateElement(const char *stringValue, double value);
239 void setRowLower(int whichRow, double rowLower);
243 void setRowUpper(int whichRow, double rowUpper);
247 void setRowBounds(int whichRow, double rowLower, double rowUpper);
251 void setRowName(int whichRow, const char *rowName);
255 void setColumnLower(int whichColumn, double columnLower);
259 void setColumnUpper(int whichColumn, double columnUpper);
263 void setColumnBounds(int whichColumn, double columnLower, double columnUpper);
267 void setColumnObjective(int whichColumn, double columnObjective);
271 void setColumnName(int whichColumn, const char *columnName);
275 void setColumnIsInteger(int whichColumn, bool columnIsInteger);
279 inline void setObjective(int whichColumn, double columnObjective)
280 {
281 setColumnObjective(whichColumn, columnObjective);
282 }
286 inline void setIsInteger(int whichColumn, bool columnIsInteger)
287 {
288 setColumnIsInteger(whichColumn, columnIsInteger);
289 }
293 inline void setInteger(int whichColumn)
294 {
295 setColumnIsInteger(whichColumn, true);
296 }
300 inline void setContinuous(int whichColumn)
301 {
302 setColumnIsInteger(whichColumn, false);
303 }
307 inline void setColLower(int whichColumn, double columnLower)
308 {
309 setColumnLower(whichColumn, columnLower);
310 }
314 inline void setColUpper(int whichColumn, double columnUpper)
315 {
316 setColumnUpper(whichColumn, columnUpper);
317 }
321 inline void setColBounds(int whichColumn, double columnLower, double columnUpper)
322 {
323 setColumnBounds(whichColumn, columnLower, columnUpper);
324 }
328 inline void setColObjective(int whichColumn, double columnObjective)
329 {
330 setColumnObjective(whichColumn, columnObjective);
331 }
335 inline void setColName(int whichColumn, const char *columnName)
336 {
337 setColumnName(whichColumn, columnName);
338 }
342 inline void setColIsInteger(int whichColumn, bool columnIsInteger)
343 {
344 setColumnIsInteger(whichColumn, columnIsInteger);
345 }
349 void setRowLower(int whichRow, const char *rowLower);
353 void setRowUpper(int whichRow, const char *rowUpper);
357 void setColumnLower(int whichColumn, const char *columnLower);
361 void setColumnUpper(int whichColumn, const char *columnUpper);
365 void setColumnObjective(int whichColumn, const char *columnObjective);
369 void setColumnIsInteger(int whichColumn, const char *columnIsInteger);
373 inline void setObjective(int whichColumn, const char *columnObjective)
374 {
375 setColumnObjective(whichColumn, columnObjective);
376 }
380 inline void setIsInteger(int whichColumn, const char *columnIsInteger)
381 {
382 setColumnIsInteger(whichColumn, columnIsInteger);
383 }
386 void deleteRow(int whichRow);
389 void deleteColumn(int whichColumn);
392 inline void deleteCol(int whichColumn)
393 {
394 deleteColumn(whichColumn);
395 }
397 CoinBigIndex deleteElement(int row, int column);
399 void deleteThisElement(int row, int column, CoinBigIndex position);
402 int packRows();
405 int packColumns();
408 inline int packCols()
409 {
410 return packColumns();
411 }
416 int pack();
417
420 void setObjective(int numberColumns, const double *objective);
423 void setColumnLower(int numberColumns, const double *columnLower);
426 inline void setColLower(int numberColumns, const double *columnLower)
427 {
428 setColumnLower(numberColumns, columnLower);
429 }
432 void setColumnUpper(int numberColumns, const double *columnUpper);
435 inline void setColUpper(int numberColumns, const double *columnUpper)
436 {
437 setColumnUpper(numberColumns, columnUpper);
438 }
441 void setRowLower(int numberRows, const double *rowLower);
444 void setRowUpper(int numberRows, const double *rowUpper);
445
471 int writeMps(const char *filename, int compression = 0,
472 int formatType = 0, int numberAcross = 2, bool keepStrings = false);
473
478 int differentModel(CoinModel &other, bool ignoreNames);
480
483 void passInMatrix(const CoinPackedMatrix &matrix);
487 int convertMatrix();
489 inline const CoinPackedMatrix *packedMatrix() const
490 {
491 return packedMatrix_;
492 }
494 inline const int *originalRows() const
495 {
496 return rowType_;
497 }
499 inline const int *originalColumns() const
500 {
501 return columnType_;
502 }
504
507 inline CoinBigIndex numberElements() const
509 {
510 return numberElements_;
511 }
513 inline const CoinModelTriple *elements() const
514 {
515 return elements_;
516 }
518 inline double operator()(int i, int j) const
519 {
520 return getElement(i, j);
521 }
523 double getElement(int i, int j) const;
525 inline double operator()(const char *rowName, const char *columnName) const
526 {
527 return getElement(rowName, columnName);
528 }
530 double getElement(const char *rowName, const char *columnName) const;
532 double getQuadraticElement(int i, int j) const;
537 const char *getElementAsString(int i, int j) const;
541 double *pointer(int i, int j) const;
545 CoinBigIndex position(int i, int j) const;
546
550 CoinModelLink firstInRow(int whichRow) const;
554 CoinModelLink lastInRow(int whichRow) const;
558 CoinModelLink firstInColumn(int whichColumn) const;
562 CoinModelLink lastInColumn(int whichColumn) const;
567 CoinModelLink next(CoinModelLink &current) const;
573 CoinModelLink previous(CoinModelLink &current) const;
578 CoinModelLink firstInQuadraticColumn(int whichColumn) const;
582 CoinModelLink lastInQuadraticColumn(int whichColumn) const;
585 double getRowLower(int whichRow) const;
588 double getRowUpper(int whichRow) const;
591 const char *getRowName(int whichRow) const;
592 inline double rowLower(int whichRow) const
593 {
594 return getRowLower(whichRow);
595 }
598 inline double rowUpper(int whichRow) const
599 {
600 return getRowUpper(whichRow);
601 }
604 inline const char *rowName(int whichRow) const
605 {
606 return getRowName(whichRow);
607 }
610 double getColumnLower(int whichColumn) const;
613 double getColumnUpper(int whichColumn) const;
616 double getColumnObjective(int whichColumn) const;
619 const char *getColumnName(int whichColumn) const;
622 bool getColumnIsInteger(int whichColumn) const;
625 inline double columnLower(int whichColumn) const
626 {
627 return getColumnLower(whichColumn);
628 }
631 inline double columnUpper(int whichColumn) const
632 {
633 return getColumnUpper(whichColumn);
634 }
637 inline double columnObjective(int whichColumn) const
638 {
639 return getColumnObjective(whichColumn);
640 }
643 inline double objective(int whichColumn) const
644 {
645 return getColumnObjective(whichColumn);
646 }
649 inline const char *columnName(int whichColumn) const
650 {
651 return getColumnName(whichColumn);
652 }
655 inline bool columnIsInteger(int whichColumn) const
656 {
657 return getColumnIsInteger(whichColumn);
658 }
661 inline bool isInteger(int whichColumn) const
662 {
663 return getColumnIsInteger(whichColumn);
664 }
667 inline double getColLower(int whichColumn) const
668 {
669 return getColumnLower(whichColumn);
670 }
673 inline double getColUpper(int whichColumn) const
674 {
675 return getColumnUpper(whichColumn);
676 }
679 inline double getColObjective(int whichColumn) const
680 {
681 return getColumnObjective(whichColumn);
682 }
685 inline const char *getColName(int whichColumn) const
686 {
687 return getColumnName(whichColumn);
688 }
691 inline bool getColIsInteger(int whichColumn) const
692 {
693 return getColumnIsInteger(whichColumn);
694 }
697 const char *getRowLowerAsString(int whichRow) const;
700 const char *getRowUpperAsString(int whichRow) const;
701 inline const char *rowLowerAsString(int whichRow) const
702 {
703 return getRowLowerAsString(whichRow);
704 }
707 inline const char *rowUpperAsString(int whichRow) const
708 {
709 return getRowUpperAsString(whichRow);
710 }
713 const char *getColumnLowerAsString(int whichColumn) const;
716 const char *getColumnUpperAsString(int whichColumn) const;
719 const char *getColumnObjectiveAsString(int whichColumn) const;
722 const char *getColumnIsIntegerAsString(int whichColumn) const;
725 inline const char *columnLowerAsString(int whichColumn) const
726 {
727 return getColumnLowerAsString(whichColumn);
728 }
731 inline const char *columnUpperAsString(int whichColumn) const
732 {
733 return getColumnUpperAsString(whichColumn);
734 }
737 inline const char *columnObjectiveAsString(int whichColumn) const
738 {
739 return getColumnObjectiveAsString(whichColumn);
740 }
743 inline const char *objectiveAsString(int whichColumn) const
744 {
745 return getColumnObjectiveAsString(whichColumn);
746 }
749 inline const char *columnIsIntegerAsString(int whichColumn) const
750 {
751 return getColumnIsIntegerAsString(whichColumn);
752 }
755 inline const char *isIntegerAsString(int whichColumn) const
756 {
757 return getColumnIsIntegerAsString(whichColumn);
758 }
760 int row(const char *rowName) const;
762 int column(const char *columnName) const;
764 inline int type() const
765 {
766 return type_;
767 }
769 inline double unsetValue() const
770 {
771 return -1.23456787654321e-97;
772 }
774 int createPackedMatrix(CoinPackedMatrix &matrix,
775 const double *associated);
781 int countPlusMinusOne(CoinBigIndex *startPositive, CoinBigIndex *startNegative,
782 const double *associated);
785 void createPlusMinusOne(CoinBigIndex *startPositive, CoinBigIndex *startNegative,
786 int *indices,
787 const double *associated);
789 int createArrays(double *&rowLower, double *&rowUpper,
790 double *&columnLower, double *&columnUpper,
791 double *&objective, int *&integerType,
792 double *&associated);
794 inline bool stringsExist() const
795 {
796 return string_.numberItems() != 0;
797 }
799 inline const CoinModelHash *stringArray() const
800 {
801 return &string_;
802 }
804 inline double *associatedArray() const
805 {
806 return associated_;
807 }
809 inline double *rowLowerArray() const
810 {
811 return rowLower_;
812 }
814 inline double *rowUpperArray() const
815 {
816 return rowUpper_;
817 }
819 inline double *columnLowerArray() const
820 {
821 return columnLower_;
822 }
824 inline double *columnUpperArray() const
825 {
826 return columnUpper_;
827 }
829 inline double *objectiveArray() const
830 {
831 return objective_;
832 }
834 inline int *integerTypeArray() const
835 {
836 return integerType_;
837 }
839 inline const CoinModelHash *rowNames() const
840 {
841 return &rowName_;
842 }
844 inline const CoinModelHash *columnNames() const
845 {
846 return &columnName_;
847 }
849 inline void zapRowNames()
850 {
851 rowName_ = CoinModelHash();
852 }
854 inline void zapColumnNames()
855 {
856 columnName_ = CoinModelHash();
857 }
859 inline const int *cutMarker() const
860 {
861 return cut_;
862 }
864 inline double optimizationDirection() const
865 {
866 return optimizationDirection_;
867 }
869 inline void setOptimizationDirection(double value)
870 {
871 optimizationDirection_ = value;
872 }
874 inline void *moreInfo() const
875 {
876 return moreInfo_;
877 }
879 inline void setMoreInfo(void *info)
880 {
881 moreInfo_ = info;
882 }
891 int whatIsSet() const;
893
911 void loadBlock(const CoinPackedMatrix &matrix,
912 const double *collb, const double *colub,
913 const double *obj,
914 const double *rowlb, const double *rowub);
931 void loadBlock(const CoinPackedMatrix &matrix,
932 const double *collb, const double *colub,
933 const double *obj,
934 const char *rowsen, const double *rowrhs,
935 const double *rowrng);
936
949 void loadBlock(const int numcols, const int numrows,
950 const CoinBigIndex *start, const int *index,
951 const double *value,
952 const double *collb, const double *colub,
953 const double *obj,
954 const double *rowlb, const double *rowub);
955
968 void loadBlock(const int numcols, const int numrows,
969 const CoinBigIndex *start, const int *index,
970 const double *value,
971 const double *collb, const double *colub,
972 const double *obj,
973 const char *rowsen, const double *rowrhs,
974 const double *rowrng);
975
977
981 CoinModel();
983 CoinModel(int firstRows, int firstColumns, CoinBigIndex firstElements, bool noNames = false);
986 CoinModel(const char *fileName, int allowStrings = 0);
990 CoinModel(int nonLinear, const char *fileName, const void *info);
992 CoinModel(int numberRows, int numberColumns,
993 const CoinPackedMatrix *matrix,
994 const double *rowLower, const double *rowUpper,
995 const double *columnLower, const double *columnUpper,
996 const double *objective);
998 virtual CoinBaseModel *clone() const;
999
1001 virtual ~CoinModel();
1003
1007 CoinModel(const CoinModel &);
1009 CoinModel &operator=(const CoinModel &);
1011
1014 void validateLinks() const;
1017 private:
1019 void resize(int maximumRows, int maximumColumns, CoinBigIndex maximumElements);
1021 void fillRows(int which, bool forceCreation, bool fromAddRow = false);
1023 void fillColumns(int which, bool forceCreation, bool fromAddColumn = false);
1026 void fillList(int which, CoinModelLinkedList &list, int type) const;
1030 void createList(int type) const;
1032 int addString(const char *string);
1036 double getDoubleFromString(CoinYacc &info, const char *string);
1038 void freeStringMemory(CoinYacc &info);
1039
1040 public:
1042 int computeAssociated(double *associated);
1048 CoinPackedMatrix *quadraticRow(int rowNumber, double *linear,
1049 int &numberBad) const;
1051 void replaceQuadraticRow(int rowNumber, const double *linear, const CoinPackedMatrix *quadraticPart);
1056 CoinModel *reorder(const char *mark) const;
1067 int expandKnapsack(int knapsackRow, int &numberOutput, double *buildObj, CoinBigIndex *buildStart,
1068 int *buildRow, double *buildElement, int reConstruct = -1) const;
1070 void setCutMarker(int size, const int *marker);
1072 void setPriorities(int size, const int *priorities);
1074 inline const int *priorities() const
1075 {
1076 return priority_;
1077 }
1079 void setOriginalIndices(const int *row, const int *column);
1080
1081 private:
1085 void gdb(int nonLinear, const char *fileName, const void *info);
1087 int decodeBit(char *phrase, char *&nextPhrase, double &coefficient, bool ifFirst) const;
1089 void badType() const;
1092 int maximumRows_;
1095 int maximumColumns_;
1097 CoinBigIndex numberElements_;
1099 CoinBigIndex maximumElements_;
1101 CoinBigIndex numberQuadraticElements_;
1103 CoinBigIndex maximumQuadraticElements_;
1105 double *rowLower_;
1107 double *rowUpper_;
1109 CoinModelHash rowName_;
1117 int *rowType_;
1119 double *objective_;
1121 double *columnLower_;
1123 double *columnUpper_;
1125 CoinModelHash columnName_;
1127 int *integerType_;
1129 CoinModelHash string_;
1139 int *columnType_;
1141 CoinBigIndex *start_;
1143 CoinModelTriple *elements_;
1145 CoinPackedMatrix *packedMatrix_;
1147 mutable CoinModelHash2 hashElements_;
1149 mutable CoinModelLinkedList rowList_;
1151 mutable CoinModelLinkedList columnList_;
1153 CoinModelTriple *quadraticElements_;
1155 mutable CoinModelHash2 hashQuadraticElements_;
1157 int *sortIndices_;
1159 double *sortElements_;
1161 int sortSize_;
1163 mutable CoinModelLinkedList quadraticRowList_;
1165 mutable CoinModelLinkedList quadraticColumnList_;
1167 int sizeAssociated_;
1169 double *associated_;
1171 int numberSOS_;
1173 int *startSOS_;
1175 int *memberSOS_;
1177 int *typeSOS_;
1179 int *prioritySOS_;
1181 double *referenceSOS_;
1183 int *priority_;
1185 int *cut_;
1187 void *moreInfo_;
1195 mutable int type_;
1197 bool noNames_;
1204 mutable int links_;
1206 };
1208 double getFunctionValueFromString(const char *string, const char *x, double xValue);
1210 double getDoubleFromString(CoinYacc &info, const char *string, const char *x, double xValue);
1211 #endif
1212
1213 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1214 */
CoinModel::addString
int addString(const char *string)
Adds one string, returns index.
CoinModel::isIntegerAsString
const char * isIntegerAsString(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:755
CoinModel::zapColumnNames
void zapColumnNames()
Reset column names.
Definition: CoinModel.hpp:854
CoinModel::columnLowerAsString
const char * columnLowerAsString(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
Definition: CoinModel.hpp:725
CoinModel::noNames_
bool noNames_
True if no names EVER being used (for users who know what they are doing)
Definition: CoinModel.hpp:1197
CoinModel::columnUpper
double columnUpper(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:631
CoinModel::packedMatrix_
CoinPackedMatrix * packedMatrix_
Actual elements as CoinPackedMatrix.
Definition: CoinModel.hpp:1145
CoinModel::setRowBounds
void setRowBounds(int whichRow, double rowLower, double rowUpper)
Sets rowLower and rowUpper (if row does not exist then all rows up to this are defined with default v...
CoinModel::setColumnObjective
void setColumnObjective(int whichColumn, double columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
CoinModel::quadraticElements_
CoinModelTriple * quadraticElements_
Actual quadratic elements (always linked lists)
Definition: CoinModel.hpp:1153
CoinModel::setColIsInteger
void setColIsInteger(int whichColumn, bool columnIsInteger)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
Definition: CoinModel.hpp:342
CoinModel::decodeBit
int decodeBit(char *phrase, char *&nextPhrase, double &coefficient, bool ifFirst) const
returns jColumn (-2 if linear term, -1 if unknown) and coefficient
CoinModel::sizeAssociated_
int sizeAssociated_
Size of associated values.
Definition: CoinModel.hpp:1167
CoinModel::associatedArray
double * associatedArray() const
Returns associated array.
Definition: CoinModel.hpp:804
CoinModel::setPriorities
void setPriorities(int size, const int *priorities)
Sets priority array.
CoinModel::packCols
int packCols()
Packs down all columns i.e.
Definition: CoinModel.hpp:408
CoinBaseModel::handler_
CoinMessageHandler * handler_
Message handler (Passed in)
Definition: CoinModel.hpp:128
CoinModel::deleteElement
CoinBigIndex deleteElement(int row, int column)
Takes element out of matrix - returning position (&lt;0 if not there);.
CoinModel::unsetValue
double unsetValue() const
returns unset value
Definition: CoinModel.hpp:769
CoinModel::rowNames
const CoinModelHash * rowNames() const
Return row names array.
Definition: CoinModel.hpp:839
CoinModel::priorities
const int * priorities() const
priorities (given for all columns (-1 if not integer)
Definition: CoinModel.hpp:1074
CoinModel::createPlusMinusOne
void createPlusMinusOne(CoinBigIndex *startPositive, CoinBigIndex *startNegative, int *indices, const double *associated)
Creates +-1 matrix given startPositive and startNegative counts for +-1 matrix.
CoinModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:864
CoinModel::firstInQuadraticColumn
CoinModelLink firstInQuadraticColumn(int whichColumn) const
Returns first element in given quadratic column - index is -1 if none.
CoinModel::columnObjectiveAsString
const char * columnObjectiveAsString(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:737
CoinBaseModel::optimizationDirection_
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:118
CoinModel::originalColumns
const int * originalColumns() const
Return pointers to original columns (for decomposition)
Definition: CoinModel.hpp:499
CoinModel::rowUpperArray
double * rowUpperArray() const
Return rowUpper array.
Definition: CoinModel.hpp:814
CoinModel::setColObjective
void setColObjective(int whichColumn, double columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
Definition: CoinModel.hpp:328
CoinModel::setRowLower
void setRowLower(int whichRow, double rowLower)
Sets rowLower (if row does not exist then all rows up to this are defined with default values and no ...
CoinModel::stringArray
const CoinModelHash * stringArray() const
Return string array.
Definition: CoinModel.hpp:799
CoinModel::type
int type() const
Returns type.
Definition: CoinModel.hpp:764
CoinModel::createList
void createList(int type) const
Create a linked list and synchronize free type 1 for row 2 for column Marked as const as list is muta...
CoinModel::rowList_
CoinModelLinkedList rowList_
Linked list for rows.
Definition: CoinModel.hpp:1149
CoinModel::stringsExist
bool stringsExist() const
Says if strings exist.
Definition: CoinModel.hpp:794
CoinModel::getColumnObjectiveAsString
const char * getColumnObjectiveAsString(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
CoinModel::row
int row(const char *rowName) const
Row index from row name (-1 if no names or no match)
CoinModel::previous
CoinModelLink previous(CoinModelLink &current) const
Returns previous element in current row or column - index is -1 if none.
CoinModel::deleteCol
void deleteCol(int whichColumn)
Deletes all entries in column and bounds.
Definition: CoinModel.hpp:392
CoinModel::getColumnName
const char * getColumnName(int whichColumn) const
Gets name (if column does not exist then NULL)
CoinBaseModel::setColumnBlock
void setColumnBlock(const std::string &name)
Set column block name.
Definition: CoinModel.hpp:102
CoinModel::getRow
int getRow(int whichRow, int *column, double *element)
Gets sorted row - user must provide enough space (easiest is allocate number of columns).
CoinModel::quadraticRow
CoinPackedMatrix * quadraticRow(int rowNumber, double *linear, int &numberBad) const
Gets correct form for a quadratic row - user to delete If row is not quadratic then returns which oth...
CoinModel::rowLower_
double * rowLower_
Row lower.
Definition: CoinModel.hpp:1105
CoinModel::fillList
void fillList(int which, CoinModelLinkedList &list, int type) const
Fill in default linked list information (1= row, 2 = column) Marked as const as list is mutable...
CoinModel::setColLower
void setColLower(int numberColumns, const double *columnLower)
Sets columnLower array.
Definition: CoinModel.hpp:426
CoinModel::operator()
void operator()(int i, int j, double value)
Sets value for row i and column j.
Definition: CoinModel.hpp:207
CoinBaseModel::numberElements
virtual CoinBigIndex numberElements() const =0
Return number of elements.
CoinModelLink
This is for various structures/classes needed by CoinModel.
Definition: CoinModelUseful.hpp:29
CoinModel::reorder
CoinModel * reorder(const char *mark) const
If possible return a model where if all variables marked nonzero are fixed the problem will be linear...
CoinModel::sortSize_
int sortSize_
Size of sort arrays.
Definition: CoinModel.hpp:1161
CoinModel::cut_
int * cut_
Nonzero if row is cut - done in one go e.g. from ampl.
Definition: CoinModel.hpp:1185
CoinModel::columnUpperAsString
const char * columnUpperAsString(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:731
CoinModel::setColumnIsInteger
void setColumnIsInteger(int whichColumn, bool columnIsInteger)
Sets integer state (if column does not exist then all columns up to this are defined with default val...
CoinModel::expandKnapsack
int expandKnapsack(int knapsackRow, int &numberOutput, double *buildObj, CoinBigIndex *buildStart, int *buildRow, double *buildElement, int reConstruct=-1) const
Expands out all possible combinations for a knapsack If buildObj NULL then just computes space needed...
CoinModel
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:181
CoinModel::rowLower
double rowLower(int whichRow) const
Definition: CoinModel.hpp:592
CoinModel::getColumnIsIntegerAsString
const char * getColumnIsIntegerAsString(int whichColumn) const
Gets if integer (if column does not exist then false)
CoinModel::memberSOS_
int * memberSOS_
SOS members.
Definition: CoinModel.hpp:1175
CoinModel::numberElements_
CoinBigIndex numberElements_
Current number of elements.
Definition: CoinModel.hpp:1097
CoinModel::passInMatrix
void passInMatrix(const CoinPackedMatrix &matrix)
Pass in CoinPackedMatrix (and switch off element updates)
CoinModelHash2
For int,int hashing.
Definition: CoinModelUseful.hpp:301
CoinBaseModel::getProblemName
const char * getProblemName() const
Return the problem name.
Definition: CoinModel.hpp:78
CoinModel::pack
int pack()
Packs down all rows and columns.
CoinModelHash
Definition: CoinModelUseful.hpp:220
CoinModel::rowUpper_
double * rowUpper_
Row upper.
Definition: CoinModel.hpp:1107
CoinModel::maximumElements_
CoinBigIndex maximumElements_
Maximum number of elements.
Definition: CoinModel.hpp:1099
CoinBaseModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:61
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:345
CoinYacc
Definition: CoinModelUseful.hpp:185
CoinModel::columnIsInteger
bool columnIsInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:655
CoinBaseModel
Definition: CoinModel.hpp:13
CoinModel::maximumRows_
int maximumRows_
Maximum number of rows.
Definition: CoinModel.hpp:1093
CoinModel::badType
void badType() const
Aborts with message about packedMatrix.
CoinModel::createPackedMatrix
int createPackedMatrix(CoinPackedMatrix &matrix, const double *associated)
Creates a packed matrix - return number of errors.
CoinModel::operator()
double operator()(const char *rowName, const char *columnName) const
Returns value for row rowName and column columnName.
Definition: CoinModel.hpp:525
CoinFinite.hpp
CoinModel::createArrays
int createArrays(double *&rowLower, double *&rowUpper, double *&columnLower, double *&columnUpper, double *&objective, int *&integerType, double *&associated)
Creates copies of various arrays - return number of errors.
CoinModel::setIsInteger
void setIsInteger(int whichColumn, bool columnIsInteger)
Sets integer state (if column does not exist then all columns up to this are defined with default val...
Definition: CoinModel.hpp:286
CoinModel::rowType_
int * rowType_
Row types.
Definition: CoinModel.hpp:1117
CoinModel::typeSOS_
int * typeSOS_
SOS type.
Definition: CoinModel.hpp:1177
CoinModel::moreInfo
void * moreInfo() const
Return pointer to more information.
Definition: CoinModel.hpp:874
CoinModel::convertMatrix
int convertMatrix()
Convert elements to CoinPackedMatrix (and switch off element updates).
CoinModel::getElement
double getElement(int i, int j) const
Returns value for row i and column j.
CoinModel::setQuadraticElement
void setQuadraticElement(int i, int j, double value)
Sets quadratic value for column i and j.
CoinModel::deleteThisElement
void deleteThisElement(int row, int column, CoinBigIndex position)
Takes element out of matrix when position known.
CoinModel::addColumn
void addColumn(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0, const char *name=NULL, bool isInteger=false)
add a column - numberInColumn may be zero */
CoinModel::CoinModel
CoinModel()
Default constructor.
CoinModel::columnUpper_
double * columnUpper_
Column Upper.
Definition: CoinModel.hpp:1123
CoinModel::deleteColumn
void deleteColumn(int whichColumn)
Deletes all entries in column and bounds and objective.
CoinModel::maximumQuadraticElements_
CoinBigIndex maximumQuadraticElements_
Maximum number of quadratic elements.
Definition: CoinModel.hpp:1103
CoinModel::fillRows
void fillRows(int which, bool forceCreation, bool fromAddRow=false)
Fill in default row information.
CoinModel::columnType_
int * columnType_
Column types.
Definition: CoinModel.hpp:1139
CoinModel::whatIsSet
int whatIsSet() const
Returns which parts of model are set 1 - matrix 2 - rhs 4 - row names 8 - column bounds and/or object...
CoinModel::priority_
int * priority_
priorities (given for all columns (-1 if not integer)
Definition: CoinModel.hpp:1183
CoinModel::setOptimizationDirection
void setOptimizationDirection(double value)
Set direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:869
CoinModel::fillColumns
void fillColumns(int which, bool forceCreation, bool fromAddColumn=false)
Fill in default column information.
CoinModel::getRowUpperAsString
const char * getRowUpperAsString(int whichRow) const
Gets rowUpper (if row does not exist then +COIN_DBL_MAX)
CoinModel::operator()
void operator()(int i, int j, const char *value)
Sets value for row i and column j as string.
Definition: CoinModel.hpp:228
CoinModel::objective_
double * objective_
Objective.
Definition: CoinModel.hpp:1119
CoinModel::referenceSOS_
double * referenceSOS_
SOS reference.
Definition: CoinModel.hpp:1181
CoinModel::setRowName
void setRowName(int whichRow, const char *rowName)
Sets name (if row does not exist then all rows up to this are defined with default values and no elem...
CoinModel::string_
CoinModelHash string_
Strings.
Definition: CoinModel.hpp:1129
CoinBaseModel::numberColumns
int numberColumns() const
Return number of columns.
Definition: CoinModel.hpp:42
CoinModel::setColName
void setColName(int whichColumn, const char *columnName)
Sets name (if column does not exist then all columns up to this are defined with default values and n...
Definition: CoinModel.hpp:335
CoinModelLinkedList
Definition: CoinModelUseful.hpp:366
CoinModel::rowLowerAsString
const char * rowLowerAsString(int whichRow) const
Definition: CoinModel.hpp:701
CoinModel::columnLower_
double * columnLower_
Column Lower.
Definition: CoinModel.hpp:1121
CoinModel::getRowUpper
double getRowUpper(int whichRow) const
Gets rowUpper (if row does not exist then +COIN_DBL_MAX)
CoinModel::~CoinModel
virtual ~CoinModel()
Destructor.
CoinMessageHandler.hpp
This is a first attempt at a message handler.
CoinModel::packColumns
int packColumns()
Packs down all columns i.e.
CoinModel::clone
virtual CoinBaseModel * clone() const
Clone.
CoinModel::getQuadraticElement
double getQuadraticElement(int i, int j) const
Returns quadratic value for columns i and j.
CoinModel::freeStringMemory
void freeStringMemory(CoinYacc &info)
Frees value memory.
CoinModel::elements_
CoinModelTriple * elements_
Actual elements.
Definition: CoinModel.hpp:1143
CoinModel::setContinuous
void setContinuous(int whichColumn)
Sets continuous (if column does not exist then all columns up to this are defined with default values...
Definition: CoinModel.hpp:300
CoinModel::quadraticRowList_
CoinModelLinkedList quadraticRowList_
Linked list for quadratic rows.
Definition: CoinModel.hpp:1163
CoinModel::columnLowerArray
double * columnLowerArray() const
Return columnLower array.
Definition: CoinModel.hpp:819
CoinModel::setColumnLower
void setColumnLower(int whichColumn, double columnLower)
Sets columnLower (if column does not exist then all columns up to this are defined with default value...
CoinModelTriple
for linked lists
Definition: CoinModelUseful.hpp:130
CoinModel::objective
double objective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:643
CoinModel::columnName
const char * columnName(int whichColumn) const
Gets name (if column does not exist then NULL)
Definition: CoinModel.hpp:649
CoinModel::associated_
double * associated_
Associated values.
Definition: CoinModel.hpp:1169
CoinModel::firstInColumn
CoinModelLink firstInColumn(int whichColumn) const
Returns first element in given column - index is -1 if none.
CoinModel::isInteger
bool isInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:661
CoinModel::hashQuadraticElements_
CoinModelHash2 hashQuadraticElements_
Hash for quadratic elements.
Definition: CoinModel.hpp:1155
CoinModel::getColumnUpperAsString
const char * getColumnUpperAsString(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
CoinModel::columnLower
double columnLower(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
Definition: CoinModel.hpp:625
CoinModel::getColLower
double getColLower(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
Definition: CoinModel.hpp:667
CoinBaseModel::setMessageHandler
void setMessageHandler(CoinMessageHandler *handler)
Pass in message handler.
CoinModel::packedMatrix
const CoinPackedMatrix * packedMatrix() const
Return a pointer to CoinPackedMatrix (or NULL)
Definition: CoinModel.hpp:489
CoinModel::resize
void resize(int maximumRows, int maximumColumns, CoinBigIndex maximumElements)
Resize.
CoinModel::deleteRow
void deleteRow(int whichRow)
Deletes all entries in row and bounds.
CoinModel::quadraticColumnList_
CoinModelLinkedList quadraticColumnList_
Linked list for quadratic columns.
Definition: CoinModel.hpp:1165
CoinModel::getElementAsString
const char * getElementAsString(int i, int j) const
Returns value for row i and column j as string.
CoinModel::setColumnName
void setColumnName(int whichColumn, const char *columnName)
Sets name (if column does not exist then all columns up to this are defined with default values and n...
CoinBaseModel::CoinBaseModel
CoinBaseModel()
Default Constructor.
CoinModel::getColumnObjective
double getColumnObjective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
CoinModel::columnIsIntegerAsString
const char * columnIsIntegerAsString(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:749
CoinModel::setIsInteger
void setIsInteger(int whichColumn, const char *columnIsInteger)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
Definition: CoinModel.hpp:380
CoinModel::columnUpperArray
double * columnUpperArray() const
Return columnUpper array.
Definition: CoinModel.hpp:824
CoinModel::operator=
CoinModel & operator=(const CoinModel &)
=
CoinModel::numberSOS_
int numberSOS_
Number of SOS - all these are done in one go e.g. from ampl.
Definition: CoinModel.hpp:1171
CoinModel::rowUpper
double rowUpper(int whichRow) const
Gets rowUpper (if row does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:598
CoinBaseModel::rowBlockName_
std::string rowBlockName_
Rowblock name.
Definition: CoinModel.hpp:124
CoinModel::differentModel
int differentModel(CoinModel &other, bool ignoreNames)
Check two models against each other.
CoinModel::setMoreInfo
void setMoreInfo(void *info)
Set pointer to more information.
Definition: CoinModel.hpp:879
CoinModel::gdb
void gdb(int nonLinear, const char *fileName, const void *info)
Read a problem from AMPL nl file so not constructor so gdb will work.
CoinModel::setColUpper
void setColUpper(int whichColumn, double columnUpper)
Sets columnUpper (if column does not exist then all columns up to this are defined with default value...
Definition: CoinModel.hpp:314
CoinModel::setColumnBounds
void setColumnBounds(int whichColumn, double columnLower, double columnUpper)
Sets columnLower and columnUpper (if column does not exist then all columns up to this are defined wi...
CoinModel::lastInColumn
CoinModelLink lastInColumn(int whichColumn) const
Returns last element in given column - index is -1 if none.
CoinBaseModel::numberColumns_
int numberColumns_
Current number of columns.
Definition: CoinModel.hpp:116
CoinModel::setOriginalIndices
void setOriginalIndices(const int *row, const int *column)
For decomposition set original row and column indices.
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
CoinBaseModel::logLevel
int logLevel() const
Get print level 0 - off, 1 - errors, 2 - more.
Definition: CoinModel.hpp:71
CoinModel::type_
int type_
Type of build - -1 unset, 0 for row, 1 for column, 2 linked.
Definition: CoinModel.hpp:1195
CoinModel::column
int column(const char *columnName) const
Column index from column name (-1 if no names or no match)
CoinModel::associateElement
int associateElement(const char *stringValue, double value)
Associates a string with a value. Returns string id (or -1 if does not exist)
CoinModel::lastInRow
CoinModelLink lastInRow(int whichRow) const
Returns last element in given row - index is -1 if none.
CoinModel::columnList_
CoinModelLinkedList columnList_
Linked list for columns.
Definition: CoinModel.hpp:1151
CoinModel::startSOS_
int * startSOS_
SOS starts.
Definition: CoinModel.hpp:1173
CoinModel::setCutMarker
void setCutMarker(int size, const int *marker)
Sets cut marker array.
CoinModel::prioritySOS_
int * prioritySOS_
SOS priority.
Definition: CoinModel.hpp:1179
CoinModel::getColUpper
double getColUpper(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:673
CoinModel::moreInfo_
void * moreInfo_
Pointer to more information.
Definition: CoinModel.hpp:1187
CoinModel::rowName
const char * rowName(int whichRow) const
Gets name (if row does not exist then NULL)
Definition: CoinModel.hpp:604
CoinBaseModel::messages_
CoinMessages messages_
Messages.
Definition: CoinModel.hpp:130
CoinModel::setRowUpper
void setRowUpper(int whichRow, double rowUpper)
Sets rowUpper (if row does not exist then all rows up to this are defined with default values and no ...
CoinBaseModel::clone
virtual CoinBaseModel * clone() const =0
Clone.
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
CoinModel::getColIsInteger
bool getColIsInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:691
CoinModel::position
CoinBigIndex position(int i, int j) const
Returns position in elements for row i column j.
CoinModelHash::numberItems
int numberItems() const
Number of items i.e. rows if just row names.
Definition: CoinModelUseful.hpp:244
CoinBaseModel::setProblemName
void setProblemName(const char *name)
Set problem name.
CoinModel::validateLinks
void validateLinks() const
Checks that links are consistent.
CoinModel::getRowLower
double getRowLower(int whichRow) const
Gets rowLower (if row does not exist then -COIN_DBL_MAX)
CoinBaseModel::numberRows_
int numberRows_
Current number of rows.
Definition: CoinModel.hpp:114
CoinModel::objectiveAsString
const char * objectiveAsString(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:743
CoinBaseModel::getRowBlock
const std::string & getRowBlock() const
Return the row block name.
Definition: CoinModel.hpp:87
CoinModel::writeMps
int writeMps(const char *filename, int compression=0, int formatType=0, int numberAcross=2, bool keepStrings=false)
Write the problem in MPS format to a file with the given filename.
CoinModel::zapRowNames
void zapRowNames()
Reset row names.
Definition: CoinModel.hpp:849
CoinModel::start_
CoinBigIndex * start_
If simple then start of each row/column.
Definition: CoinModel.hpp:1141
CoinModel::getColumnLowerAsString
const char * getColumnLowerAsString(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
CoinModel::getColObjective
double getColObjective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:679
CoinModel::sortElements_
double * sortElements_
Array for sorting elements.
Definition: CoinModel.hpp:1159
CoinModel::setColumnUpper
void setColumnUpper(int whichColumn, double columnUpper)
Sets columnUpper (if column does not exist then all columns up to this are defined with default value...
CoinModel::setObjective
void setObjective(int whichColumn, const char *columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
Definition: CoinModel.hpp:373
CoinModel::getColumn
int getColumn(int whichColumn, int *column, double *element)
Gets sorted column - user must provide enough space (easiest is allocate number of rows)...
CoinBaseModel::objectiveOffset_
double objectiveOffset_
Objective offset to be passed on.
Definition: CoinModel.hpp:120
CoinModel::integerTypeArray
int * integerTypeArray() const
Return integerType array.
Definition: CoinModel.hpp:834
CoinModel::computeAssociated
int computeAssociated(double *associated)
Fills in all associated - returning number of errors.
CoinModel::getRowName
const char * getRowName(int whichRow) const
Gets name (if row does not exist then NULL)
CoinModel::getColName
const char * getColName(int whichColumn) const
Gets name (if column does not exist then NULL)
Definition: CoinModel.hpp:685
CoinModel::hashElements_
CoinModelHash2 hashElements_
Hash for elements.
Definition: CoinModel.hpp:1147
CoinModel::getDoubleFromString
double getDoubleFromString(CoinYacc &info, const char *string)
Gets a double from a string possibly containing named strings, returns unset if not found...
CoinModel::links_
int links_
Links present (could be tested by sizes of objects) 0 - none, 1 - row links, 2 - column links...
Definition: CoinModel.hpp:1204
CoinBaseModel::objectiveOffset
double objectiveOffset() const
Returns the (constant) objective offset This is the RHS entry for the objective row.
Definition: CoinModel.hpp:51
CoinModel::columnNames
const CoinModelHash * columnNames() const
Return column names array.
Definition: CoinModel.hpp:844
CoinBaseModel::setRowBlock
void setRowBlock(const std::string &name)
Set row block name.
Definition: CoinModel.hpp:92
CoinModel::setElement
void setElement(int i, int j, double value)
Sets value for row i and column j.
CoinModel::getColumnUpper
double getColumnUpper(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
CoinBaseModel::columnBlockName_
std::string columnBlockName_
Columnblock name.
Definition: CoinModel.hpp:126
CoinBaseModel::setOptimizationDirection
void setOptimizationDirection(double value)
Set direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:66
CoinModel::columnObjective
double columnObjective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:637
CoinBaseModel::getColumnBlock
const std::string & getColumnBlock() const
Return the column block name.
Definition: CoinModel.hpp:97
CoinBaseModel::numberRows
int numberRows() const
Return number of rows.
Definition: CoinModel.hpp:37
getDoubleFromString
double getDoubleFromString(CoinYacc &info, const char *string, const char *x, double xValue)
faster version
CoinModel::maximumColumns_
int maximumColumns_
Maximum number of columns.
Definition: CoinModel.hpp:1095
CoinModel::numberElements
CoinBigIndex numberElements() const
Return number of elements.
Definition: CoinModel.hpp:508
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
CoinModel::addCol
void addCol(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0, const char *name=NULL, bool isInteger=false)
add a column - numberInColumn may be zero */
Definition: CoinModel.hpp:197
CoinBaseModel::setLogLevel
void setLogLevel(int value)
Set print level 0 - off, 1 - errors, 2 - more.
CoinModel::rowLowerArray
double * rowLowerArray() const
Return rowLower array.
Definition: CoinModel.hpp:809
CoinModel::sortIndices_
int * sortIndices_
Array for sorting indices.
Definition: CoinModel.hpp:1157
CoinBaseModel::operator=
CoinBaseModel & operator=(const CoinBaseModel &rhs)
Assignment operator.
CoinModel::countPlusMinusOne
int countPlusMinusOne(CoinBigIndex *startPositive, CoinBigIndex *startNegative, const double *associated)
Fills in startPositive and startNegative with counts for +-1 matrix.
CoinModel::getColumnLower
double getColumnLower(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
CoinModel::getRowLowerAsString
const char * getRowLowerAsString(int whichRow) const
Gets rowLower (if row does not exist then -COIN_DBL_MAX)
CoinModel::setColLower
void setColLower(int whichColumn, double columnLower)
Sets columnLower (if column does not exist then all columns up to this are defined with default value...
Definition: CoinModel.hpp:307
CoinModel::loadBlock
void loadBlock(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Load in a problem by copying the arguments.
CoinModelUseful.hpp
CoinBaseModel::~CoinBaseModel
virtual ~CoinBaseModel()
Destructor.
CoinModel::getColumnIsInteger
bool getColumnIsInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
CoinModel::lastInQuadraticColumn
CoinModelLink lastInQuadraticColumn(int whichColumn) const
Returns last element in given quadratic column - index is -1 if none.
CoinBaseModel::logLevel_
int logLevel_
Print level.
Definition: CoinModel.hpp:140
CoinModel::setColUpper
void setColUpper(int numberColumns, const double *columnUpper)
Sets columnUpper array.
Definition: CoinModel.hpp:435
CoinModel::objectiveArray
double * objectiveArray() const
Return objective array.
Definition: CoinModel.hpp:829
CoinModel::firstInRow
CoinModelLink firstInRow(int whichRow) const
Returns first element in given row - index is -1 if none.
CoinModel::setInteger
void setInteger(int whichColumn)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
Definition: CoinModel.hpp:293
CoinModel::replaceQuadraticRow
void replaceQuadraticRow(int rowNumber, const double *linear, const CoinPackedMatrix *quadraticPart)
Replaces a quadratic row.
CoinModel::originalRows
const int * originalRows() const
Return pointers to original rows (for decomposition)
Definition: CoinModel.hpp:494
CoinModel::next
CoinModelLink next(CoinModelLink &current) const
Returns next element in current row or column - index is -1 if none.
CoinModel::setColBounds
void setColBounds(int whichColumn, double columnLower, double columnUpper)
Sets columnLower and columnUpper (if column does not exist then all columns up to this are defined wi...
Definition: CoinModel.hpp:321
CoinBaseModel::problemName_
std::string problemName_
Problem name.
Definition: CoinModel.hpp:122
CoinModel::addRow
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX, const char *name=NULL)
add a row - numberInRow may be zero
CoinModel::columnName_
CoinModelHash columnName_
Column names.
Definition: CoinModel.hpp:1125
CoinModel::pointer
double * pointer(int i, int j) const
Returns pointer to element for row i column j.
CoinModel::rowName_
CoinModelHash rowName_
Row names.
Definition: CoinModel.hpp:1109
CoinModel::integerType_
int * integerType_
Integer information.
Definition: CoinModel.hpp:1127
CoinModel::operator()
double operator()(int i, int j) const
Returns value for row i and column j.
Definition: CoinModel.hpp:518
CoinMessages
Class to hold and manipulate an array of massaged messages.
Definition: CoinMessageHandler.hpp:140
getFunctionValueFromString
double getFunctionValueFromString(const char *string, const char *x, double xValue)
Just function of single variable x.
CoinModel::setObjective
void setObjective(int whichColumn, double columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
Definition: CoinModel.hpp:279
CoinPackedMatrix.hpp
CoinModel::rowUpperAsString
const char * rowUpperAsString(int whichRow) const
Gets rowUpper (if row does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:707
CoinModel::cutMarker
const int * cutMarker() const
Returns array of 0 or nonzero if can be a cut (or returns NULL)
Definition: CoinModel.hpp:859
CoinModel::numberQuadraticElements_
CoinBigIndex numberQuadraticElements_
Current number of quadratic elements.
Definition: CoinModel.hpp:1101
CoinModel::packRows
int packRows()
Packs down all rows i.e.
CoinBaseModel::setObjectiveOffset
void setObjectiveOffset(double value)
Set objective offset.
Definition: CoinModel.hpp:56
CoinModel::elements
const CoinModelTriple * elements() const
Return elements as triples.
Definition: CoinModel.hpp:513