Clp  1.15.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ClpModel.hpp
Go to the documentation of this file.
1 /* $Id: ClpModel.hpp 1941 2013-04-10 16:52:27Z stefan $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef ClpModel_H
7 #define ClpModel_H
8 
9 #include "ClpConfig.h"
10 
11 #include <iostream>
12 #include <cassert>
13 #include <cmath>
14 #include <vector>
15 #include <string>
16 //#ifndef COIN_USE_CLP
17 //#define COIN_USE_CLP
18 //#endif
19 #include "ClpPackedMatrix.hpp"
20 #include "CoinMessageHandler.hpp"
21 #include "CoinHelperFunctions.hpp"
22 #include "CoinTypes.hpp"
23 #include "CoinFinite.hpp"
24 #include "ClpParameters.hpp"
25 #include "ClpObjective.hpp"
26 class ClpEventHandler;
36 class CoinBuild;
37 class CoinModel;
38 class ClpModel {
39 
40 public:
41 
47  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);
66  ~ClpModel ( );
68 
82  void loadProblem ( const ClpMatrixBase& matrix,
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);
117  void loadQuadraticObjective(const int numberColumns,
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
166 
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
214 
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 
254  void createEmptyMatrix();
262  int cleanMatrix(double threshold = 1.0e-20);
264  void copy(const ClpMatrixBase * from, ClpMatrixBase * & to);
265 #ifndef CLP_NO_STD
266  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
284 
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 
314  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 {
335  return dblParam_[ClpDualTolerance];
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
362  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);
390  bool hitMaximumIterations() const;
400  inline int status() const {
401  return problemStatus_;
402  }
403  inline int problemStatus() const {
404  return problemStatus_;
405  }
407  inline void setProblemStatus(int problemStatusNew) {
408  problemStatus_ = problemStatusNew;
409  }
424  inline int secondaryStatus() const {
425  return secondaryStatus_;
426  }
427  inline void setSecondaryStatus(int newstatus) {
428  secondaryStatus_ = newstatus;
429  }
431  inline bool isAbandoned() const {
432  return problemStatus_ == 4;
433  }
435  inline bool isProvenOptimal() const {
436  return problemStatus_ == 0;
437  }
439  inline bool isProvenPrimalInfeasible() const {
440  return problemStatus_ == 1;
441  }
443  inline bool isProvenDualInfeasible() const {
444  return problemStatus_ == 2;
445  }
447  bool isPrimalObjectiveLimitReached() const ;
449  bool isDualObjectiveLimitReached() const ;
451  inline bool isIterationLimitReached() const {
452  return problemStatus_ == 3;
453  }
455  inline double optimizationDirection() const {
456  return optimizationDirection_;
457  }
458  inline double getObjSense() const {
459  return optimizationDirection_;
460  }
461  void setOptimizationDirection(double value);
463  inline double * primalRowSolution() const {
464  return rowActivity_;
465  }
466  inline const double * getRowActivity() const {
467  return rowActivity_;
468  }
470  inline double * primalColumnSolution() const {
471  return columnActivity_;
472  }
473  inline const double * getColSolution() const {
474  return columnActivity_;
475  }
476  inline void setColSolution(const double * input) {
477  memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
478  }
480  inline double * dualRowSolution() const {
481  return dual_;
482  }
483  inline const double * getRowPrice() const {
484  return dual_;
485  }
487  inline double * dualColumnSolution() const {
488  return reducedCost_;
489  }
490  inline const double * getReducedCost() const {
491  return reducedCost_;
492  }
494  inline double* rowLower() const {
495  return rowLower_;
496  }
497  inline const double* getRowLower() const {
498  return rowLower_;
499  }
501  inline double* rowUpper() const {
502  return rowUpper_;
503  }
504  inline const double* getRowUpper() const {
505  return rowUpper_;
506  }
507  //-------------------------------------------------------------------------
511  void setObjectiveCoefficient( int elementIndex, double elementValue );
513  inline void setObjCoeff( int elementIndex, double elementValue ) {
514  setObjectiveCoefficient( elementIndex, elementValue);
515  }
516 
519  void setColumnLower( int elementIndex, double elementValue );
520 
523  void setColumnUpper( int elementIndex, double elementValue );
524 
526  void setColumnBounds( int elementIndex,
527  double lower, double upper );
528 
537  void setColumnSetBounds(const int* indexFirst,
538  const int* indexLast,
539  const double* boundList);
540 
543  inline void setColLower( int elementIndex, double elementValue ) {
544  setColumnLower(elementIndex, elementValue);
545  }
548  inline void setColUpper( int elementIndex, double elementValue ) {
549  setColumnUpper(elementIndex, elementValue);
550  }
551 
553  inline void setColBounds( int elementIndex,
554  double lower, double upper ) {
555  setColumnBounds(elementIndex, lower, upper);
556  }
557 
564  inline void setColSetBounds(const int* indexFirst,
565  const int* indexLast,
566  const double* boundList) {
567  setColumnSetBounds(indexFirst, indexLast, boundList);
568  }
569 
572  void setRowLower( int elementIndex, double elementValue );
573 
576  void setRowUpper( int elementIndex, double elementValue ) ;
577 
579  void setRowBounds( int elementIndex,
580  double lower, double upper ) ;
581 
588  void setRowSetBounds(const int* indexFirst,
589  const int* indexLast,
590  const double* boundList);
591 
593  inline const double * rowScale() const {
595  return rowScale_;
596  }
597  inline const double * columnScale() const {
598  return columnScale_;
599  }
600  inline const double * inverseRowScale() const {
601  return inverseRowScale_;
602  }
603  inline const double * inverseColumnScale() const {
604  return inverseColumnScale_;
605  }
606  inline double * mutableRowScale() const {
607  return rowScale_;
608  }
609  inline double * mutableColumnScale() const {
610  return columnScale_;
611  }
612  inline double * mutableInverseRowScale() const {
613  return inverseRowScale_;
614  }
615  inline double * mutableInverseColumnScale() const {
616  return inverseColumnScale_;
617  }
618  inline double * swapRowScale(double * newScale) {
619  double * oldScale = rowScale_;
620  rowScale_ = newScale;
621  return oldScale;
622  }
623  void setRowScale(double * scale) ;
624  void setColumnScale(double * scale);
626  inline double objectiveScale() const {
627  return objectiveScale_;
628  }
629  inline void setObjectiveScale(double value) {
630  objectiveScale_ = value;
631  }
633  inline double rhsScale() const {
634  return rhsScale_;
635  }
636  inline void setRhsScale(double value) {
637  rhsScale_ = value;
638  }
640  void scaling(int mode = 1);
643  void unscale();
645  inline int scalingFlag() const {
646  return scalingFlag_;
647  }
649  inline double * objective() const {
650  if (objective_) {
651  double offset;
652  return objective_->gradient(NULL, NULL, offset, false);
653  } else {
654  return NULL;
655  }
656  }
657  inline double * objective(const double * solution, double & offset, bool refresh = true) const {
658  offset = 0.0;
659  if (objective_) {
660  return objective_->gradient(NULL, solution, offset, refresh);
661  } else {
662  return NULL;
663  }
664  }
665  inline const double * getObjCoefficients() const {
666  if (objective_) {
667  double offset;
668  return objective_->gradient(NULL, NULL, offset, false);
669  } else {
670  return NULL;
671  }
672  }
674  inline double * rowObjective() const {
675  return rowObjective_;
676  }
677  inline const double * getRowObjCoefficients() const {
678  return rowObjective_;
679  }
681  inline double * columnLower() const {
682  return columnLower_;
683  }
684  inline const double * getColLower() const {
685  return columnLower_;
686  }
688  inline double * columnUpper() const {
689  return columnUpper_;
690  }
691  inline const double * getColUpper() const {
692  return columnUpper_;
693  }
695  inline CoinPackedMatrix * matrix() const {
696  if ( matrix_ == NULL ) return NULL;
697  else return matrix_->getPackedMatrix();
698  }
700  inline int getNumElements() const {
701  return matrix_->getNumElements();
702  }
705  inline double getSmallElementValue() const {
706  return smallElement_;
707  }
708  inline void setSmallElementValue(double value) {
709  smallElement_ = value;
710  }
712  inline ClpMatrixBase * rowCopy() const {
713  return rowCopy_;
714  }
716  void setNewRowCopy(ClpMatrixBase * newCopy);
718  inline ClpMatrixBase * clpMatrix() const {
719  return matrix_;
720  }
722  inline ClpPackedMatrix * clpScaledMatrix() const {
723  return scaledMatrix_;
724  }
726  inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
727  delete scaledMatrix_;
728  scaledMatrix_ = scaledMatrix;
729  }
732  ClpPackedMatrix * oldMatrix = scaledMatrix_;
733  scaledMatrix_ = scaledMatrix;
734  return oldMatrix;
735  }
741  void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
747  inline void replaceMatrix(CoinPackedMatrix * newmatrix,
748  bool deleteCurrent = false) {
749  replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
750  }
752  inline double objectiveValue() const {
754  }
755  inline void setObjectiveValue(double value) {
757  }
758  inline double getObjValue() const {
760  }
762  inline char * integerInformation() const {
763  return integerType_;
764  }
767  double * infeasibilityRay(bool fullRay=false) const;
768  double * unboundedRay() const;
770  inline double * ray() const
771  { return ray_;}
773  inline bool rayExists() const {
774  return (ray_!=NULL);
775  }
777  inline void deleteRay() {
778  delete [] ray_;
779  ray_=NULL;
780  }
782  inline const double * internalRay() const {
783  return ray_;
784  }
786  inline bool statusExists() const {
787  return (status_ != NULL);
788  }
790  inline unsigned char * statusArray() const {
791  return status_;
792  }
795  unsigned char * statusCopy() const;
797  void copyinStatus(const unsigned char * statusArray);
798 
800  inline void setUserPointer (void * pointer) {
801  userPointer_ = pointer;
802  }
803  inline void * getUserPointer () const {
804  return userPointer_;
805  }
807  inline void setTrustedUserPointer (ClpTrustedData * pointer) {
808  trustedUserPointer_ = pointer;
809  }
811  return trustedUserPointer_;
812  }
814  inline int whatsChanged() const {
815  return whatsChanged_;
816  }
817  inline void setWhatsChanged(int value) {
818  whatsChanged_ = value;
819  }
821  inline int numberThreads() const {
822  return numberThreads_;
823  }
824  inline void setNumberThreads(int value) {
825  numberThreads_ = value;
826  }
828 
830  void passInMessageHandler(CoinMessageHandler * handler);
833  CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
834  bool & oldDefault);
836  void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
838  void newLanguage(CoinMessages::Language language);
839  inline void setLanguage(CoinMessages::Language language) {
840  newLanguage(language);
841  }
845  inline CoinMessageHandler * messageHandler() const {
846  return handler_;
847  }
849  inline CoinMessages messages() const {
850  return messages_;
851  }
853  inline CoinMessages * messagesPointer() {
854  return & messages_;
855  }
857  inline CoinMessages coinMessages() const {
858  return coinMessages_;
859  }
861  inline CoinMessages * coinMessagesPointer() {
862  return & coinMessages_;
863  }
872  inline void setLogLevel(int value) {
873  handler_->setLogLevel(value);
874  }
875  inline int logLevel() const {
876  return handler_->logLevel();
877  }
879  inline bool defaultHandler() const {
880  return defaultHandler_;
881  }
885  inline ClpEventHandler * eventHandler() const {
886  return eventHandler_;
887  }
889  inline CoinThreadRandom * randomNumberGenerator() {
890  return &randomNumberGenerator_;
891  }
893  inline CoinThreadRandom & mutableRandomNumberGenerator() {
894  return randomNumberGenerator_;
895  }
897  inline void setRandomSeed(int value) {
898  randomNumberGenerator_.setSeed(value);
899  }
901  inline int lengthNames() const {
902  return lengthNames_;
903  }
904 #ifndef CLP_NO_STD
905  inline void setLengthNames(int value) {
907  lengthNames_ = value;
908  }
910  inline const std::vector<std::string> * rowNames() const {
911  return &rowNames_;
912  }
913  inline const std::string& rowName(int iRow) const {
914  return rowNames_[iRow];
915  }
917  std::string getRowName(int iRow) const;
919  inline const std::vector<std::string> * columnNames() const {
920  return &columnNames_;
921  }
922  inline const std::string& columnName(int iColumn) const {
923  return columnNames_[iColumn];
924  }
926  std::string getColumnName(int iColumn) const;
927 #endif
928  inline ClpObjective * objectiveAsObject() const {
930  return objective_;
931  }
932  void setObjective(ClpObjective * objective);
933  inline void setObjectivePointer(ClpObjective * newobjective) {
934  objective_ = newobjective;
935  }
938  int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
939 
941 
950  void times(double scalar,
951  const double * x, double * y) const;
955  void transposeTimes(double scalar,
956  const double * x, double * y) const ;
958 
959 
960  //---------------------------------------------------------------------------
978  bool setIntParam(ClpIntParam key, int value) ;
981  bool setDblParam(ClpDblParam key, double value) ;
982 #ifndef CLP_NO_STD
983  bool setStrParam(ClpStrParam key, const std::string & value);
985 #endif
986  // Get an integer parameter
987  inline bool getIntParam(ClpIntParam key, int& value) const {
988  if (key < ClpLastIntParam) {
989  value = intParam_[key];
990  return true;
991  } else {
992  return false;
993  }
994  }
995  // Get an double parameter
996  inline bool getDblParam(ClpDblParam key, double& value) const {
997  if (key < ClpLastDblParam) {
998  value = dblParam_[key];
999  return true;
1000  } else {
1001  return false;
1002  }
1003  }
1004 #ifndef CLP_NO_STD
1005  // Get a string parameter
1006  inline bool getStrParam(ClpStrParam key, std::string& value) const {
1007  if (key < ClpLastStrParam) {
1008  value = strParam_[key];
1009  return true;
1010  } else {
1011  return false;
1012  }
1013  }
1014 #endif
1015  void generateCpp( FILE * fp);
1050  inline unsigned int specialOptions() const {
1051  return specialOptions_;
1052  }
1053  void setSpecialOptions(unsigned int value);
1054 #define COIN_CBC_USING_CLP 0x01000000
1055  inline bool inCbcBranchAndBound() const {
1056  return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1057  }
1059 
1062 protected:
1064  void gutsOfDelete(int type);
1068  void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
1070  void getRowBound(int iRow, double& lower, double& upper) const;
1072  void gutsOfLoadModel ( int numberRows, int numberColumns,
1073  const double* collb, const double* colub,
1074  const double* obj,
1075  const double* rowlb, const double* rowub,
1076  const double * rowObjective = NULL);
1078  void gutsOfScaling();
1080  inline double rawObjectiveValue() const {
1081  return objectiveValue_;
1082  }
1084  inline bool permanentArrays() const {
1085  return (specialOptions_ & 65536) != 0;
1086  }
1088  void startPermanentArrays();
1090  void stopPermanentArrays();
1092  const char * const * rowNamesAsChar() const;
1094  const char * const * columnNamesAsChar() const;
1096  void deleteNamesAsChar(const char * const * names, int number) const;
1098  void onStopped();
1100 
1101 
1103 protected:
1104 
1107  double optimizationDirection_;
1118  double rhsScale_;
1124  double * rowActivity_;
1128  double * dual_;
1130  double * reducedCost_;
1132  double* rowLower_;
1134  double* rowUpper_;
1138  double * rowObjective_;
1140  double * columnLower_;
1142  double * columnUpper_;
1150  double * ray_;
1152  double * rowScale_;
1154  double * columnScale_;
1169  unsigned char * status_;
1198 #define ROW_COLUMN_COUNTS_SAME 1
1199 #define MATRIX_SAME 2
1200 #define MATRIX_JUST_ROWS_ADDED 4
1201 #define MATRIX_JUST_COLUMNS_ADDED 8
1202 #define ROW_LOWER_SAME 16
1203 #define ROW_UPPER_SAME 32
1204 #define OBJECTIVE_SAME 64
1205 #define COLUMN_LOWER_SAME 128
1206 #define COLUMN_UPPER_SAME 256
1207 #define BASIS_SAME 512
1208 #define ALL_SAME 65339
1209 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1210  unsigned int whatsChanged_;
1222  unsigned int specialOptions_;
1224  CoinMessageHandler * handler_;
1228  CoinThreadRandom randomNumberGenerator_;
1231 #ifndef CLP_NO_STD
1232  std::vector<std::string> rowNames_;
1235  std::vector<std::string> columnNames_;
1236 #endif
1237  CoinMessages messages_;
1240  CoinMessages coinMessages_;
1250  CoinPackedMatrix baseMatrix_;
1252  CoinPackedMatrix baseRowCopy_;
1254  double * savedRowScale_;
1257 #ifndef CLP_NO_STD
1258  std::string strParam_[ClpLastStrParam];
1260 #endif
1261 
1262 };
1266 
1267 public:
1271  ClpDataSave ( );
1273 
1275  ClpDataSave(const ClpDataSave &);
1277  ClpDataSave & operator=(const ClpDataSave & rhs);
1279  ~ClpDataSave ( );
1280 
1282 
1284 public:
1285 
1288  double dualBound_;
1299  unsigned int specialOptions_;
1301 };
1302 
1303 #endif
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:770
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:889
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
~ClpDataSave()
Destructor.
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1108
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:329
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:901
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1256
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:726
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1116
The maximum amount the primal constraints can be violated and still be considered feasible...
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:612
const double * getColSolution() const
Definition: ClpModel.hpp:473
void startPermanentArrays()
Start using maximumRows_ and Columns_.
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:919
The maximum number of iterations Clp can execute in the simplex methods.
double * inverseColumnScale_
Inverse column scale factors for matrix (end of columnScale_)
Definition: ClpModel.hpp:1158
void copy(const ClpMatrixBase *from, ClpMatrixBase *&to)
Copy contents - resizing if necessary - otherwise re-use memory.
bool setIntParam(ClpIntParam key, int value)
Set an integer parameter.
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most)
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1233
int getNumRows() const
Definition: ClpModel.hpp:318
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:712
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1134
double * mutableRowScale() const
Definition: ClpModel.hpp:606
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1110
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1214
void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition: ClpModel.hpp:424
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:762
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1154
void setColumnName(int colIndex, std::string &name)
Set name of col.
const double * getColLower() const
Definition: ClpModel.hpp:684
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:933
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 setContinuous(int index)
Set the index-th variable to be a continuous variable.
ClpMatrixBase * rowCopy_
Row copy if wanted.
Definition: ClpModel.hpp:1146
double * objective() const
Objective.
Definition: ClpModel.hpp:649
int sparseThreshold_
Definition: ClpModel.hpp:1295
const double * columnScale() const
Definition: ClpModel.hpp:597
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition: ClpModel.hpp:548
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1259
ClpIntParam
This is where to put any useful stuff.
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition: ClpModel.hpp:786
int perturbation_
Definition: ClpModel.hpp:1296
void copyInIntegerInformation(const char *information)
Copy in integer informations.
void setObjectiveOffset(double value)
void copyRowNames(const std::vector< std::string > &rowNames, int first, int last)
Copies in Row names - modifies names first .. last-1.
void deleteIntegerInformation()
Drop integer informations.
Abstract base class for Clp Matrices.
double dualTolerance() const
Dual tolerance to use.
Definition: ClpModel.hpp:334
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:344
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1244
void setMaximumSeconds(double value)
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:681
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1238
double * dual_
Duals.
Definition: ClpModel.hpp:1128
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
bool setStrParam(ClpStrParam key, const std::string &value)
Set an string parameter.
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
Add columns.
const double * rowScale() const
Scaling.
Definition: ClpModel.hpp:594
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1130
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:501
ClpDblParam
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:455
For a structure to be used by trusted code.
double * mutableColumnScale() const
Definition: ClpModel.hpp:609
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1144
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1240
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:929
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:861
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:821
void setObjectiveScale(double value)
Definition: ClpModel.hpp:629
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:752
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:339
const double * getReducedCost() const
Definition: ClpModel.hpp:490
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:487
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1120
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1181
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:810
CoinMessageHandler * pushMessageHandler(CoinMessageHandler *handler, bool &oldDefault)
Pass in Message handler (not deleted at end) and return current.
void setDefaultMessageHandler()
Overrides message handler with a default one.
void setPrimalObjectiveLimit(double value)
Maximum time in seconds - after this action is as max iterations.
int numberIterations_
Number of iterations.
Definition: ClpModel.hpp:1179
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:885
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
bool isIterationLimitReached() const
Iteration limit reached?
Definition: ClpModel.hpp:451
~ClpModel()
Destructor.
double objectiveScale_
Definition: ClpModel.hpp:1294
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
Add one row.
double * rowObjective_
Row Objective (? sign) - may be NULL.
Definition: ClpModel.hpp:1138
const double * getRowActivity() const
Definition: ClpModel.hpp:466
const std::string & problemName() const
Definition: ClpModel.hpp:358
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:349
void setColSolution(const double *input)
Definition: ClpModel.hpp:476
Objective Abstract Base Class.
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:814
void gutsOfScaling()
Does much of scaling.
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1248
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:722
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1246
void setInteger(int index)
Set the index-th variable to be an integer variable.
void setWhatsChanged(int value)
Definition: ClpModel.hpp:817
virtual CoinPackedMatrix * getPackedMatrix() const =0
Return a complete CoinPackedMatrix.
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:747
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
int numberColumns() const
Definition: ClpModel.hpp:325
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:618
double * infeasibilityRay(bool fullRay=false) const
Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays...
CoinMessages * messagesPointer()
Return pointer to messages.
Definition: ClpModel.hpp:853
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1228
Set Dual objective limit.
void setRowName(int rowIndex, std::string &name)
Set name of row.
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
Definition: ClpModel.hpp:564
void newLanguage(CoinMessages::Language language)
Set language.
unsigned int whatsChanged_
Definition: ClpModel.hpp:1210
void onStopped()
On stopped - sets secondary status.
int logLevel() const
Definition: ClpModel.hpp:875
void setRhsScale(double value)
Definition: ClpModel.hpp:636
const double * getObjCoefficients() const
Definition: ClpModel.hpp:665
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:922
double getObjValue() const
Definition: ClpModel.hpp:758
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
void createEmptyMatrix()
Create empty ClpPackedMatrix.
#define COIN_CBC_USING_CLP
Definition: ClpModel.hpp:1054
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:385
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
const char *const * rowNamesAsChar() const
Create row names as char **.
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
Definition: ClpModel.hpp:1156
char * integerType_
Integer information.
Definition: ClpModel.hpp:1171
The maximum amount the dual constraints can be violated and still be considered feasible.
void setDualObjectiveLimit(double value)
int getNumCols() const
Number of columns.
Definition: ClpModel.hpp:322
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:369
void setObjective(ClpObjective *objective)
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault)
back to previous message handler
Just a marker, so that we can allocate a static sized array to store parameters.
const double * getRowUpper() const
Definition: ClpModel.hpp:504
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:688
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.
void getRowBound(int iRow, double &lower, double &upper) const
gets lower and upper bounds on rows
double pivotTolerance_
Definition: ClpModel.hpp:1290
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1148
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:480
void scaling(int mode=1)
Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab...
ClpStrParam
bool isInteger(int index) const
Return true if the index-th variable is an integer variable.
void setOptimizationDirection(double value)
int lengthNames_
length of names (0 means no names)
Definition: ClpModel.hpp:1216
int problemStatus() const
Definition: ClpModel.hpp:403
unsigned int specialOptions() const
For advanced options 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1050
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...
const char *const * columnNamesAsChar() const
Create column names as char **.
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
Load up quadratic objective.
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1142
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:790
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:470
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1250
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:645
void deleteQuadraticObjective()
Get rid of quadratic objective.
void setSolveType(int type)
Definition: ClpModel.hpp:376
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:879
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:494
void setSpecialOptions(unsigned int value)
void setMaximumIterations(int value)
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition: ClpModel.hpp:705
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1150
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1292
CoinModel * createCoinModel() const
This creates a coinModel object.
const double * getRowPrice() const
Definition: ClpModel.hpp:483
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:354
int forceFactorization_
Definition: ClpModel.hpp:1297
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:431
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1122
Objective function constant.
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows...
Definition: ClpModel.hpp:1161
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1265
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:513
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:849
void times(double scalar, const double *x, double *y) const
Return y + A * x * scalar in y.
bool defaultHandler_
Flag to say if default handler (so delete)
Definition: ClpModel.hpp:1226
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:633
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:674
void setNumberThreads(int value)
Definition: ClpModel.hpp:824
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
void setLengthNames(int value)
length of names (0 means no names0
Definition: ClpModel.hpp:906
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1152
void deleteRows(int number, const int *which)
Deletes rows.
void * getUserPointer() const
Definition: ClpModel.hpp:803
void chgRowLower(const double *rowLower)
Change row lower bounds.
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1006
int emptyProblem(int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
Solve a problem with no elements - return status and dual and primal infeasibilites.
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:373
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
void setDualTolerance(double value)
void setSmallElementValue(double value)
Definition: ClpModel.hpp:708
double acceptablePivot_
Definition: ClpModel.hpp:1293
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:443
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:857
ClpDataSave()
Default constructor.
int cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
double dualBound_
Definition: ClpModel.hpp:1288
void setObjectiveValue(double value)
Definition: ClpModel.hpp:755
unsigned int specialOptions_
Definition: ClpModel.hpp:1299
void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpModel & operator=(const ClpModel &rhs)
Assignment operator. This copies the data.
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...
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1230
double getObjSense() const
Definition: ClpModel.hpp:458
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:839
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:407
const double * getColUpper() const
Definition: ClpModel.hpp:691
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1055
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
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).
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1235
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1252
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:777
void setPrimalTolerance(double value)
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1218
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1080
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
Base class for Clp event handling.
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition: ClpModel.hpp:543
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition: ClpModel.hpp:231
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:893
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:987
Primal objective limit.
Just a marker, so that we can allocate a static sized array to store parameters.
double infeasibilityCost_
Definition: ClpModel.hpp:1289
void copyNames(const std::vector< std::string > &rowNames, const std::vector< std::string > &columnNames)
Copies in names.
double smallElement_
Small element value.
Definition: ClpModel.hpp:1114
int scalingFlag_
Definition: ClpModel.hpp:1298
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:439
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
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...
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
CoinMessageHandler * handler_
Message handler.
Definition: ClpModel.hpp:1224
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:657
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:718
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1169
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:400
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:626
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1118
bool setDblParam(ClpDblParam key, double value)
Set an double parameter.
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:872
const double * inverseColumnScale() const
Definition: ClpModel.hpp:603
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:380
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:996
void deleteRowsAndColumns(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Deletes rows AND columns (keeps old sizes)
void setRandomSeed(int value)
Set seed for thread specific random number generator.
Definition: ClpModel.hpp:897
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1124
void deleteColumns(int number, const int *which)
Deletes columns.
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1126
double * unboundedRay() const
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1136
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1291
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:435
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:773
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1212
ClpModel(bool emptyMessages=false)
Default constructor.
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead...
Definition: ClpModel.hpp:782
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
Add rows.
bool permanentArrays() const
If we are using maximumRows_ and Columns_.
Definition: ClpModel.hpp:1084
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1132
void deleteNamesAsChar(const char *const *names, int number) const
Delete char * version of names.
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
void setSecondaryStatus(int newstatus)
Definition: ClpModel.hpp:427
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:615
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:553
void setRowScale(double *scale)
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:845
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:463
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:363
unsigned char * statusCopy() const
Return copy of status (i.e.
void setColumnScale(double *scale)
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:910
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
int getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:700
const std::string & rowName(int iRow) const
Definition: ClpModel.hpp:913
const double * inverseRowScale() const
Definition: ClpModel.hpp:600
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:731
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1112
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 double * getRowLower() const
Definition: ClpModel.hpp:497
void returnModel(ClpModel &otherModel)
Return model - nulls all arrays so can be deleted safely also updates any scalars.
Name of the problem.
Tolerance to use in presolve.
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition: ClpModel.hpp:807
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:695
int readGMPL(const char *filename, const char *dataName, bool keepNames=false)
Read GMPL files from the given filenames.
void borrowModel(ClpModel &otherModel)
Borrow model.
int maximumColumns_
Maximum number of columns in model.
Definition: ClpModel.hpp:1242
Just a marker, so that we can allocate a static sized array to store parameters.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1173
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:800
void chgColumnLower(const double *columnLower)
Change column lower bounds.
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1140
int getIterationCount() const
Definition: ClpModel.hpp:366
void unscale()
If we constructed a "really" scaled model then this reverses the operation.
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
Definition: ClpModel.hpp:1175
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1177
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1254
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
unsigned int specialOptions_
For advanced options See get and set for meaning.
Definition: ClpModel.hpp:1222
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:677