Clp 1.16.9
Loading...
Searching...
No Matches
ClpModel.hpp
Go to the documentation of this file.
1/* $Id: ClpModel.hpp 2074 2014-12-10 09:43:54Z forrest $ */
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:
41
48 ClpModel (bool emptyMessages = false );
49
54 ClpModel(const ClpModel & rhs, int scalingMode = -1);
56 ClpModel & operator=(const ClpModel & rhs);
61 ClpModel (const ClpModel * wholeModel,
62 int numberRows, const int * whichRows,
63 int numberColumns, const int * whichColumns,
64 bool dropNames = true, bool dropIntegers = true);
68
83 const double* collb, const double* colub,
84 const double* obj,
85 const double* rowlb, const double* rowub,
86 const double * rowObjective = NULL);
87 void loadProblem ( const CoinPackedMatrix& matrix,
88 const double* collb, const double* colub,
89 const double* obj,
90 const double* rowlb, const double* rowub,
91 const double * rowObjective = NULL);
92
95 void loadProblem ( const int numcols, const int numrows,
96 const CoinBigIndex* start, const int* index,
97 const double* value,
98 const double* collb, const double* colub,
99 const double* obj,
100 const double* rowlb, const double* rowub,
101 const double * rowObjective = NULL);
107 int loadProblem ( CoinModel & modelObject, bool tryPlusMinusOne = false);
109 void loadProblem ( const int numcols, const int numrows,
110 const CoinBigIndex* start, const int* index,
111 const double* value, const int * length,
112 const double* collb, const double* colub,
113 const double* obj,
114 const double* rowlb, const double* rowub,
115 const double * rowObjective = NULL);
118 const CoinBigIndex * start,
119 const int * column, const double * element);
120 void loadQuadraticObjective ( const CoinPackedMatrix& matrix);
124 void setRowObjective(const double * rowObjective);
126 int readMps(const char *filename,
127 bool keepNames = false,
128 bool ignoreErrors = false);
130 int readGMPL(const char *filename, const char * dataName,
131 bool keepNames = false);
133 void copyInIntegerInformation(const char * information);
137 void setContinuous(int index);
139 void setInteger(int index);
141 bool isInteger(int index) const;
143 void resize (int newNumberRows, int newNumberColumns);
145 void deleteRows(int number, const int * which);
147 void addRow(int numberInRow, const int * columns,
148 const double * elements, double rowLower = -COIN_DBL_MAX,
149 double rowUpper = COIN_DBL_MAX);
151 void addRows(int number, const double * rowLower,
152 const double * rowUpper,
153 const CoinBigIndex * rowStarts, const int * columns,
154 const double * elements);
156 void addRows(int number, const double * rowLower,
157 const double * rowUpper,
158 const CoinBigIndex * rowStarts, const int * rowLengths,
159 const int * columns,
160 const double * elements);
161#ifndef CLP_NO_VECTOR
162 void addRows(int number, const double * rowLower,
163 const double * rowUpper,
164 const CoinPackedVectorBase * const * rows);
165#endif
171 int addRows(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
172 bool checkDuplicates = true);
181 int addRows(CoinModel & modelObject, bool tryPlusMinusOne = false,
182 bool checkDuplicates = true);
183
185 void deleteColumns(int number, const int * which);
187 void deleteRowsAndColumns(int numberRows, const int * whichRows,
188 int numberColumns, const int * whichColumns);
190 void addColumn(int numberInColumn,
191 const int * rows,
192 const double * elements,
193 double columnLower = 0.0,
194 double columnUpper = COIN_DBL_MAX,
195 double objective = 0.0);
197 void addColumns(int number, const double * columnLower,
198 const double * columnUpper,
199 const double * objective,
200 const CoinBigIndex * columnStarts, const int * rows,
201 const double * elements);
202 void addColumns(int number, const double * columnLower,
203 const double * columnUpper,
204 const double * objective,
205 const CoinBigIndex * columnStarts, const int * columnLengths,
206 const int * rows,
207 const double * elements);
208#ifndef CLP_NO_VECTOR
209 void addColumns(int number, const double * columnLower,
210 const double * columnUpper,
211 const double * objective,
212 const CoinPackedVectorBase * const * columns);
213#endif
219 int addColumns(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
220 bool checkDuplicates = true);
228 int addColumns(CoinModel & modelObject, bool tryPlusMinusOne = false,
229 bool checkDuplicates = true);
231 inline void modifyCoefficient(int row, int column, double newElement,
232 bool keepZero = false) {
233 matrix_->modifyCoefficient(row, column, newElement, keepZero);
234 }
236 void chgRowLower(const double * rowLower);
238 void chgRowUpper(const double * rowUpper);
240 void chgColumnLower(const double * columnLower);
242 void chgColumnUpper(const double * columnUpper);
244 void chgObjCoefficients(const double * objIn);
248 void borrowModel(ClpModel & otherModel);
251 void returnModel(ClpModel & otherModel);
252
262 int cleanMatrix(double threshold = 1.0e-20);
264 void copy(const ClpMatrixBase * from, ClpMatrixBase * & to);
265#ifndef CLP_NO_STD
267 void dropNames();
269 void copyNames(const std::vector<std::string> & rowNames,
270 const std::vector<std::string> & columnNames);
272 void copyRowNames(const std::vector<std::string> & rowNames, int first, int last);
274 void copyColumnNames(const std::vector<std::string> & columnNames, int first, int last);
276 void copyRowNames(const char * const * rowNames, int first, int last);
278 void copyColumnNames(const char * const * columnNames, int first, int last);
280 void setRowName(int rowIndex, std::string & name) ;
282 void setColumnName(int colIndex, std::string & name) ;
283#endif
291 int findNetwork(char * rotate, double fractionNeeded = 0.75);
294 CoinModel * createCoinModel() const;
295
308 int writeMps(const char *filename,
309 int formatType = 0, int numberAcross = 2,
310 double objSense = 0.0) const ;
312
315 inline int numberRows() const {
316 return numberRows_;
317 }
318 inline int getNumRows() const {
319 return numberRows_;
320 }
322 inline int getNumCols() const {
323 return numberColumns_;
324 }
325 inline int numberColumns() const {
326 return numberColumns_;
327 }
329 inline double primalTolerance() const {
331 }
332 void setPrimalTolerance( double value) ;
334 inline double dualTolerance() const {
336 }
337 void setDualTolerance( double value) ;
339 inline double primalObjectiveLimit() const {
341 }
342 void setPrimalObjectiveLimit(double value);
344 inline double dualObjectiveLimit() const {
346 }
347 void setDualObjectiveLimit(double value);
349 inline double objectiveOffset() const {
350 return dblParam_[ClpObjOffset];
351 }
352 void setObjectiveOffset(double value);
354 inline double presolveTolerance() const {
356 }
357#ifndef CLP_NO_STD
358 inline const std::string & problemName() const {
359 return strParam_[ClpProbName];
360 }
361#endif
363 inline int numberIterations() const {
364 return numberIterations_;
365 }
366 inline int getIterationCount() const {
367 return numberIterations_;
368 }
369 inline void setNumberIterations(int numberIterationsNew) {
370 numberIterations_ = numberIterationsNew;
371 }
373 inline int solveType() const {
374 return solveType_;
375 }
376 inline void setSolveType(int type) {
377 solveType_ = type;
378 }
380 inline int maximumIterations() const {
382 }
383 void setMaximumIterations(int value);
385 inline double maximumSeconds() const {
386 return dblParam_[ClpMaxSeconds];
387 }
388 void setMaximumSeconds(double value);
389 void setMaximumWallSeconds(double value);
401 inline int status() const {
402 return problemStatus_;
403 }
404 inline int problemStatus() const {
405 return problemStatus_;
406 }
408 inline void setProblemStatus(int problemStatusNew) {
409 problemStatus_ = problemStatusNew;
410 }
426 inline int secondaryStatus() const {
427 return secondaryStatus_;
428 }
429 inline void setSecondaryStatus(int newstatus) {
430 secondaryStatus_ = newstatus;
431 }
433 inline bool isAbandoned() const {
434 return problemStatus_ == 4;
435 }
437 inline bool isProvenOptimal() const {
438 return problemStatus_ == 0;
439 }
441 inline bool isProvenPrimalInfeasible() const {
442 return problemStatus_ == 1;
443 }
445 inline bool isProvenDualInfeasible() const {
446 return problemStatus_ == 2;
447 }
453 inline bool isIterationLimitReached() const {
454 return problemStatus_ == 3;
455 }
457 inline double optimizationDirection() const {
459 }
460 inline double getObjSense() const {
462 }
463 void setOptimizationDirection(double value);
465 inline double * primalRowSolution() const {
466 return rowActivity_;
467 }
468 inline const double * getRowActivity() const {
469 return rowActivity_;
470 }
472 inline double * primalColumnSolution() const {
473 return columnActivity_;
474 }
475 inline const double * getColSolution() const {
476 return columnActivity_;
477 }
478 inline void setColSolution(const double * input) {
479 memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
480 }
482 inline double * dualRowSolution() const {
483 return dual_;
484 }
485 inline const double * getRowPrice() const {
486 return dual_;
487 }
489 inline double * dualColumnSolution() const {
490 return reducedCost_;
491 }
492 inline const double * getReducedCost() const {
493 return reducedCost_;
494 }
496 inline double* rowLower() const {
497 return rowLower_;
498 }
499 inline const double* getRowLower() const {
500 return rowLower_;
501 }
503 inline double* rowUpper() const {
504 return rowUpper_;
505 }
506 inline const double* getRowUpper() const {
507 return rowUpper_;
508 }
509 //-------------------------------------------------------------------------
513 void setObjectiveCoefficient( int elementIndex, double elementValue );
515 inline void setObjCoeff( int elementIndex, double elementValue ) {
516 setObjectiveCoefficient( elementIndex, elementValue);
517 }
518
521 void setColumnLower( int elementIndex, double elementValue );
522
525 void setColumnUpper( int elementIndex, double elementValue );
526
528 void setColumnBounds( int elementIndex,
529 double lower, double upper );
530
539 void setColumnSetBounds(const int* indexFirst,
540 const int* indexLast,
541 const double* boundList);
542
545 inline void setColLower( int elementIndex, double elementValue ) {
546 setColumnLower(elementIndex, elementValue);
547 }
550 inline void setColUpper( int elementIndex, double elementValue ) {
551 setColumnUpper(elementIndex, elementValue);
552 }
553
555 inline void setColBounds( int elementIndex,
556 double lower, double upper ) {
557 setColumnBounds(elementIndex, lower, upper);
558 }
559
566 inline void setColSetBounds(const int* indexFirst,
567 const int* indexLast,
568 const double* boundList) {
569 setColumnSetBounds(indexFirst, indexLast, boundList);
570 }
571
574 void setRowLower( int elementIndex, double elementValue );
575
578 void setRowUpper( int elementIndex, double elementValue ) ;
579
581 void setRowBounds( int elementIndex,
582 double lower, double upper ) ;
583
590 void setRowSetBounds(const int* indexFirst,
591 const int* indexLast,
592 const double* boundList);
593
595
596 inline const double * rowScale() const {
597 return rowScale_;
598 }
599 inline const double * columnScale() const {
600 return columnScale_;
601 }
602 inline const double * inverseRowScale() const {
603 return inverseRowScale_;
604 }
605 inline const double * inverseColumnScale() const {
606 return inverseColumnScale_;
607 }
608 inline double * mutableRowScale() const {
609 return rowScale_;
610 }
611 inline double * mutableColumnScale() const {
612 return columnScale_;
613 }
614 inline double * mutableInverseRowScale() const {
615 return inverseRowScale_;
616 }
617 inline double * mutableInverseColumnScale() const {
618 return inverseColumnScale_;
619 }
620 inline double * swapRowScale(double * newScale) {
621 double * oldScale = rowScale_;
622 rowScale_ = newScale;
623 return oldScale;
624 }
625 void setRowScale(double * scale) ;
626 void setColumnScale(double * scale);
628 inline double objectiveScale() const {
629 return objectiveScale_;
630 }
631 inline void setObjectiveScale(double value) {
632 objectiveScale_ = value;
633 }
635 inline double rhsScale() const {
636 return rhsScale_;
637 }
638 inline void setRhsScale(double value) {
639 rhsScale_ = value;
640 }
642 void scaling(int mode = 1);
645 void unscale();
647 inline int scalingFlag() const {
648 return scalingFlag_;
649 }
651 inline double * objective() const {
652 if (objective_) {
653 double offset;
654 return objective_->gradient(NULL, NULL, offset, false);
655 } else {
656 return NULL;
657 }
658 }
659 inline double * objective(const double * solution, double & offset, bool refresh = true) const {
660 offset = 0.0;
661 if (objective_) {
662 return objective_->gradient(NULL, solution, offset, refresh);
663 } else {
664 return NULL;
665 }
666 }
667 inline const double * getObjCoefficients() const {
668 if (objective_) {
669 double offset;
670 return objective_->gradient(NULL, NULL, offset, false);
671 } else {
672 return NULL;
673 }
674 }
676 inline double * rowObjective() const {
677 return rowObjective_;
678 }
679 inline const double * getRowObjCoefficients() const {
680 return rowObjective_;
681 }
683 inline double * columnLower() const {
684 return columnLower_;
685 }
686 inline const double * getColLower() const {
687 return columnLower_;
688 }
690 inline double * columnUpper() const {
691 return columnUpper_;
692 }
693 inline const double * getColUpper() const {
694 return columnUpper_;
695 }
697 inline CoinPackedMatrix * matrix() const {
698 if ( matrix_ == NULL ) return NULL;
699 else return matrix_->getPackedMatrix();
700 }
702 inline int getNumElements() const {
703 return matrix_->getNumElements();
704 }
707 inline double getSmallElementValue() const {
708 return smallElement_;
709 }
710 inline void setSmallElementValue(double value) {
711 smallElement_ = value;
712 }
714 inline ClpMatrixBase * rowCopy() const {
715 return rowCopy_;
716 }
720 inline ClpMatrixBase * clpMatrix() const {
721 return matrix_;
722 }
725 return scaledMatrix_;
726 }
728 inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
729 delete scaledMatrix_;
730 scaledMatrix_ = scaledMatrix;
731 }
734 ClpPackedMatrix * oldMatrix = scaledMatrix_;
735 scaledMatrix_ = scaledMatrix;
736 return oldMatrix;
737 }
743 void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
749 inline void replaceMatrix(CoinPackedMatrix * newmatrix,
750 bool deleteCurrent = false) {
751 replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
752 }
754 inline double objectiveValue() const {
756 }
757 inline void setObjectiveValue(double value) {
759 }
760 inline double getObjValue() const {
762 }
764 inline char * integerInformation() const {
765 return integerType_;
766 }
769 double * infeasibilityRay(bool fullRay=false) const;
770 double * unboundedRay() const;
772 inline double * ray() const
773 { return ray_;}
775 inline bool rayExists() const {
776 return (ray_!=NULL);
777 }
779 inline void deleteRay() {
780 delete [] ray_;
781 ray_=NULL;
782 }
784 inline const double * internalRay() const {
785 return ray_;
786 }
788 inline bool statusExists() const {
789 return (status_ != NULL);
790 }
792 inline unsigned char * statusArray() const {
793 return status_;
794 }
797 unsigned char * statusCopy() const;
799 void copyinStatus(const unsigned char * statusArray);
800
802 inline void setUserPointer (void * pointer) {
803 userPointer_ = pointer;
804 }
805 inline void * getUserPointer () const {
806 return userPointer_;
807 }
809 inline void setTrustedUserPointer (ClpTrustedData * pointer) {
810 trustedUserPointer_ = pointer;
811 }
813 return trustedUserPointer_;
814 }
816 inline int whatsChanged() const {
817 return whatsChanged_;
818 }
819 inline void setWhatsChanged(int value) {
820 whatsChanged_ = value;
821 }
823 inline int numberThreads() const {
824 return numberThreads_;
825 }
826 inline void setNumberThreads(int value) {
827 numberThreads_ = value;
828 }
830
833 void passInMessageHandler(CoinMessageHandler * handler);
835 CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
836 bool & oldDefault);
838 void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
840 void newLanguage(CoinMessages::Language language);
841 inline void setLanguage(CoinMessages::Language language) {
842 newLanguage(language);
843 }
847 inline CoinMessageHandler * messageHandler() const {
848 return handler_;
849 }
851 inline CoinMessages messages() const {
852 return messages_;
853 }
855 inline CoinMessages * messagesPointer() {
856 return & messages_;
857 }
859 inline CoinMessages coinMessages() const {
860 return coinMessages_;
861 }
863 inline CoinMessages * coinMessagesPointer() {
864 return & coinMessages_;
865 }
874 inline void setLogLevel(int value) {
875 handler_->setLogLevel(value);
876 }
877 inline int logLevel() const {
878 return handler_->logLevel();
879 }
881 inline bool defaultHandler() const {
882 return defaultHandler_;
883 }
887 inline ClpEventHandler * eventHandler() const {
888 return eventHandler_;
889 }
891 inline CoinThreadRandom * randomNumberGenerator() {
893 }
895 inline CoinThreadRandom & mutableRandomNumberGenerator() {
897 }
899 inline void setRandomSeed(int value) {
900 randomNumberGenerator_.setSeed(value);
901 }
903 inline int lengthNames() const {
904 return lengthNames_;
905 }
906#ifndef CLP_NO_STD
908 inline void setLengthNames(int value) {
909 lengthNames_ = value;
910 }
912 inline const std::vector<std::string> * rowNames() const {
913 return &rowNames_;
914 }
915 inline const std::string& rowName(int iRow) const {
916 return rowNames_[iRow];
917 }
919 std::string getRowName(int iRow) const;
921 inline const std::vector<std::string> * columnNames() const {
922 return &columnNames_;
923 }
924 inline const std::string& columnName(int iColumn) const {
925 return columnNames_[iColumn];
926 }
928 std::string getColumnName(int iColumn) const;
929#endif
932 return objective_;
933 }
935 inline void setObjectivePointer(ClpObjective * newobjective) {
936 objective_ = newobjective;
937 }
940 int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
941
943
952 void times(double scalar,
953 const double * x, double * y) const;
957 void transposeTimes(double scalar,
958 const double * x, double * y) const ;
960
961
962 //---------------------------------------------------------------------------
980
981 bool setIntParam(ClpIntParam key, int value) ;
983 bool setDblParam(ClpDblParam key, double value) ;
984#ifndef CLP_NO_STD
986 bool setStrParam(ClpStrParam key, const std::string & value);
987#endif
988 // Get an integer parameter
989 inline bool getIntParam(ClpIntParam key, int& value) const {
990 if (key < ClpLastIntParam) {
991 value = intParam_[key];
992 return true;
993 } else {
994 return false;
995 }
996 }
997 // Get an double parameter
998 inline bool getDblParam(ClpDblParam key, double& value) const {
999 if (key < ClpLastDblParam) {
1000 value = dblParam_[key];
1001 return true;
1002 } else {
1003 return false;
1004 }
1005 }
1006#ifndef CLP_NO_STD
1007 // Get a string parameter
1008 inline bool getStrParam(ClpStrParam key, std::string& value) const {
1009 if (key < ClpLastStrParam) {
1010 value = strParam_[key];
1011 return true;
1012 } else {
1013 return false;
1014 }
1015 }
1016#endif
1018 void generateCpp( FILE * fp);
1054 inline unsigned int specialOptions() const {
1055 return specialOptions_;
1056 }
1057 void setSpecialOptions(unsigned int value);
1058#define COIN_CBC_USING_CLP 0x01000000
1059 inline bool inCbcBranchAndBound() const {
1060 return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1061 }
1063
1066protected:
1068 void gutsOfDelete(int type);
1072 void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
1074 void getRowBound(int iRow, double& lower, double& upper) const;
1077 const double* collb, const double* colub,
1078 const double* obj,
1079 const double* rowlb, const double* rowub,
1080 const double * rowObjective = NULL);
1084 inline double rawObjectiveValue() const {
1085 return objectiveValue_;
1086 }
1088 inline bool permanentArrays() const {
1089 return (specialOptions_ & 65536) != 0;
1090 }
1096 const char * const * rowNamesAsChar() const;
1098 const char * const * columnNamesAsChar() const;
1100 void deleteNamesAsChar(const char * const * names, int number) const;
1104
1105
1107protected:
1108
1132 double * dual_;
1136 double* rowLower_;
1138 double* rowUpper_;
1154 double * ray_;
1156 double * rowScale_;
1173 unsigned char * status_;
1202#define ROW_COLUMN_COUNTS_SAME 1
1203#define MATRIX_SAME 2
1204#define MATRIX_JUST_ROWS_ADDED 4
1205#define MATRIX_JUST_COLUMNS_ADDED 8
1206#define ROW_LOWER_SAME 16
1207#define ROW_UPPER_SAME 32
1208#define OBJECTIVE_SAME 64
1209#define COLUMN_LOWER_SAME 128
1210#define COLUMN_UPPER_SAME 256
1211#define BASIS_SAME 512
1212#define ALL_SAME 65339
1213#define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1214 unsigned int whatsChanged_;
1226 unsigned int specialOptions_;
1228 CoinMessageHandler * handler_;
1232 CoinThreadRandom randomNumberGenerator_;
1235#ifndef CLP_NO_STD
1237 std::vector<std::string> rowNames_;
1239 std::vector<std::string> columnNames_;
1240#endif
1242 CoinMessages messages_;
1244 CoinMessages coinMessages_;
1254 CoinPackedMatrix baseMatrix_;
1256 CoinPackedMatrix baseRowCopy_;
1261#ifndef CLP_NO_STD
1264#endif
1266};
1270
1271public:
1277
1284
1286
1288public:
1289
1303 unsigned int specialOptions_;
1305};
1306
1307#endif
#define COIN_CBC_USING_CLP
Definition: ClpModel.hpp:1058
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.
Definition: ClpModel.hpp:1269
unsigned int specialOptions_
Definition: ClpModel.hpp:1303
double acceptablePivot_
Definition: ClpModel.hpp:1297
double pivotTolerance_
Definition: ClpModel.hpp:1294
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
int sparseThreshold_
Definition: ClpModel.hpp:1299
int scalingFlag_
Definition: ClpModel.hpp:1302
int perturbation_
Definition: ClpModel.hpp:1300
ClpDataSave()
Default constructor.
~ClpDataSave()
Destructor.
ClpDataSave(const ClpDataSave &)
Copy constructor.
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1296
double dualBound_
Definition: ClpModel.hpp:1292
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1295
double infeasibilityCost_
Definition: ClpModel.hpp:1293
double objectiveScale_
Definition: ClpModel.hpp:1298
int forceFactorization_
Definition: ClpModel.hpp:1301
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
Definition: ClpModel.hpp:1059
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:989
void setSmallElementValue(double value)
Definition: ClpModel.hpp:710
const double * inverseColumnScale() const
Definition: ClpModel.hpp:605
void chgRowLower(const double *rowLower)
Change row lower bounds.
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:489
const double * getColUpper() const
Definition: ClpModel.hpp:693
const char *const * columnNamesAsChar() const
Create column names as char **.
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1177
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1263
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1126
void setColumnScale(double *scale)
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most)
int getNumRows() const
Definition: ClpModel.hpp:318
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:760
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition: ClpModel.hpp:809
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:931
void setContinuous(int index)
Set the index-th variable to be a continuous variable.
bool defaultHandler_
Flag to say if default handler (so delete)
Definition: ClpModel.hpp:1230
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:667
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.
Definition: ClpModel.hpp:1173
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.
Definition: ClpModel.hpp:1185
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1242
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1112
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1216
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:334
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:772
void gutsOfScaling()
Does much of scaling.
void setObjectiveValue(double value)
Definition: ClpModel.hpp:757
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:924
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1254
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:472
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
Definition: ClpModel.hpp:1160
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1181
CoinMessageHandler * handler_
Message handler.
Definition: ClpModel.hpp:1228
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:754
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.
Definition: ClpModel.hpp:1252
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:401
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.
Definition: ClpModel.hpp:1250
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.
Definition: ClpModel.hpp:1175
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.
Definition: ClpModel.hpp:1138
ClpMatrixBase * rowCopy_
Row copy if wanted.
Definition: ClpModel.hpp:1150
const double * getReducedCost() const
Definition: ClpModel.hpp:492
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:329
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1232
int cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:775
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:764
void setDualTolerance(double value)
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1136
int getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:702
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:841
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:349
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:874
unsigned int specialOptions() const
For advanced options 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1054
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
Definition: ClpModel.hpp:566
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1122
void copyInIntegerInformation(const char *information)
Copy in integer informations.
CoinMessages * messagesPointer()
Return pointer to messages.
Definition: ClpModel.hpp:855
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:659
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:877
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1260
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
Definition: ClpModel.hpp:784
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:647
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1218
void setNumberThreads(int value)
Definition: ClpModel.hpp:826
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:895
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1146
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1239
int maximumColumns_
Maximum number of columns in model.
Definition: ClpModel.hpp:1246
double * mutableColumnScale() const
Definition: ClpModel.hpp:611
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1222
double getObjSense() const
Definition: ClpModel.hpp:460
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:468
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.
Definition: ClpModel.hpp:921
void * getUserPointer() const
Definition: ClpModel.hpp:805
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:635
int numberIterations_
Number of iterations.
Definition: ClpModel.hpp:1183
void setObjectiveScale(double value)
Definition: ClpModel.hpp:631
void setSecondaryStatus(int newstatus)
Definition: ClpModel.hpp:429
int getIterationCount() const
Definition: ClpModel.hpp:366
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)
Definition: ClpModel.hpp:935
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:690
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition: ClpModel.hpp:231
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1084
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1008
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1140
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:998
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:465
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:380
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition: ClpModel.hpp:788
void onStopped()
On stopped - sets secondary status.
const double * getColSolution() const
Definition: ClpModel.hpp:475
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:720
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1124
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1114
const double * inverseRowScale() const
Definition: ClpModel.hpp:602
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1248
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1258
int lengthNames_
length of names (0 means no names)
Definition: ClpModel.hpp:1220
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:676
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
Definition: ClpModel.hpp:1179
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1120
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:344
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:385
void setLengthNames(int value)
length of names (0 means no names0
Definition: ClpModel.hpp:908
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1152
const double * rowScale() const
Scaling.
Definition: ClpModel.hpp:596
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.
Definition: ClpModel.hpp:1244
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:445
int getNumCols() const
Number of columns.
Definition: ClpModel.hpp:322
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.
Definition: ClpModel.hpp:1158
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:457
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:733
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:441
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:859
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:369
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition: ClpModel.hpp:707
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:496
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:354
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
Definition: ClpModel.hpp:915
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:851
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:714
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:792
double * objective() const
Objective.
Definition: ClpModel.hpp:651
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:555
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:912
void setSolveType(int type)
Definition: ClpModel.hpp:376
void setDefaultMessageHandler()
Overrides message handler with a default one.
ClpModel & operator=(const ClpModel &rhs)
Assignment operator. This copies the data.
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1237
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1128
unsigned int whatsChanged_
Definition: ClpModel.hpp:1214
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:628
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
int numberColumns() const
Definition: ClpModel.hpp:325
void deleteQuadraticObjective()
Get rid of quadratic objective.
void setObjective(ClpObjective *objective)
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:891
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:802
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
void startPermanentArrays()
Start using maximumRows_ and Columns_.
double * inverseColumnScale_
Inverse column scale factors for matrix (end of columnScale_)
Definition: ClpModel.hpp:1162
void setRhsScale(double value)
Definition: ClpModel.hpp:638
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition: ClpModel.hpp:550
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1148
void setColumnName(int colIndex, std::string &name)
Set name of col.
const double * getRowLower() const
Definition: ClpModel.hpp:499
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_.
Definition: ClpModel.hpp:1088
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:697
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:683
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1256
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:339
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows.
Definition: ClpModel.hpp:1165
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.
Definition: ClpModel.hpp:1116
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:545
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:373
int problemStatus() const
Definition: ClpModel.hpp:404
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:437
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:724
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:863
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:515
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:363
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
Definition: ClpModel.hpp:903
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1144
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:881
void setPrimalTolerance(double value)
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:503
void setColSolution(const double *input)
Definition: ClpModel.hpp:478
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:823
const double * getColLower() const
Definition: ClpModel.hpp:686
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:620
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.
Definition: ClpModel.hpp:1142
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1130
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1234
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1156
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition: ClpModel.hpp:426
const std::string & problemName() const
Definition: ClpModel.hpp:358
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:608
void unscale()
If we constructed a "really" scaled model then this reverses the operation.
void setMaximumSeconds(double value)
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1134
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:482
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:617
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:887
void createEmptyMatrix()
Create empty ClpPackedMatrix.
bool isIterationLimitReached() const
Iteration limit reached?
Definition: ClpModel.hpp:453
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:679
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:506
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1154
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:749
void setRandomSeed(int value)
Set seed for thread specific random number generator.
Definition: ClpModel.hpp:899
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:816
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:779
double smallElement_
Small element value.
Definition: ClpModel.hpp:1118
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:485
unsigned char * statusCopy() const
Return copy of status (i.e.
const double * columnScale() const
Definition: ClpModel.hpp:599
double * dual_
Duals.
Definition: ClpModel.hpp:1132
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:433
unsigned int specialOptions_
For advanced options See get and set for meaning.
Definition: ClpModel.hpp:1226
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:847
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:812
ClpModel(const ClpModel &rhs, int scalingMode=-1)
Copy constructor.
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:614
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:728
void setWhatsChanged(int value)
Definition: ClpModel.hpp:819
void dropNames()
Drops names - makes lengthnames 0 and names empty.
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:408
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.