Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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"
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);
389  void setMaximumWallSeconds(double value);
391  bool hitMaximumIterations() const;
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  }
449  bool isPrimalObjectiveLimitReached() const ;
451  bool isDualObjectiveLimitReached() const ;
453  inline bool isIterationLimitReached() const {
454  return problemStatus_ == 3;
455  }
457  inline double optimizationDirection() const {
458  return optimizationDirection_;
459  }
460  inline double getObjSense() const {
461  return optimizationDirection_;
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  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  }
718  void setNewRowCopy(ClpMatrixBase * newCopy);
720  inline ClpMatrixBase * clpMatrix() const {
721  return matrix_;
722  }
724  inline ClpPackedMatrix * clpScaledMatrix() const {
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 
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  }
848  return handler_;
849  }
851  inline CoinMessages messages() const {
852  return messages_;
853  }
856  return & messages_;
857  }
859  inline CoinMessages coinMessages() const {
860  return coinMessages_;
861  }
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  }
892  return &randomNumberGenerator_;
893  }
896  return randomNumberGenerator_;
897  }
899  inline void setRandomSeed(int value) {
901  }
903  inline int lengthNames() const {
904  return lengthNames_;
905  }
906 #ifndef CLP_NO_STD
907  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
930  inline ClpObjective * objectiveAsObject() const {
932  return objective_;
933  }
934  void setObjective(ClpObjective * objective);
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  bool setIntParam(ClpIntParam key, int value) ;
983  bool setDblParam(ClpDblParam key, double value) ;
984 #ifndef CLP_NO_STD
985  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
1017  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 
1066 protected:
1068  void gutsOfDelete(int type);
1072  void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
1074  void getRowBound(int iRow, double& lower, double& upper) const;
1076  void gutsOfLoadModel ( int numberRows, int numberColumns,
1077  const double* collb, const double* colub,
1078  const double* obj,
1079  const double* rowlb, const double* rowub,
1080  const double * rowObjective = NULL);
1082  void gutsOfScaling();
1084  inline double rawObjectiveValue() const {
1085  return objectiveValue_;
1086  }
1088  inline bool permanentArrays() const {
1089  return (specialOptions_ & 65536) != 0;
1090  }
1092  void startPermanentArrays();
1094  void stopPermanentArrays();
1096  const char * const * rowNamesAsChar() const;
1098  const char * const * columnNamesAsChar() const;
1100  void deleteNamesAsChar(const char * const * names, int number) const;
1102  void onStopped();
1104 
1105 
1107 protected:
1108 
1111  double optimizationDirection_;
1122  double rhsScale_;
1128  double * rowActivity_;
1132  double * dual_;
1134  double * reducedCost_;
1136  double* rowLower_;
1138  double* rowUpper_;
1142  double * rowObjective_;
1144  double * columnLower_;
1146  double * columnUpper_;
1154  double * ray_;
1156  double * rowScale_;
1158  double * columnScale_;
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_;
1235 #ifndef CLP_NO_STD
1236  std::vector<std::string> rowNames_;
1239  std::vector<std::string> columnNames_;
1240 #endif
1258  double * savedRowScale_;
1261 #ifndef CLP_NO_STD
1262  std::string strParam_[ClpLastStrParam];
1264 #endif
1265 
1266 };
1270 
1271 public:
1275  ClpDataSave ( );
1277 
1279  ClpDataSave(const ClpDataSave &);
1281  ClpDataSave & operator=(const ClpDataSave & rhs);
1283  ~ClpDataSave ( );
1284 
1286 
1288 public:
1289 
1292  double dualBound_;
1303  unsigned int specialOptions_;
1305 };
1306 
1307 #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:772
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:891
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:1112
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:329
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:903
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1260
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:728
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1120
The maximum amount the primal constraints can be violated and still be considered feasible...
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:614
const double * getColSolution() const
Definition: ClpModel.hpp:475
void startPermanentArrays()
Start using maximumRows_ and Columns_.
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:921
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:1162
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:1237
int getNumRows() const
Definition: ClpModel.hpp:318
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:714
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1138
double * mutableRowScale() const
Definition: ClpModel.hpp:608
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1114
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1218
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:426
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:764
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1158
void setColumnName(int colIndex, std::string &name)
Set name of col.
const double * getColLower() const
Definition: ClpModel.hpp:686
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:935
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:1150
double * objective() const
Objective.
Definition: ClpModel.hpp:651
int sparseThreshold_
Definition: ClpModel.hpp:1299
const double * columnScale() const
Definition: ClpModel.hpp:599
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:550
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1263
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:788
int perturbation_
Definition: ClpModel.hpp:1300
void copyInIntegerInformation(const char *information)
Copy in integer informations.
void setMaximumWallSeconds(double value)
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:1248
void setMaximumSeconds(double value)
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:683
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1242
double * dual_
Duals.
Definition: ClpModel.hpp:1132
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:596
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1134
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:503
ClpDblParam
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:457
For a structure to be used by trusted code.
double * mutableColumnScale() const
Definition: ClpModel.hpp:611
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1148
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1244
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:931
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:863
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:823
void setObjectiveScale(double value)
Definition: ClpModel.hpp:631
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:754
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:339
const double * getReducedCost() const
Definition: ClpModel.hpp:492
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:489
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:161
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1124
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1185
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:812
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:1183
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:887
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:453
~ClpModel()
Destructor.
double objectiveScale_
Definition: ClpModel.hpp:1298
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:1142
const double * getRowActivity() const
Definition: ClpModel.hpp:468
Base class for message handling.
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:478
Objective Abstract Base Class.
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:816
void gutsOfScaling()
Does much of scaling.
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1252
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:724
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1250
void setInteger(int index)
Set the index-th variable to be an integer variable.
void setWhatsChanged(int value)
Definition: ClpModel.hpp:819
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:749
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
int numberColumns() const
Definition: ClpModel.hpp:325
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:620
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:855
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1232
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:566
void newLanguage(CoinMessages::Language language)
Set language.
unsigned int whatsChanged_
Definition: ClpModel.hpp:1214
Abstract base class for various sparse vectors.
void onStopped()
On stopped - sets secondary status.
int logLevel() const
Definition: ClpModel.hpp:877
void setRhsScale(double value)
Definition: ClpModel.hpp:638
const double * getObjCoefficients() const
Definition: ClpModel.hpp:667
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:924
double getObjValue() const
Definition: ClpModel.hpp:760
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:1058
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:1160
char * integerType_
Integer information.
Definition: ClpModel.hpp:1175
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
int logLevel() const
Get current log (detail) level.
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:506
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:690
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:1294
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1152
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:482
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
This is a first attempt at a message handler.
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:1220
int problemStatus() const
Definition: ClpModel.hpp:404
unsigned int specialOptions() const
For advanced options 1 - Don&#39;t keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1054
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:1146
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:792
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:472
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1254
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:647
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:881
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:496
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:707
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1154
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1296
CoinModel * createCoinModel() const
This creates a coinModel object.
const double * getRowPrice() const
Definition: ClpModel.hpp:485
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:354
int forceFactorization_
Definition: ClpModel.hpp:1301
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:433
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1126
Objective function constant.
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows...
Definition: ClpModel.hpp:1165
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1269
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:515
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:851
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:1230
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:635
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:676
void setNumberThreads(int value)
Definition: ClpModel.hpp:826
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:908
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1156
void deleteRows(int number, const int *which)
Deletes rows.
void * getUserPointer() const
Definition: ClpModel.hpp:805
void chgRowLower(const double *rowLower)
Change row lower bounds.
void scale(OsiRowCut &cut)
scale the cut passed as argument
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1008
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:710
double acceptablePivot_
Definition: ClpModel.hpp:1297
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:445
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:859
ClpDataSave()
Default constructor.
int cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
double dualBound_
Definition: ClpModel.hpp:1292
void setObjectiveValue(double value)
Definition: ClpModel.hpp:757
unsigned int specialOptions_
Definition: ClpModel.hpp:1303
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...
Sparse Matrix Base Class.
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1234
double getObjSense() const
Definition: ClpModel.hpp:460
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:841
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:408
const double * getColUpper() const
Definition: ClpModel.hpp:693
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1059
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:1239
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1256
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:779
void setSeed(int seed)
Set seed.
void setPrimalTolerance(double value)
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1222
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1084
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:545
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
Language
Supported languages.
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:895
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:989
Primal objective limit.
Just a marker, so that we can allocate a static sized array to store parameters.
int CoinBigIndex
double infeasibilityCost_
Definition: ClpModel.hpp:1293
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:1118
int scalingFlag_
Definition: ClpModel.hpp:1302
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:441
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:1228
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:659
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:720
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1173
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:401
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:628
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1122
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:874
const double * inverseColumnScale() const
Definition: ClpModel.hpp:605
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:380
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:998
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:899
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1128
void deleteColumns(int number, const int *which)
Deletes columns.
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1130
double * unboundedRay() const
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1140
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1295
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:437
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:775
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1216
ClpModel(bool emptyMessages=false)
Default constructor.
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead...
Definition: ClpModel.hpp:784
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:1088
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1136
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:429
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:617
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:555
void setRowScale(double *scale)
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:847
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:465
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
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:912
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
int getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:702
const std::string & rowName(int iRow) const
Definition: ClpModel.hpp:915
const double * inverseRowScale() const
Definition: ClpModel.hpp:602
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:733
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1116
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:499
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:809
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:697
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:1246
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.
In many cases it is natural to build a model by adding one row at a time.
Definition: CoinBuild.hpp:27
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1177
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:802
void chgColumnLower(const double *columnLower)
Change column lower bounds.
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1144
int getIterationCount() const
Definition: ClpModel.hpp:366
void unscale()
If we constructed a &quot;really&quot; scaled model then this reverses the operation.
Class to hold and manipulate an array of massaged messages.
void setLogLevel(int value)
Set current log (detail) level.
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:1179
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1181
Class for thread specific random numbers.
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1258
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:1226
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:679