Cgl  0.60.3
 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 2385 2019-01-06 19:43:06Z unxusr $ */
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:
46  ClpModel(bool emptyMessages = false);
48 
53  ClpModel(const ClpModel &rhs, int scalingMode = -1);
55  ClpModel &operator=(const ClpModel &rhs);
60  ClpModel(const ClpModel *wholeModel,
61  int numberRows, const int *whichRows,
62  int numberColumns, const int *whichColumns,
63  bool dropNames = true, bool dropIntegers = true);
65  ~ClpModel();
67 
81  void loadProblem(const ClpMatrixBase &matrix,
82  const double *collb, const double *colub,
83  const double *obj,
84  const double *rowlb, const double *rowub,
85  const double *rowObjective = NULL);
86  void loadProblem(const CoinPackedMatrix &matrix,
87  const double *collb, const double *colub,
88  const double *obj,
89  const double *rowlb, const double *rowub,
90  const double *rowObjective = NULL);
91 
94  void loadProblem(const int numcols, const int numrows,
95  const CoinBigIndex *start, const int *index,
96  const double *value,
97  const double *collb, const double *colub,
98  const double *obj,
99  const double *rowlb, const double *rowub,
100  const double *rowObjective = NULL);
106  int loadProblem(CoinModel &modelObject, bool tryPlusMinusOne = false);
108  void loadProblem(const int numcols, const int numrows,
109  const CoinBigIndex *start, const int *index,
110  const double *value, const int *length,
111  const double *collb, const double *colub,
112  const double *obj,
113  const double *rowlb, const double *rowub,
114  const double *rowObjective = NULL);
116  void loadQuadraticObjective(const int numberColumns,
117  const CoinBigIndex *start,
118  const int *column, const double *element);
119  void loadQuadraticObjective(const CoinPackedMatrix &matrix);
123  void setRowObjective(const double *rowObjective);
125  int readMps(const char *filename,
126  bool keepNames = false,
127  bool ignoreErrors = false);
129  int readGMPL(const char *filename, const char *dataName,
130  bool keepNames = false);
132  void copyInIntegerInformation(const char *information);
136  void setContinuous(int index);
138  void setInteger(int index);
140  bool isInteger(int index) const;
142  void resize(int newNumberRows, int newNumberColumns);
144  void deleteRows(int number, const int *which);
146  void addRow(int numberInRow, const int *columns,
147  const double *elements, double rowLower = -COIN_DBL_MAX,
148  double rowUpper = COIN_DBL_MAX);
150  void addRows(int number, const double *rowLower,
151  const double *rowUpper,
152  const CoinBigIndex *rowStarts, const int *columns,
153  const double *elements);
155  void addRows(int number, const double *rowLower,
156  const double *rowUpper,
157  const CoinBigIndex *rowStarts, const int *rowLengths,
158  const int *columns,
159  const double *elements);
160 #ifndef CLP_NO_VECTOR
161  void addRows(int number, const double *rowLower,
162  const double *rowUpper,
163  const CoinPackedVectorBase *const *rows);
164 #endif
165 
170  int addRows(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
171  bool checkDuplicates = true);
180  int addRows(CoinModel &modelObject, bool tryPlusMinusOne = false,
181  bool checkDuplicates = true);
182 
184  void deleteColumns(int number, const int *which);
186  void deleteRowsAndColumns(int numberRows, const int *whichRows,
187  int numberColumns, const int *whichColumns);
189  void addColumn(int numberInColumn,
190  const int *rows,
191  const double *elements,
192  double columnLower = 0.0,
193  double columnUpper = COIN_DBL_MAX,
194  double objective = 0.0);
196  void addColumns(int number, const double *columnLower,
197  const double *columnUpper,
198  const double *objective,
199  const CoinBigIndex *columnStarts, const int *rows,
200  const double *elements);
201  void addColumns(int number, const double *columnLower,
202  const double *columnUpper,
203  const double *objective,
204  const CoinBigIndex *columnStarts, const int *columnLengths,
205  const int *rows,
206  const double *elements);
207 #ifndef CLP_NO_VECTOR
208  void addColumns(int number, const double *columnLower,
209  const double *columnUpper,
210  const double *objective,
211  const CoinPackedVectorBase *const *columns);
212 #endif
213 
218  int addColumns(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
219  bool checkDuplicates = true);
227  int addColumns(CoinModel &modelObject, bool tryPlusMinusOne = false,
228  bool checkDuplicates = true);
230  inline void modifyCoefficient(int row, int column, double newElement,
231  bool keepZero = false)
232  {
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  CoinBigIndex 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  {
317  return numberRows_;
318  }
319  inline int getNumRows() const
320  {
321  return numberRows_;
322  }
324  inline int getNumCols() const
325  {
326  return numberColumns_;
327  }
328  inline int numberColumns() const
329  {
330  return numberColumns_;
331  }
333  inline double primalTolerance() const
334  {
336  }
337  void setPrimalTolerance(double value);
339  inline double dualTolerance() const
340  {
341  return dblParam_[ClpDualTolerance];
342  }
343  void setDualTolerance(double value);
345  inline double primalObjectiveLimit() const
346  {
348  }
349  void setPrimalObjectiveLimit(double value);
351  inline double dualObjectiveLimit() const
352  {
354  }
355  void setDualObjectiveLimit(double value);
357  inline double objectiveOffset() const
358  {
359  return dblParam_[ClpObjOffset];
360  }
361  void setObjectiveOffset(double value);
363  inline double presolveTolerance() const
364  {
366  }
367 #ifndef CLP_NO_STD
368  inline const std::string &problemName() const
369  {
370  return strParam_[ClpProbName];
371  }
372 #endif
373  inline int numberIterations() const
375  {
376  return numberIterations_;
377  }
378  inline int getIterationCount() const
379  {
380  return numberIterations_;
381  }
382  inline void setNumberIterations(int numberIterationsNew)
383  {
384  numberIterations_ = numberIterationsNew;
385  }
387  inline int solveType() const
388  {
389  return solveType_;
390  }
391  inline void setSolveType(int type)
392  {
393  solveType_ = type;
394  }
396  inline int maximumIterations() const
397  {
399  }
400  void setMaximumIterations(int value);
402  inline double maximumSeconds() const
403  {
404  return dblParam_[ClpMaxSeconds];
405  }
406  void setMaximumSeconds(double value);
407  void setMaximumWallSeconds(double value);
409  bool hitMaximumIterations() const;
419  inline int status() const
420  {
421  return problemStatus_;
422  }
423  inline int problemStatus() const
424  {
425  return problemStatus_;
426  }
428  inline void setProblemStatus(int problemStatusNew)
429  {
430  problemStatus_ = problemStatusNew;
431  }
447  inline int secondaryStatus() const
448  {
449  return secondaryStatus_;
450  }
451  inline void setSecondaryStatus(int newstatus)
452  {
453  secondaryStatus_ = newstatus;
454  }
456  inline bool isAbandoned() const
457  {
458  return problemStatus_ == 4;
459  }
461  inline bool isProvenOptimal() const
462  {
463  return problemStatus_ == 0;
464  }
466  inline bool isProvenPrimalInfeasible() const
467  {
468  return problemStatus_ == 1;
469  }
471  inline bool isProvenDualInfeasible() const
472  {
473  return problemStatus_ == 2;
474  }
476  bool isPrimalObjectiveLimitReached() const;
478  bool isDualObjectiveLimitReached() const;
480  inline bool isIterationLimitReached() const
481  {
482  return problemStatus_ == 3;
483  }
485  inline double optimizationDirection() const
486  {
487  return optimizationDirection_;
488  }
489  inline double getObjSense() const
490  {
491  return optimizationDirection_;
492  }
493  void setOptimizationDirection(double value);
495  inline double *primalRowSolution() const
496  {
497  return rowActivity_;
498  }
499  inline const double *getRowActivity() const
500  {
501  return rowActivity_;
502  }
504  inline double *primalColumnSolution() const
505  {
506  return columnActivity_;
507  }
508  inline const double *getColSolution() const
509  {
510  return columnActivity_;
511  }
512  inline void setColSolution(const double *input)
513  {
514  memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
515  }
517  inline double *dualRowSolution() const
518  {
519  return dual_;
520  }
521  inline const double *getRowPrice() const
522  {
523  return dual_;
524  }
526  inline double *dualColumnSolution() const
527  {
528  return reducedCost_;
529  }
530  inline const double *getReducedCost() const
531  {
532  return reducedCost_;
533  }
535  inline double *rowLower() const
536  {
537  return rowLower_;
538  }
539  inline const double *getRowLower() const
540  {
541  return rowLower_;
542  }
544  inline double *rowUpper() const
545  {
546  return rowUpper_;
547  }
548  inline const double *getRowUpper() const
549  {
550  return rowUpper_;
551  }
552  //-------------------------------------------------------------------------
556  void setObjectiveCoefficient(int elementIndex, double elementValue);
558  inline void setObjCoeff(int elementIndex, double elementValue)
559  {
560  setObjectiveCoefficient(elementIndex, elementValue);
561  }
562 
565  void setColumnLower(int elementIndex, double elementValue);
566 
569  void setColumnUpper(int elementIndex, double elementValue);
570 
572  void setColumnBounds(int elementIndex,
573  double lower, double upper);
574 
583  void setColumnSetBounds(const int *indexFirst,
584  const int *indexLast,
585  const double *boundList);
586 
589  inline void setColLower(int elementIndex, double elementValue)
590  {
591  setColumnLower(elementIndex, elementValue);
592  }
595  inline void setColUpper(int elementIndex, double elementValue)
596  {
597  setColumnUpper(elementIndex, elementValue);
598  }
599 
601  inline void setColBounds(int elementIndex,
602  double lower, double upper)
603  {
604  setColumnBounds(elementIndex, lower, upper);
605  }
606 
613  inline void setColSetBounds(const int *indexFirst,
614  const int *indexLast,
615  const double *boundList)
616  {
617  setColumnSetBounds(indexFirst, indexLast, boundList);
618  }
619 
622  void setRowLower(int elementIndex, double elementValue);
623 
626  void setRowUpper(int elementIndex, double elementValue);
627 
629  void setRowBounds(int elementIndex,
630  double lower, double upper);
631 
638  void setRowSetBounds(const int *indexFirst,
639  const int *indexLast,
640  const double *boundList);
641 
643  inline const double *rowScale() const
645  {
646  return rowScale_;
647  }
648  inline const double *columnScale() const
649  {
650  return columnScale_;
651  }
652  inline const double *inverseRowScale() const
653  {
654  return inverseRowScale_;
655  }
656  inline const double *inverseColumnScale() const
657  {
658  return inverseColumnScale_;
659  }
660  inline double *mutableRowScale() const
661  {
662  return rowScale_;
663  }
664  inline double *mutableColumnScale() const
665  {
666  return columnScale_;
667  }
668  inline double *mutableInverseRowScale() const
669  {
670  return inverseRowScale_;
671  }
672  inline double *mutableInverseColumnScale() const
673  {
674  return inverseColumnScale_;
675  }
676  inline double *swapRowScale(double *newScale)
677  {
678  double *oldScale = rowScale_;
679  rowScale_ = newScale;
680  return oldScale;
681  }
682  void setRowScale(double *scale);
683  void setColumnScale(double *scale);
685  inline double objectiveScale() const
686  {
687  return objectiveScale_;
688  }
689  inline void setObjectiveScale(double value)
690  {
691  objectiveScale_ = value;
692  }
694  inline double rhsScale() const
695  {
696  return rhsScale_;
697  }
698  inline void setRhsScale(double value)
699  {
700  rhsScale_ = value;
701  }
703  void scaling(int mode = 1);
706  void unscale();
708  inline int scalingFlag() const
709  {
710  return scalingFlag_;
711  }
713  inline double *objective() const
714  {
715  if (objective_) {
716  double offset;
717  return objective_->gradient(NULL, NULL, offset, false);
718  } else {
719  return NULL;
720  }
721  }
722  inline double *objective(const double *solution, double &offset, bool refresh = true) const
723  {
724  offset = 0.0;
725  if (objective_) {
726  return objective_->gradient(NULL, solution, offset, refresh);
727  } else {
728  return NULL;
729  }
730  }
731  inline const double *getObjCoefficients() const
732  {
733  if (objective_) {
734  double offset;
735  return objective_->gradient(NULL, NULL, offset, false);
736  } else {
737  return NULL;
738  }
739  }
741  inline double *rowObjective() const
742  {
743  return rowObjective_;
744  }
745  inline const double *getRowObjCoefficients() const
746  {
747  return rowObjective_;
748  }
750  inline double *columnLower() const
751  {
752  return columnLower_;
753  }
754  inline const double *getColLower() const
755  {
756  return columnLower_;
757  }
759  inline double *columnUpper() const
760  {
761  return columnUpper_;
762  }
763  inline const double *getColUpper() const
764  {
765  return columnUpper_;
766  }
768  inline CoinPackedMatrix *matrix() const
769  {
770  if (matrix_ == NULL)
771  return NULL;
772  else
773  return matrix_->getPackedMatrix();
774  }
777  {
778  return matrix_->getNumElements();
779  }
782  inline double getSmallElementValue() const
783  {
784  return smallElement_;
785  }
786  inline void setSmallElementValue(double value)
787  {
788  smallElement_ = value;
789  }
791  inline ClpMatrixBase *rowCopy() const
792  {
793  return rowCopy_;
794  }
796  void setNewRowCopy(ClpMatrixBase *newCopy);
798  inline ClpMatrixBase *clpMatrix() const
799  {
800  return matrix_;
801  }
804  {
805  return scaledMatrix_;
806  }
808  inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
809  {
810  delete scaledMatrix_;
811  scaledMatrix_ = scaledMatrix;
812  }
815  {
816  ClpPackedMatrix *oldMatrix = scaledMatrix_;
817  scaledMatrix_ = scaledMatrix;
818  return oldMatrix;
819  }
825  void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent = false);
831  inline void replaceMatrix(CoinPackedMatrix *newmatrix,
832  bool deleteCurrent = false)
833  {
834  replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
835  }
837  inline double objectiveValue() const
838  {
840  }
841  inline void setObjectiveValue(double value)
842  {
844  }
845  inline double getObjValue() const
846  {
848  }
850  inline char *integerInformation() const
851  {
852  return integerType_;
853  }
856  double *infeasibilityRay(bool fullRay = false) const;
857  double *unboundedRay() const;
859  inline double *ray() const
860  {
861  return ray_;
862  }
864  inline bool rayExists() const
865  {
866  return (ray_ != NULL);
867  }
869  inline void deleteRay()
870  {
871  delete[] ray_;
872  ray_ = NULL;
873  }
875  inline const double *internalRay() const
876  {
877  return ray_;
878  }
880  inline bool statusExists() const
881  {
882  return (status_ != NULL);
883  }
885  inline unsigned char *statusArray() const
886  {
887  return status_;
888  }
891  unsigned char *statusCopy() const;
893  void copyinStatus(const unsigned char *statusArray);
894 
896  inline void setUserPointer(void *pointer)
897  {
898  userPointer_ = pointer;
899  }
900  inline void *getUserPointer() const
901  {
902  return userPointer_;
903  }
905  inline void setTrustedUserPointer(ClpTrustedData *pointer)
906  {
907  trustedUserPointer_ = pointer;
908  }
910  {
911  return trustedUserPointer_;
912  }
914  inline int whatsChanged() const
915  {
916  return whatsChanged_;
917  }
918  inline void setWhatsChanged(int value)
919  {
920  whatsChanged_ = value;
921  }
923  inline int numberThreads() const
924  {
925  return numberThreads_;
926  }
927  inline void setNumberThreads(int value)
928  {
929  numberThreads_ = value;
930  }
932 
938  bool &oldDefault);
940  void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault);
942  void newLanguage(CoinMessages::Language language);
943  inline void setLanguage(CoinMessages::Language language)
944  {
945  newLanguage(language);
946  }
951  {
952  return handler_;
953  }
955  inline CoinMessages messages() const
956  {
957  return messages_;
958  }
961  {
962  return &messages_;
963  }
965  inline CoinMessages coinMessages() const
966  {
967  return coinMessages_;
968  }
971  {
972  return &coinMessages_;
973  }
982  inline void setLogLevel(int value)
983  {
984  handler_->setLogLevel(value);
985  }
986  inline int logLevel() const
987  {
988  return handler_->logLevel();
989  }
991  inline bool defaultHandler() const
992  {
993  return defaultHandler_;
994  }
999  {
1000  return eventHandler_;
1001  }
1004  {
1005  return &randomNumberGenerator_;
1006  }
1009  {
1010  return randomNumberGenerator_;
1011  }
1013  inline void setRandomSeed(int value)
1014  {
1016  }
1018  inline int lengthNames() const
1019  {
1020  return lengthNames_;
1021  }
1022 #ifndef CLP_NO_STD
1023  inline void setLengthNames(int value)
1025  {
1026  lengthNames_ = value;
1027  }
1029  inline const std::vector< std::string > *rowNames() const
1030  {
1031  return &rowNames_;
1032  }
1033  inline const std::string &rowName(int iRow) const
1034  {
1035  return rowNames_[iRow];
1036  }
1038  std::string getRowName(int iRow) const;
1040  inline const std::vector< std::string > *columnNames() const
1041  {
1042  return &columnNames_;
1043  }
1044  inline const std::string &columnName(int iColumn) const
1045  {
1046  return columnNames_[iColumn];
1047  }
1049  std::string getColumnName(int iColumn) const;
1050 #endif
1051  inline ClpObjective *objectiveAsObject() const
1053  {
1054  return objective_;
1055  }
1056  void setObjective(ClpObjective *objective);
1057  inline void setObjectivePointer(ClpObjective *newobjective)
1058  {
1059  objective_ = newobjective;
1060  }
1063  int emptyProblem(int *infeasNumber = NULL, double *infeasSum = NULL, bool printMessage = true);
1064 
1066 
1075  void times(double scalar,
1076  const double *x, double *y) const;
1080  void transposeTimes(double scalar,
1081  const double *x, double *y) const;
1083 
1084  //---------------------------------------------------------------------------
1102  bool setIntParam(ClpIntParam key, int value);
1105  bool setDblParam(ClpDblParam key, double value);
1106 #ifndef CLP_NO_STD
1107  bool setStrParam(ClpStrParam key, const std::string &value);
1109 #endif
1110  // Get an integer parameter
1111  inline bool getIntParam(ClpIntParam key, int &value) const
1112  {
1113  if (key < ClpLastIntParam) {
1114  value = intParam_[key];
1115  return true;
1116  } else {
1117  return false;
1118  }
1119  }
1120  // Get an double parameter
1121  inline bool getDblParam(ClpDblParam key, double &value) const
1122  {
1123  if (key < ClpLastDblParam) {
1124  value = dblParam_[key];
1125  return true;
1126  } else {
1127  return false;
1128  }
1129  }
1130 #ifndef CLP_NO_STD
1131  // Get a string parameter
1132  inline bool getStrParam(ClpStrParam key, std::string &value) const
1133  {
1134  if (key < ClpLastStrParam) {
1135  value = strParam_[key];
1136  return true;
1137  } else {
1138  return false;
1139  }
1140  }
1141 #endif
1142  void generateCpp(FILE *fp);
1180  inline unsigned int specialOptions() const
1181  {
1182  return specialOptions_;
1183  }
1184  void setSpecialOptions(unsigned int value);
1185 #define COIN_CBC_USING_CLP 0x01000000
1186  inline bool inCbcBranchAndBound() const
1187  {
1188  return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1189  }
1191 
1194 protected:
1196  void gutsOfDelete(int type);
1200  void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1202  void getRowBound(int iRow, double &lower, double &upper) const;
1204  void gutsOfLoadModel(int numberRows, int numberColumns,
1205  const double *collb, const double *colub,
1206  const double *obj,
1207  const double *rowlb, const double *rowub,
1208  const double *rowObjective = NULL);
1210  void gutsOfScaling();
1212  inline double rawObjectiveValue() const
1213  {
1214  return objectiveValue_;
1215  }
1217  inline bool permanentArrays() const
1218  {
1219  return (specialOptions_ & 65536) != 0;
1220  }
1222  void startPermanentArrays();
1224  void stopPermanentArrays();
1226  const char *const *rowNamesAsChar() const;
1228  const char *const *columnNamesAsChar() const;
1230  void deleteNamesAsChar(const char *const *names, int number) const;
1232  void onStopped();
1234 
1236 protected:
1239  double optimizationDirection_;
1250  double rhsScale_;
1256  double *rowActivity_;
1260  double *dual_;
1262  double *reducedCost_;
1264  double *rowLower_;
1266  double *rowUpper_;
1270  double *rowObjective_;
1272  double *columnLower_;
1274  double *columnUpper_;
1282  double *ray_;
1284  double *rowScale_;
1286  double *columnScale_;
1301  unsigned char *status_;
1330 #define ROW_COLUMN_COUNTS_SAME 1
1331 #define MATRIX_SAME 2
1332 #define MATRIX_JUST_ROWS_ADDED 4
1333 #define MATRIX_JUST_COLUMNS_ADDED 8
1334 #define ROW_LOWER_SAME 16
1335 #define ROW_UPPER_SAME 32
1336 #define OBJECTIVE_SAME 64
1337 #define COLUMN_LOWER_SAME 128
1338 #define COLUMN_UPPER_SAME 256
1339 #define BASIS_SAME 512
1340 #define ALL_SAME 65339
1341 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1342  unsigned int whatsChanged_;
1354  unsigned int specialOptions_;
1363 #ifndef CLP_NO_STD
1364  std::vector< std::string > rowNames_;
1367  std::vector< std::string > columnNames_;
1368 #endif
1389 #ifndef CLP_NO_STD
1390  std::string strParam_[ClpLastStrParam];
1392 #endif
1393 
1394 };
1398 
1399 public:
1403  ClpDataSave();
1405 
1407  ClpDataSave(const ClpDataSave &);
1409  ClpDataSave &operator=(const ClpDataSave &rhs);
1411  ~ClpDataSave();
1412 
1414 
1416 public:
1419  double dualBound_;
1430  unsigned int specialOptions_;
1432 };
1433 
1434 #endif
1435 
1436 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1437 */
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:859
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1003
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:1240
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:333
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:1018
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1388
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:808
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1248
The maximum amount the primal constraints can be violated and still be considered feasible...
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:668
const double * getColSolution() const
Definition: ClpModel.hpp:508
void startPermanentArrays()
Start using maximumRows_ and Columns_.
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:1290
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)
int getNumRows() const
Definition: ClpModel.hpp:319
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:791
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1266
double * mutableRowScale() const
Definition: ClpModel.hpp:660
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1242
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1346
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:447
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:850
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1286
void setColumnName(int colIndex, std::string &name)
Set name of col.
const double * getColLower() const
Definition: ClpModel.hpp:754
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:1057
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:1278
double * objective() const
Objective.
Definition: ClpModel.hpp:713
int sparseThreshold_
Definition: ClpModel.hpp:1426
const double * columnScale() const
Definition: ClpModel.hpp:648
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:595
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1391
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:880
int perturbation_
Definition: ClpModel.hpp:1427
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:339
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:351
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1376
void setMaximumSeconds(double value)
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:750
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1370
double * dual_
Duals.
Definition: ClpModel.hpp:1260
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:644
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1262
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:544
ClpDblParam
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:485
For a structure to be used by trusted code.
double * mutableColumnScale() const
Definition: ClpModel.hpp:664
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1276
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1372
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:1052
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:970
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:923
void setObjectiveScale(double value)
Definition: ClpModel.hpp:689
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:837
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:345
const double * getReducedCost() const
Definition: ClpModel.hpp:530
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:526
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:181
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1252
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:1029
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1313
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:909
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:1311
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:998
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:480
~ClpModel()
Destructor.
double objectiveScale_
Definition: ClpModel.hpp:1425
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:1270
const double * getRowActivity() const
Definition: ClpModel.hpp:499
Base class for message handling.
const std::string & problemName() const
Definition: ClpModel.hpp:368
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:357
void setColSolution(const double *input)
Definition: ClpModel.hpp:512
Objective Abstract Base Class.
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:914
void gutsOfScaling()
Does much of scaling.
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1380
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:803
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1378
void setInteger(int index)
Set the index-th variable to be an integer variable.
void setWhatsChanged(int value)
Definition: ClpModel.hpp:918
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:831
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
int numberColumns() const
Definition: ClpModel.hpp:328
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:676
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:960
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1360
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:613
void newLanguage(CoinMessages::Language language)
Set language.
unsigned int whatsChanged_
Definition: ClpModel.hpp:1342
Abstract base class for various sparse vectors.
void onStopped()
On stopped - sets secondary status.
int logLevel() const
Definition: ClpModel.hpp:986
void setRhsScale(double value)
Definition: ClpModel.hpp:698
const double * getObjCoefficients() const
Definition: ClpModel.hpp:731
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:1044
double getObjValue() const
Definition: ClpModel.hpp:845
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:1185
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:402
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:1288
char * integerType_
Integer information.
Definition: ClpModel.hpp:1303
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:324
int logLevel() const
Get current log (detail) level.
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:382
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1365
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:548
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:759
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:1421
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1280
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:517
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:1348
int problemStatus() const
Definition: ClpModel.hpp:423
unsigned int specialOptions() const
For advanced options 1 - Don&#39;t keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1180
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:1274
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:885
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:504
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1382
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:708
void deleteQuadraticObjective()
Get rid of quadratic objective.
void setSolveType(int type)
Definition: ClpModel.hpp:391
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:991
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:535
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:782
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1282
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1423
CoinModel * createCoinModel() const
This creates a coinModel object.
const double * getRowPrice() const
Definition: ClpModel.hpp:521
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:363
int forceFactorization_
Definition: ClpModel.hpp:1428
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:456
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1254
Objective function constant.
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows...
Definition: ClpModel.hpp:1293
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1397
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:558
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:955
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:1358
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:694
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:741
void setNumberThreads(int value)
Definition: ClpModel.hpp:927
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:1024
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1284
void deleteRows(int number, const int *which)
Deletes rows.
void * getUserPointer() const
Definition: ClpModel.hpp:900
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:1132
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:387
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
void setDualTolerance(double value)
void setSmallElementValue(double value)
Definition: ClpModel.hpp:786
double acceptablePivot_
Definition: ClpModel.hpp:1424
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:471
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:965
ClpDataSave()
Default constructor.
double dualBound_
Definition: ClpModel.hpp:1419
void setObjectiveValue(double value)
Definition: ClpModel.hpp:841
unsigned int specialOptions_
Definition: ClpModel.hpp:1430
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:1362
double getObjSense() const
Definition: ClpModel.hpp:489
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:943
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:428
const double * getColUpper() const
Definition: ClpModel.hpp:763
CoinBigIndex cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1186
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).
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1384
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:869
void setSeed(int seed)
Set seed.
void setPrimalTolerance(double value)
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1350
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1212
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:589
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:230
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1008
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:1111
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:1420
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:1246
int scalingFlag_
Definition: ClpModel.hpp:1429
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:466
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:1356
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:722
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:798
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1301
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:419
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:685
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1250
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:776
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:982
const double * inverseColumnScale() const
Definition: ClpModel.hpp:656
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:396
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:1121
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:1013
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1256
void deleteColumns(int number, const int *which)
Deletes columns.
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1258
double * unboundedRay() const
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1268
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1422
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:461
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1367
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:864
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1344
ClpModel(bool emptyMessages=false)
Default constructor.
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead...
Definition: ClpModel.hpp:875
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:1217
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1264
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:451
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:672
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:601
void setRowScale(double *scale)
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:950
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:495
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:374
unsigned char * statusCopy() const
Return copy of status (i.e.
void setColumnScale(double *scale)
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
const std::string & rowName(int iRow) const
Definition: ClpModel.hpp:1033
const double * inverseRowScale() const
Definition: ClpModel.hpp:652
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:814
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1244
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:539
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:905
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:768
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:1374
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:25
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1305
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:896
void chgColumnLower(const double *columnLower)
Change column lower bounds.
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1272
int getIterationCount() const
Definition: ClpModel.hpp:378
void unscale()
If we constructed a &quot;really&quot; scaled model then this reverses the operation.
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:1040
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:1307
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1309
Class for thread specific random numbers.
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1386
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:1354
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:745