Clp  1.17.8
ClpModel.hpp
Go to the documentation of this file.
1 /* $Id$ */
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);
143 private:
145  void synchronizeMatrix();
146 public:
148  void deleteRows(int number, const int *which);
150  void addRow(int numberInRow, const int *columns,
151  const double *elements, double rowLower = -COIN_DBL_MAX,
152  double rowUpper = COIN_DBL_MAX);
154  void addRows(int number, const double *rowLower,
155  const double *rowUpper,
156  const CoinBigIndex *rowStarts, const int *columns,
157  const double *elements);
159  void addRows(int number, const double *rowLower,
160  const double *rowUpper,
161  const CoinBigIndex *rowStarts, const int *rowLengths,
162  const int *columns,
163  const double *elements);
164 #ifndef CLP_NO_VECTOR
165  void addRows(int number, const double *rowLower,
166  const double *rowUpper,
167  const CoinPackedVectorBase *const *rows);
168 #endif
169 
174  int addRows(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
175  bool checkDuplicates = true);
184  int addRows(CoinModel &modelObject, bool tryPlusMinusOne = false,
185  bool checkDuplicates = true);
186 
188  void deleteColumns(int number, const int *which);
190  void deleteRowsAndColumns(int numberRows, const int *whichRows,
191  int numberColumns, const int *whichColumns);
193  void addColumn(int numberInColumn,
194  const int *rows,
195  const double *elements,
196  double columnLower = 0.0,
197  double columnUpper = COIN_DBL_MAX,
198  double objective = 0.0);
200  void addColumns(int number, const double *columnLower,
201  const double *columnUpper,
202  const double *objective,
203  const CoinBigIndex *columnStarts, const int *rows,
204  const double *elements);
205  void addColumns(int number, const double *columnLower,
206  const double *columnUpper,
207  const double *objective,
208  const CoinBigIndex *columnStarts, const int *columnLengths,
209  const int *rows,
210  const double *elements);
211 #ifndef CLP_NO_VECTOR
212  void addColumns(int number, const double *columnLower,
213  const double *columnUpper,
214  const double *objective,
215  const CoinPackedVectorBase *const *columns);
216 #endif
217 
222  int addColumns(const CoinBuild &buildObject, bool tryPlusMinusOne = false,
223  bool checkDuplicates = true);
231  int addColumns(CoinModel &modelObject, bool tryPlusMinusOne = false,
232  bool checkDuplicates = true);
234  inline void modifyCoefficient(int row, int column, double newElement,
235  bool keepZero = false)
236  {
237  matrix_->modifyCoefficient(row, column, newElement, keepZero);
238  }
240  void chgRowLower(const double *rowLower);
242  void chgRowUpper(const double *rowUpper);
244  void chgColumnLower(const double *columnLower);
246  void chgColumnUpper(const double *columnUpper);
248  void chgObjCoefficients(const double *objIn);
252  void borrowModel(ClpModel &otherModel);
255  void returnModel(ClpModel &otherModel);
256 
258  void createEmptyMatrix();
266  CoinBigIndex cleanMatrix(double threshold = 1.0e-20);
268  void copy(const ClpMatrixBase *from, ClpMatrixBase *&to);
269 #ifndef CLP_NO_STD
270  void dropNames();
273  void copyNames(const std::vector< std::string > &rowNames,
274  const std::vector< std::string > &columnNames);
276  void copyRowNames(const std::vector< std::string > &rowNames, int first, int last);
278  void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last);
280  void copyRowNames(const char *const *rowNames, int first, int last);
282  void copyColumnNames(const char *const *columnNames, int first, int last);
284  void setRowName(int rowIndex, std::string &name);
286  void setColumnName(int colIndex, std::string &name);
287 #endif
288 
295  int findNetwork(char *rotate, double fractionNeeded = 0.75);
298  CoinModel *createCoinModel() const;
299 
312  int writeMps(const char *filename,
313  int formatType = 0, int numberAcross = 2,
314  double objSense = 0.0) const;
316 
318  inline int numberRows() const
320  {
321  return numberRows_;
322  }
323  inline int getNumRows() const
324  {
325  return numberRows_;
326  }
328  inline int getNumCols() const
329  {
330  return numberColumns_;
331  }
332  inline int numberColumns() const
333  {
334  return numberColumns_;
335  }
337  inline double primalTolerance() const
338  {
340  }
341  void setPrimalTolerance(double value);
343  inline double dualTolerance() const
344  {
345  return dblParam_[ClpDualTolerance];
346  }
347  void setDualTolerance(double value);
349  inline double primalObjectiveLimit() const
350  {
352  }
353  void setPrimalObjectiveLimit(double value);
355  inline double dualObjectiveLimit() const
356  {
358  }
359  void setDualObjectiveLimit(double value);
361  inline double objectiveOffset() const
362  {
363  return dblParam_[ClpObjOffset];
364  }
365  void setObjectiveOffset(double value);
367  inline double presolveTolerance() const
368  {
370  }
371 #ifndef CLP_NO_STD
372  inline const std::string &problemName() const
373  {
374  return strParam_[ClpProbName];
375  }
376 #endif
377  inline int numberIterations() const
379  {
380  return numberIterations_;
381  }
382  inline int getIterationCount() const
383  {
384  return numberIterations_;
385  }
386  inline void setNumberIterations(int numberIterationsNew)
387  {
388  numberIterations_ = numberIterationsNew;
389  }
391  inline int solveType() const
392  {
393  return solveType_;
394  }
395  inline void setSolveType(int type)
396  {
397  solveType_ = type;
398  }
400  inline int maximumIterations() const
401  {
403  }
404  void setMaximumIterations(int value);
406  inline double maximumSeconds() const
407  {
408  return dblParam_[ClpMaxSeconds];
409  }
410  void setMaximumSeconds(double value);
411  void setMaximumWallSeconds(double value);
413  bool hitMaximumIterations() const;
423  inline int status() const
424  {
425  return problemStatus_;
426  }
427  inline int problemStatus() const
428  {
429  return problemStatus_;
430  }
432  inline void setProblemStatus(int problemStatusNew)
433  {
434  problemStatus_ = problemStatusNew;
435  }
452  inline int secondaryStatus() const
453  {
454  return secondaryStatus_;
455  }
456  inline void setSecondaryStatus(int newstatus)
457  {
458  secondaryStatus_ = newstatus;
459  }
461  inline bool isAbandoned() const
462  {
463  return problemStatus_ == 4;
464  }
466  inline bool isProvenOptimal() const
467  {
468  return problemStatus_ == 0;
469  }
471  inline bool isProvenPrimalInfeasible() const
472  {
473  return problemStatus_ == 1;
474  }
476  inline bool isProvenDualInfeasible() const
477  {
478  return problemStatus_ == 2;
479  }
481  bool isPrimalObjectiveLimitReached() const;
483  bool isDualObjectiveLimitReached() const;
485  inline bool isIterationLimitReached() const
486  {
487  return problemStatus_ == 3;
488  }
490  inline double optimizationDirection() const
491  {
492  return optimizationDirection_;
493  }
494  inline double getObjSense() const
495  {
496  return optimizationDirection_;
497  }
498  void setOptimizationDirection(double value);
500  inline double *primalRowSolution() const
501  {
502  return rowActivity_;
503  }
504  inline const double *getRowActivity() const
505  {
506  return rowActivity_;
507  }
509  inline double *primalColumnSolution() const
510  {
511  return columnActivity_;
512  }
513  inline const double *getColSolution() const
514  {
515  return columnActivity_;
516  }
517  inline void setColSolution(const double *input)
518  {
519  memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
520  }
522  inline double *dualRowSolution() const
523  {
524  return dual_;
525  }
526  inline const double *getRowPrice() const
527  {
528  return dual_;
529  }
531  inline double *dualColumnSolution() const
532  {
533  return reducedCost_;
534  }
535  inline const double *getReducedCost() const
536  {
537  return reducedCost_;
538  }
540  inline double *rowLower() const
541  {
542  return rowLower_;
543  }
544  inline const double *getRowLower() const
545  {
546  return rowLower_;
547  }
549  inline double *rowUpper() const
550  {
551  return rowUpper_;
552  }
553  inline const double *getRowUpper() const
554  {
555  return rowUpper_;
556  }
557  //-------------------------------------------------------------------------
561  void setObjectiveCoefficient(int elementIndex, double elementValue);
563  inline void setObjCoeff(int elementIndex, double elementValue)
564  {
565  setObjectiveCoefficient(elementIndex, elementValue);
566  }
567 
570  void setColumnLower(int elementIndex, double elementValue);
571 
574  void setColumnUpper(int elementIndex, double elementValue);
575 
577  void setColumnBounds(int elementIndex,
578  double lower, double upper);
579 
588  void setColumnSetBounds(const int *indexFirst,
589  const int *indexLast,
590  const double *boundList);
591 
594  inline void setColLower(int elementIndex, double elementValue)
595  {
596  setColumnLower(elementIndex, elementValue);
597  }
600  inline void setColUpper(int elementIndex, double elementValue)
601  {
602  setColumnUpper(elementIndex, elementValue);
603  }
604 
606  inline void setColBounds(int elementIndex,
607  double lower, double upper)
608  {
609  setColumnBounds(elementIndex, lower, upper);
610  }
611 
618  inline void setColSetBounds(const int *indexFirst,
619  const int *indexLast,
620  const double *boundList)
621  {
622  setColumnSetBounds(indexFirst, indexLast, boundList);
623  }
624 
627  void setRowLower(int elementIndex, double elementValue);
628 
631  void setRowUpper(int elementIndex, double elementValue);
632 
634  void setRowBounds(int elementIndex,
635  double lower, double upper);
636 
643  void setRowSetBounds(const int *indexFirst,
644  const int *indexLast,
645  const double *boundList);
646 
648  inline const double *rowScale() const
650  {
651  return rowScale_;
652  }
653  inline const double *columnScale() const
654  {
655  return columnScale_;
656  }
657  inline const double *inverseRowScale() const
658  {
659  return inverseRowScale_;
660  }
661  inline const double *inverseColumnScale() const
662  {
663  return inverseColumnScale_;
664  }
665  inline double *mutableRowScale() const
666  {
667  return rowScale_;
668  }
669  inline double *mutableColumnScale() const
670  {
671  return columnScale_;
672  }
673  inline double *mutableInverseRowScale() const
674  {
675  return inverseRowScale_;
676  }
677  inline double *mutableInverseColumnScale() const
678  {
679  return inverseColumnScale_;
680  }
681  inline double *swapRowScale(double *newScale)
682  {
683  double *oldScale = rowScale_;
684  rowScale_ = newScale;
685  return oldScale;
686  }
687  void setRowScale(double *scale);
688  void setColumnScale(double *scale);
690  inline double objectiveScale() const
691  {
692  return objectiveScale_;
693  }
694  inline void setObjectiveScale(double value)
695  {
696  objectiveScale_ = value;
697  }
699  inline double rhsScale() const
700  {
701  return rhsScale_;
702  }
703  inline void setRhsScale(double value)
704  {
705  rhsScale_ = value;
706  }
708  void scaling(int mode = 1);
711  void unscale();
713  inline int scalingFlag() const
714  {
715  return scalingFlag_;
716  }
718  inline double *objective() const
719  {
720  if (objective_) {
721  double offset;
722  return objective_->gradient(NULL, NULL, offset, false);
723  } else {
724  return NULL;
725  }
726  }
727  inline double *objective(const double *solution, double &offset, bool refresh = true) const
728  {
729  offset = 0.0;
730  if (objective_) {
731  return objective_->gradient(NULL, solution, offset, refresh);
732  } else {
733  return NULL;
734  }
735  }
736  inline const double *getObjCoefficients() const
737  {
738  if (objective_) {
739  double offset;
740  return objective_->gradient(NULL, NULL, offset, false);
741  } else {
742  return NULL;
743  }
744  }
746  inline double *rowObjective() const
747  {
748  return rowObjective_;
749  }
750  inline const double *getRowObjCoefficients() const
751  {
752  return rowObjective_;
753  }
755  inline double *columnLower() const
756  {
757  return columnLower_;
758  }
759  inline const double *getColLower() const
760  {
761  return columnLower_;
762  }
764  inline double *columnUpper() const
765  {
766  return columnUpper_;
767  }
768  inline const double *getColUpper() const
769  {
770  return columnUpper_;
771  }
773  inline CoinPackedMatrix *matrix() const
774  {
775  if (matrix_ == NULL)
776  return NULL;
777  else
778  return matrix_->getPackedMatrix();
779  }
781  inline CoinBigIndex getNumElements() const
782  {
783  return matrix_->getNumElements();
784  }
787  inline double getSmallElementValue() const
788  {
789  return smallElement_;
790  }
791  inline void setSmallElementValue(double value)
792  {
793  smallElement_ = value;
794  }
796  inline ClpMatrixBase *rowCopy() const
797  {
798  return rowCopy_;
799  }
801  void setNewRowCopy(ClpMatrixBase *newCopy);
803  inline ClpMatrixBase *clpMatrix() const
804  {
805  return matrix_;
806  }
809  {
810  return scaledMatrix_;
811  }
813  inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
814  {
815  delete scaledMatrix_;
816  scaledMatrix_ = scaledMatrix;
817  }
820  {
821  ClpPackedMatrix *oldMatrix = scaledMatrix_;
822  scaledMatrix_ = scaledMatrix;
823  return oldMatrix;
824  }
830  void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent = false);
836  inline void replaceMatrix(CoinPackedMatrix *newmatrix,
837  bool deleteCurrent = false)
838  {
839  replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
840  }
842  inline double objectiveValue() const
843  {
845  }
846  inline void setObjectiveValue(double value)
847  {
849  }
850  inline double getObjValue() const
851  {
853  }
855  inline char *integerInformation() const
856  {
857  return integerType_;
858  }
861  double *infeasibilityRay(bool fullRay = false) const;
862  double *unboundedRay() const;
864  inline double *ray() const
865  {
866  return ray_;
867  }
869  inline bool rayExists() const
870  {
871  return (ray_ != NULL);
872  }
874  inline void deleteRay()
875  {
876  delete[] ray_;
877  ray_ = NULL;
878  }
880  inline const double *internalRay() const
881  {
882  return ray_;
883  }
885  inline bool statusExists() const
886  {
887  return (status_ != NULL);
888  }
890  inline unsigned char *statusArray() const
891  {
892  return status_;
893  }
896  unsigned char *statusCopy() const;
898  void copyinStatus(const unsigned char *statusArray);
899 
901  inline void setUserPointer(void *pointer)
902  {
903  userPointer_ = pointer;
904  }
905  inline void *getUserPointer() const
906  {
907  return userPointer_;
908  }
910  inline void setTrustedUserPointer(ClpTrustedData *pointer)
911  {
912  trustedUserPointer_ = pointer;
913  }
915  {
916  return trustedUserPointer_;
917  }
919  inline int whatsChanged() const
920  {
921  return whatsChanged_;
922  }
923  inline void setWhatsChanged(int value)
924  {
925  whatsChanged_ = value;
926  }
928  inline int numberThreads() const
929  {
930  return numberThreads_;
931  }
932  inline void setNumberThreads(int value)
933  {
934  numberThreads_ = value;
935  }
937 
939  void passInMessageHandler(CoinMessageHandler *handler);
942  CoinMessageHandler *pushMessageHandler(CoinMessageHandler *handler,
943  bool &oldDefault);
945  void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault);
947  void newLanguage(CoinMessages::Language language);
948  inline void setLanguage(CoinMessages::Language language)
949  {
950  newLanguage(language);
951  }
955  inline CoinMessageHandler *messageHandler() const
956  {
957  return handler_;
958  }
960  inline CoinMessages messages() const
961  {
962  return messages_;
963  }
965  inline CoinMessages *messagesPointer()
966  {
967  return &messages_;
968  }
970  inline CoinMessages coinMessages() const
971  {
972  return coinMessages_;
973  }
975  inline CoinMessages *coinMessagesPointer()
976  {
977  return &coinMessages_;
978  }
987  inline void setLogLevel(int value)
988  {
989  handler_->setLogLevel(value);
990  }
991  inline int logLevel() const
992  {
993  return handler_->logLevel();
994  }
996  inline bool defaultHandler() const
997  {
998  return defaultHandler_;
999  }
1004  {
1005  return eventHandler_;
1006  }
1008  inline CoinThreadRandom *randomNumberGenerator()
1009  {
1010  return &randomNumberGenerator_;
1011  }
1013  inline CoinThreadRandom &mutableRandomNumberGenerator()
1014  {
1015  return randomNumberGenerator_;
1016  }
1018  inline void setRandomSeed(int value)
1019  {
1020  randomNumberGenerator_.setSeed(value);
1021  }
1023  inline int lengthNames() const
1024  {
1025  return lengthNames_;
1026  }
1027 #ifndef CLP_NO_STD
1028  inline void setLengthNames(int value)
1030  {
1031  lengthNames_ = value;
1032  }
1034  inline const std::vector< std::string > *rowNames() const
1035  {
1036  return &rowNames_;
1037  }
1038  inline const std::string &rowName(int iRow) const
1039  {
1040  return rowNames_[iRow];
1041  }
1043  std::string getRowName(int iRow) const;
1045  inline const std::vector< std::string > *columnNames() const
1046  {
1047  return &columnNames_;
1048  }
1049  inline const std::string &columnName(int iColumn) const
1050  {
1051  return columnNames_[iColumn];
1052  }
1054  std::string getColumnName(int iColumn) const;
1055 #endif
1056  inline ClpObjective *objectiveAsObject() const
1058  {
1059  return objective_;
1060  }
1062  inline void setObjectivePointer(ClpObjective *newobjective)
1063  {
1064  objective_ = newobjective;
1065  }
1068  int emptyProblem(int *infeasNumber = NULL, double *infeasSum = NULL, bool printMessage = true);
1069 
1071 
1080  void times(double scalar,
1081  const double *x, double *y) const;
1085  void transposeTimes(double scalar,
1086  const double *x, double *y) const;
1088 
1089  //---------------------------------------------------------------------------
1107  bool setIntParam(ClpIntParam key, int value);
1110  bool setDblParam(ClpDblParam key, double value);
1111 #ifndef CLP_NO_STD
1112  bool setStrParam(ClpStrParam key, const std::string &value);
1114 #endif
1115  // Get an integer parameter
1116  inline bool getIntParam(ClpIntParam key, int &value) const
1117  {
1118  if (key < ClpLastIntParam) {
1119  value = intParam_[key];
1120  return true;
1121  } else {
1122  return false;
1123  }
1124  }
1125  // Get an double parameter
1126  inline bool getDblParam(ClpDblParam key, double &value) const
1127  {
1128  if (key < ClpLastDblParam) {
1129  value = dblParam_[key];
1130  return true;
1131  } else {
1132  return false;
1133  }
1134  }
1135 #ifndef CLP_NO_STD
1136  // Get a string parameter
1137  inline bool getStrParam(ClpStrParam key, std::string &value) const
1138  {
1139  if (key < ClpLastStrParam) {
1140  value = strParam_[key];
1141  return true;
1142  } else {
1143  return false;
1144  }
1145  }
1146 #endif
1147  void generateCpp(FILE *fp);
1185  inline unsigned int specialOptions() const
1186  {
1187  return specialOptions_;
1188  }
1189  void setSpecialOptions(unsigned int value);
1190 #define COIN_CBC_USING_CLP 0x01000000
1191  inline bool inCbcBranchAndBound() const
1192  {
1193  return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1194  }
1196 
1199 protected:
1201  void gutsOfDelete(int type);
1205  void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1207  void getRowBound(int iRow, double &lower, double &upper) const;
1210  const double *collb, const double *colub,
1211  const double *obj,
1212  const double *rowlb, const double *rowub,
1213  const double *rowObjective = NULL);
1215  void gutsOfScaling();
1217  inline double rawObjectiveValue() const
1218  {
1219  return objectiveValue_;
1220  }
1222  inline bool permanentArrays() const
1223  {
1224  return (specialOptions_ & 65536) != 0;
1225  }
1227  void startPermanentArrays();
1229  void stopPermanentArrays();
1231  const char *const *rowNamesAsChar() const;
1233  const char *const *columnNamesAsChar() const;
1235  void deleteNamesAsChar(const char *const *names, int number) const;
1237  void onStopped();
1239 
1241 protected:
1244  double optimizationDirection_;
1255  double rhsScale_;
1261  double *rowActivity_;
1265  double *dual_;
1267  double *reducedCost_;
1269  double *rowLower_;
1271  double *rowUpper_;
1275  double *rowObjective_;
1277  double *columnLower_;
1279  double *columnUpper_;
1287  double *ray_;
1289  double *rowScale_;
1291  double *columnScale_;
1306  unsigned char *status_;
1335 #define ROW_COLUMN_COUNTS_SAME 1
1336 #define MATRIX_SAME 2
1337 #define MATRIX_JUST_ROWS_ADDED 4
1338 #define MATRIX_JUST_COLUMNS_ADDED 8
1339 #define ROW_LOWER_SAME 16
1340 #define ROW_UPPER_SAME 32
1341 #define OBJECTIVE_SAME 64
1342 #define COLUMN_LOWER_SAME 128
1343 #define COLUMN_UPPER_SAME 256
1344 #define BASIS_SAME 512
1345 #define ALL_SAME 65339
1346 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1347  unsigned int whatsChanged_;
1359  unsigned int specialOptions_;
1361  CoinMessageHandler *handler_;
1365  CoinThreadRandom randomNumberGenerator_;
1368 #ifndef CLP_NO_STD
1369  std::vector< std::string > rowNames_;
1372  std::vector< std::string > columnNames_;
1373 #endif
1374  CoinMessages messages_;
1377  CoinMessages coinMessages_;
1387  CoinPackedMatrix baseMatrix_;
1389  CoinPackedMatrix baseRowCopy_;
1394 #ifndef CLP_NO_STD
1395  std::string strParam_[ClpLastStrParam];
1397 #endif
1398 
1399 };
1403 
1404 public:
1408  ClpDataSave();
1410 
1412  ClpDataSave(const ClpDataSave &);
1414  ClpDataSave &operator=(const ClpDataSave &rhs);
1416  ~ClpDataSave();
1417 
1419 
1421 public:
1424  double dualBound_;
1435  unsigned int specialOptions_;
1437 };
1438 
1439 #endif
1440 
1441 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1442 */
ClpModel::deleteRay
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:874
ClpModel::columnLower
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:755
ClpModel::setProblemStatus
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:432
ClpModel::getDblParam
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:1126
ClpModel::loadQuadraticObjective
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
Load up quadratic objective.
ClpModel::getRowPrice
const double * getRowPrice() const
Definition: ClpModel.hpp:526
ClpModel::swapRowScale
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:681
ClpModel::getNumCols
int getNumCols() const
Number of columns.
Definition: ClpModel.hpp:328
ClpObjOffset
@ ClpObjOffset
Objective function constant.
Definition: ClpParameters.hpp:60
ClpModel::inverseColumnScale_
double * inverseColumnScale_
Inverse column scale factors for matrix (end of columnScale_)
Definition: ClpModel.hpp:1295
ClpModel::getRowName
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
ClpModel::copyColumnNames
void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
ClpModel::chgObjCoefficients
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
ClpModel::messagesPointer
CoinMessages * messagesPointer()
Return pointer to messages.
Definition: ClpModel.hpp:965
ClpModel::setUserPointer
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:901
ClpModel::columnNames
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:1045
ClpModel::setColLower
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition: ClpModel.hpp:594
ClpModel::emptyProblem
int emptyProblem(int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
Solve a problem with no elements - return status and dual and primal infeasibilites.
ClpModel::numberIterations_
int numberIterations_
Number of iterations.
Definition: ClpModel.hpp:1316
ClpModel::getNumElements
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:781
ClpModel::copyinStatus
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
ClpModel::resize
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
ClpModel::columnUpper_
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1279
ClpModel::setObjective
void setObjective(ClpObjective *objective)
ClpModel::lengthNames_
int lengthNames_
length of names (0 means no names)
Definition: ClpModel.hpp:1353
ClpModel::getNumRows
int getNumRows() const
Definition: ClpModel.hpp:323
ClpModel::deleteRows
void deleteRows(int number, const int *which)
Deletes rows.
ClpModel::rowNamesAsChar
const char *const * rowNamesAsChar() const
Create row names as char **.
ClpParameters.hpp
ClpModel::gutsOfScaling
void gutsOfScaling()
Does much of scaling.
ClpModel::solveType
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:391
ClpModel::rowObjective_
double * rowObjective_
Row Objective (? sign) - may be NULL.
Definition: ClpModel.hpp:1275
COIN_CBC_USING_CLP
#define COIN_CBC_USING_CLP
Definition: ClpModel.hpp:1190
ClpModel::dual_
double * dual_
Duals.
Definition: ClpModel.hpp:1265
ClpModel::deleteRowsAndColumns
void deleteRowsAndColumns(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Deletes rows AND columns (keeps old sizes)
ClpModel::primalTolerance
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:337
ClpModel::rowLower
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:540
ClpModel::columnName
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:1049
ClpModel::setObjectiveOffset
void setObjectiveOffset(double value)
ClpModel::eventHandler_
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1367
ClpModel::addColumns
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
Add columns.
ClpModel::rowScale_
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1289
ClpModel::rowObjective
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:746
ClpModel::columnLower_
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1277
ClpModel::gutsOfCopy
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.
ClpModel::setRowSetBounds
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
ClpModel::maximumRows_
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1381
ClpModel::setColumnSetBounds
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...
ClpModel::setColBounds
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:606
ClpDataSave::operator=
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1402
ClpModel::setSolveType
void setSolveType(int type)
Definition: ClpModel.hpp:395
ClpPrimalObjectiveLimit
@ ClpPrimalObjectiveLimit
Primal objective limit.
Definition: ClpParameters.hpp:51
ClpModel::rayExists
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:869
ClpModel::status
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:423
ClpModel::objectiveOffset
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:361
ClpModel::setColumnScale
void setColumnScale(double *scale)
ClpModel::setRowScale
void setRowScale(double *scale)
ClpModel::passInEventHandler
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
ClpModel::columnNames_
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1372
ClpModel::setWhatsChanged
void setWhatsChanged(int value)
Definition: ClpModel.hpp:923
ClpModel::setLanguage
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:948
ClpModel::columnScale
const double * columnScale() const
Definition: ClpModel.hpp:653
ClpModel::permanentArrays
bool permanentArrays() const
If we are using maximumRows_ and Columns_.
Definition: ClpModel.hpp:1222
ClpModel::setClpScaledMatrix
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:813
ClpModel::setLogLevel
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:987
ClpModel::setObjectivePointer
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:1062
ClpModel::deleteColumns
void deleteColumns(int number, const int *which)
Deletes columns.
ClpModel::synchronizeMatrix
void synchronizeMatrix()
Makes sure matrix dimensions are at least model dimensions.
ClpModel::baseRowCopy_
CoinPackedMatrix baseRowCopy_
Base row copy.
Definition: ClpModel.hpp:1389
ClpTrustedData
For a structure to be used by trusted code.
Definition: ClpParameters.hpp:124
ClpObjective
Objective Abstract Base Class.
Definition: ClpObjective.hpp:18
ClpModel::scaling
void scaling(int mode=1)
Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab...
ClpModel::chgRowLower
void chgRowLower(const double *rowLower)
Change row lower bounds.
ClpModel::returnModel
void returnModel(ClpModel &otherModel)
Return model - nulls all arrays so can be deleted safely also updates any scalars.
ClpModel::rowCopy
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:796
ClpModel::getColLower
const double * getColLower() const
Definition: ClpModel.hpp:759
ClpDblParam
ClpDblParam
Definition: ClpParameters.hpp:43
ClpModel::setObjCoeff
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:563
ClpModel::deleteIntegerInformation
void deleteIntegerInformation()
Drop integer informations.
ClpModel::rowScale
const double * rowScale() const
Scaling.
Definition: ClpModel.hpp:649
ClpModel::rowActivity_
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1261
ClpModel::messages_
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1375
ClpModel::setSecondaryStatus
void setSecondaryStatus(int newstatus)
Definition: ClpModel.hpp:456
ClpModel::matrix
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:773
ClpModel::isProvenDualInfeasible
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:476
ClpLastDblParam
@ ClpLastDblParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:69
ClpModel::inverseRowScale
const double * inverseRowScale() const
Definition: ClpModel.hpp:657
ClpModel::setObjectiveValue
void setObjectiveValue(double value)
Definition: ClpModel.hpp:846
ClpModel::dualTolerance
double dualTolerance() const
Dual tolerance to use.
Definition: ClpModel.hpp:343
ClpModel::objectiveScale
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:690
ClpProbName
@ ClpProbName
Name of the problem.
Definition: ClpParameters.hpp:75
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:864
ClpModel::startPermanentArrays
void startPermanentArrays()
Start using maximumRows_ and Columns_.
ClpModel::addRow
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
Add one row.
ClpModel::userPointer_
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1310
ClpModel
Definition: ClpModel.hpp:38
ClpModel::getReducedCost
const double * getReducedCost() const
Definition: ClpModel.hpp:535
ClpModel::setColumnBounds
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
ClpModel::isDualObjectiveLimitReached
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
ClpModel::chgColumnUpper
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
ClpModel::getRowLower
const double * getRowLower() const
Definition: ClpModel.hpp:544
ClpModel::integerType_
char * integerType_
Integer information.
Definition: ClpModel.hpp:1308
ClpModel::infeasibilityRay
double * infeasibilityRay(bool fullRay=false) const
Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays...
ClpDataSave::perturbation_
int perturbation_
Definition: ClpModel.hpp:1432
ClpModel::objective
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:727
ClpModel::isProvenPrimalInfeasible
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:471
ClpModel::getRowUpper
const double * getRowUpper() const
Definition: ClpModel.hpp:553
ClpModel::~ClpModel
~ClpModel()
Destructor.
ClpDataSave::sparseThreshold_
int sparseThreshold_
Definition: ClpModel.hpp:1431
ClpModel::mutableRowScale
double * mutableRowScale() const
Definition: ClpModel.hpp:665
ClpModel::ray_
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1287
ClpModel::copyInIntegerInformation
void copyInIntegerInformation(const char *information)
Copy in integer informations.
ClpModel::mutableColumnScale
double * mutableColumnScale() const
Definition: ClpModel.hpp:669
ClpModel::optimizationDirection_
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1245
ClpModel::loadProblem
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).
ClpModel::addRows
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
Add rows.
ClpModel::popMessageHandler
void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault)
back to previous message handler
ClpPackedMatrix
Definition: ClpPackedMatrix.hpp:23
ClpModel::generateCpp
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
ClpModel::ClpModel
ClpModel(bool emptyMessages=false)
Default constructor.
ClpMatrixBase::modifyCoefficient
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
ClpPresolveTolerance
@ ClpPresolveTolerance
Tolerance to use in presolve.
Definition: ClpParameters.hpp:66
ClpModel::onStopped
void onStopped()
On stopped - sets secondary status.
ClpModel::setColSetBounds
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
Definition: ClpModel.hpp:618
ClpModel::inCbcBranchAndBound
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1191
ClpModel::primalObjectiveLimit
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:349
ClpModel::problemStatus_
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1349
ClpModel::numberThreads
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:928
ClpLastStrParam
@ ClpLastStrParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:78
ClpModel::getStrParam
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1137
ClpDataSave::zeroSimplexTolerance_
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1428
ClpModel::borrowModel
void borrowModel(ClpModel &otherModel)
Borrow model.
ClpModel::messages
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:960
ClpModel::maximumSeconds
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:406
ClpModel::setRowObjective
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
ClpModel::clpMatrix
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:803
ClpModel::findNetwork
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
ClpModel::rowCopy_
ClpMatrixBase * rowCopy_
Row copy if wanted.
Definition: ClpModel.hpp:1283
ClpModel::maximumInternalRows_
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1385
ClpModel::unscale
void unscale()
If we constructed a "really" scaled model then this reverses the operation.
ClpModel::newLanguage
void newLanguage(CoinMessages::Language language)
Set language.
ClpModel::strParam_
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1396
ClpModel::rowUpper
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:549
ClpDataSave::specialOptions_
unsigned int specialOptions_
Definition: ClpModel.hpp:1435
ClpModel::setContinuous
void setContinuous(int index)
Set the index-th variable to be a continuous variable.
ClpModel::maximumInternalColumns_
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1383
ClpDataSave::acceptablePivot_
double acceptablePivot_
Definition: ClpModel.hpp:1429
ClpModel::hitMaximumIterations
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
ClpModel::isProvenOptimal
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:466
ClpModel::setDualTolerance
void setDualTolerance(double value)
ClpModel::setInteger
void setInteger(int index)
Set the index-th variable to be an integer variable.
ClpModel::unboundedRay
double * unboundedRay() const
ClpModel::internalRay
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
Definition: ClpModel.hpp:880
ClpModel::setDualObjectiveLimit
void setDualObjectiveLimit(double value)
ClpModel::stopPermanentArrays
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
ClpModel::problemStatus
int problemStatus() const
Definition: ClpModel.hpp:427
ClpPrimalTolerance
@ ClpPrimalTolerance
The maximum amount the primal constraints can be violated and still be considered feasible.
Definition: ClpParameters.hpp:57
ClpModel::dualRowSolution
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:522
ClpModel::solveType_
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1318
ClpModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:490
ClpModel::modifyCoefficient
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition: ClpModel.hpp:234
ClpModel::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1259
ClpModel::setRowName
void setRowName(int rowIndex, std::string &name)
Set name of row.
ClpModel::setLengthNames
void setLengthNames(int value)
length of names (0 means no names0
Definition: ClpModel.hpp:1029
ClpModel::rowName
const std::string & rowName(int iRow) const
Definition: ClpModel.hpp:1038
ClpModel::pushMessageHandler
CoinMessageHandler * pushMessageHandler(CoinMessageHandler *handler, bool &oldDefault)
Pass in Message handler (not deleted at end) and return current.
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpModel::getObjSense
double getObjSense() const
Definition: ClpModel.hpp:494
ClpModel::setPrimalTolerance
void setPrimalTolerance(double value)
ClpModel::gutsOfDelete
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most)
ClpModel::inverseRowScale_
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
Definition: ClpModel.hpp:1293
ClpModel::objectiveAsObject
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:1057
ClpModel::getColUpper
const double * getColUpper() const
Definition: ClpModel.hpp:768
ClpModel::statusExists
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition: ClpModel.hpp:885
ClpDataSave::objectiveScale_
double objectiveScale_
Definition: ClpModel.hpp:1430
ClpModel::createCoinModel
CoinModel * createCoinModel() const
This creates a coinModel object.
ClpModel::rowNames_
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1370
ClpModel::getUserPointer
void * getUserPointer() const
Definition: ClpModel.hpp:905
ClpModel::setMaximumIterations
void setMaximumIterations(int value)
ClpModel::trustedUserPointer_
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
Definition: ClpModel.hpp:1312
ClpModel::intParam_
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1314
ClpModel::objectiveValue_
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1249
ClpModel::createEmptyMatrix
void createEmptyMatrix()
Create empty ClpPackedMatrix.
ClpModel::readGMPL
int readGMPL(const char *filename, const char *dataName, bool keepNames=false)
Read GMPL files from the given filenames.
ClpModel::isIterationLimitReached
bool isIterationLimitReached() const
Iteration limit reached?
Definition: ClpModel.hpp:485
ClpModel::getColumnName
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpModel::objective_
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1273
ClpModel::setColSolution
void setColSolution(const double *input)
Definition: ClpModel.hpp:517
ClpModel::setMaximumWallSeconds
void setMaximumWallSeconds(double value)
ClpModel::maximumIterations
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:400
ClpModel::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpIntParam
ClpIntParam
This is where to put any useful stuff.
Definition: ClpParameters.hpp:12
ClpModel::inverseColumnScale
const double * inverseColumnScale() const
Definition: ClpModel.hpp:661
ClpModel::problemName
const std::string & problemName() const
Definition: ClpModel.hpp:372
ClpModel::whatsChanged_
unsigned int whatsChanged_
Definition: ClpModel.hpp:1347
ClpModel::setSmallElementValue
void setSmallElementValue(double value)
Definition: ClpModel.hpp:791
ClpMaxNumIteration
@ ClpMaxNumIteration
The maximum number of iterations Clp can execute in the simplex methods.
Definition: ClpParameters.hpp:15
ClpModel::getObjValue
double getObjValue() const
Definition: ClpModel.hpp:850
ClpModel::statusArray
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:890
ClpModel::columnScale_
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1291
ClpModel::primalColumnSolution
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:509
ClpModel::specialOptions
unsigned int specialOptions() const
For advanced options 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1185
ClpModel::isPrimalObjectiveLimitReached
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
ClpModel::copyNames
void copyNames(const std::vector< std::string > &rowNames, const std::vector< std::string > &columnNames)
Copies in names.
ClpModel::secondaryStatus
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition: ClpModel.hpp:452
ClpModel::writeMps
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.
ClpMaxSeconds
@ ClpMaxSeconds
Maximum time in seconds - after, this action is as max iterations.
Definition: ClpParameters.hpp:62
ClpModel::rowNames
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:1034
ClpModel::numberThreads_
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1355
ClpDataSave::pivotTolerance_
double pivotTolerance_
Definition: ClpModel.hpp:1426
ClpModel::chgColumnLower
void chgColumnLower(const double *columnLower)
Change column lower bounds.
ClpModel::rhsScale
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:699
ClpMatrixBase::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const =0
Return a complete CoinPackedMatrix.
ClpModel::cleanMatrix
CoinBigIndex cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
ClpModel::defaultHandler
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:996
ClpModel::setColumnName
void setColumnName(int colIndex, std::string &name)
Set name of col.
ClpModel::handler_
CoinMessageHandler * handler_
Message handler.
Definition: ClpModel.hpp:1361
ClpModel::setDblParam
bool setDblParam(ClpDblParam key, double value)
Set an double parameter.
ClpModel::dualColumnSolution
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:531
ClpModel::setOptimizationDirection
void setOptimizationDirection(double value)
ClpModel::setMaximumSeconds
void setMaximumSeconds(double value)
ClpConfig.h
ClpModel::copy
void copy(const ClpMatrixBase *from, ClpMatrixBase *&to)
Copy contents - resizing if necessary - otherwise re-use memory.
ClpModel::objectiveValue
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:842
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:378
ClpModel::getTrustedUserPointer
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:914
ClpModel::whatsChanged
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:919
ClpModel::setNewRowCopy
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
ClpModel::presolveTolerance
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:367
ClpDualObjectiveLimit
@ ClpDualObjectiveLimit
Set Dual objective limit.
Definition: ClpParameters.hpp:47
ClpModel::getRowObjCoefficients
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:750
ClpModel::rowLower_
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1269
ClpModel::scaledMatrix_
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1285
ClpModel::objective
double * objective() const
Objective.
Definition: ClpModel.hpp:718
ClpModel::mutableRandomNumberGenerator
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1013
ClpModel::messageHandler
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:955
ClpObjective.hpp
ClpModel::status_
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1306
ClpModel::reducedCost_
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1267
ClpModel::isInteger
bool isInteger(int index) const
Return true if the index-th variable is an integer variable.
ClpModel::getIntParam
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:1116
ClpDataSave::forceFactorization_
int forceFactorization_
Definition: ClpModel.hpp:1433
ClpModel::integerInformation
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:855
ClpModel::rhsScale_
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1255
ClpModel::mutableInverseColumnScale
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:677
ClpModel::rawObjectiveValue
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1217
ClpModel::baseMatrix_
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1387
ClpModel::getSmallElementValue
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition: ClpModel.hpp:787
ClpModel::specialOptions_
unsigned int specialOptions_
For advanced options See get and set for meaning.
Definition: ClpModel.hpp:1359
ClpDualTolerance
@ ClpDualTolerance
The maximum amount the dual constraints can be violated and still be considered feasible.
Definition: ClpParameters.hpp:54
ClpModel::scalingFlag_
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows.
Definition: ClpModel.hpp:1298
ClpModel::columnUpper
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:764
ClpModel::setRowBounds
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
ClpDataSave::~ClpDataSave
~ClpDataSave()
Destructor.
ClpModel::defaultHandler_
bool defaultHandler_
Flag to say if default handler (so delete)
Definition: ClpModel.hpp:1363
ClpModel::copyRowNames
void copyRowNames(const std::vector< std::string > &rowNames, int first, int last)
Copies in Row names - modifies names first .. last-1.
ClpModel::swapScaledMatrix
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:819
ClpModel::setIntParam
bool setIntParam(ClpIntParam key, int value)
Set an integer parameter.
ClpModel::gutsOfLoadModel
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
ClpModel::eventHandler
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:1003
ClpEventHandler
Base class for Clp event handling.
Definition: ClpEventHandler.hpp:27
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:332
ClpDataSave::dualBound_
double dualBound_
Definition: ClpModel.hpp:1424
ClpModel::savedColumnScale_
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1393
ClpModel::setDefaultMessageHandler
void setDefaultMessageHandler()
Overrides message handler with a default one.
ClpDataSave::ClpDataSave
ClpDataSave()
Default constructor.
ClpPackedMatrix.hpp
ClpModel::matrix_
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1281
ClpModel::columnNamesAsChar
const char *const * columnNamesAsChar() const
Create column names as char **.
ClpModel::setObjectiveCoefficient
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
ClpModel::clpScaledMatrix
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:808
ClpModel::setColumnUpper
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
ClpModel::getRowBound
void getRowBound(int iRow, double &lower, double &upper) const
gets lower and upper bounds on rows
ClpModel::setNumberIterations
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:386
ClpModel::coinMessages_
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1377
ClpModel::primalRowSolution
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:500
ClpModel::lengthNames
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:1023
ClpModel::randomNumberGenerator
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1008
ClpModel::objectiveScale_
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1253
ClpModel::scalingFlag
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:713
ClpModel::operator=
ClpModel & operator=(const ClpModel &rhs)
Assignment operator. This copies the data.
ClpModel::replaceMatrix
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...
ClpModel::setRandomSeed
void setRandomSeed(int value)
Set seed for thread specific random number generator.
Definition: ClpModel.hpp:1018
ClpModel::setObjectiveScale
void setObjectiveScale(double value)
Definition: ClpModel.hpp:694
ClpModel::randomNumberGenerator_
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1365
ClpModel::mutableInverseRowScale
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:673
ClpModel::smallElement_
double smallElement_
Small element value.
Definition: ClpModel.hpp:1251
ClpMatrixBase::getNumElements
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
ClpModel::getIterationCount
int getIterationCount() const
Definition: ClpModel.hpp:382
ClpModel::logLevel
int logLevel() const
Definition: ClpModel.hpp:991
ClpModel::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
ClpModel::readMps
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
ClpModel::addColumn
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.
ClpDataSave::infeasibilityCost_
double infeasibilityCost_
Definition: ClpModel.hpp:1425
ClpModel::getRowActivity
const double * getRowActivity() const
Definition: ClpModel.hpp:504
ClpObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
ClpModel::replaceMatrix
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:836
ClpModel::maximumColumns_
int maximumColumns_
Maximum number of columns in model.
Definition: ClpModel.hpp:1379
ClpModel::setPrimalObjectiveLimit
void setPrimalObjectiveLimit(double value)
ClpModel::statusCopy
unsigned char * statusCopy() const
Return copy of status (i.e.
ClpModel::setRhsScale
void setRhsScale(double value)
Definition: ClpModel.hpp:703
ClpModel::setSpecialOptions
void setSpecialOptions(unsigned int value)
ClpModel::numberRows_
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1257
ClpModel::setStrParam
bool setStrParam(ClpStrParam key, const std::string &value)
Set an string parameter.
ClpModel::setNumberThreads
void setNumberThreads(int value)
Definition: ClpModel.hpp:932
ClpDataSave::scalingFlag_
int scalingFlag_
Definition: ClpModel.hpp:1434
ClpModel::coinMessagesPointer
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:975
ClpModel::times
void times(double scalar, const double *x, double *y) const
Return y + A * x * scalar in y.
ClpModel::setRowLower
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
ClpModel::coinMessages
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:970
ClpModel::secondaryStatus_
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1351
ClpModel::chgRowUpper
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:319
ClpModel::setTrustedUserPointer
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition: ClpModel.hpp:910
ClpModel::columnActivity_
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1263
ClpModel::deleteNamesAsChar
void deleteNamesAsChar(const char *const *names, int number) const
Delete char * version of names.
ClpModel::transposeTimes
void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpModel::savedRowScale_
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1391
ClpModel::rowUpper_
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1271
ClpModel::getObjCoefficients
const double * getObjCoefficients() const
Definition: ClpModel.hpp:736
ClpModel::setColumnLower
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
ClpModel::getColSolution
const double * getColSolution() const
Definition: ClpModel.hpp:513
ClpDataSave::zeroFactorizationTolerance_
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1427
ClpModel::isAbandoned
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:461
ClpModel::dropNames
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpModel::dblParam_
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1247
ClpModel::setColUpper
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition: ClpModel.hpp:600
ClpModel::dualObjectiveLimit
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:355
ClpStrParam
ClpStrParam
Definition: ClpParameters.hpp:72
ClpLastIntParam
@ ClpLastIntParam
Just a marker, so that we can allocate a static sized array to store parameters.
Definition: ClpParameters.hpp:40
ClpModel::setRowUpper
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.