Clp  1.17.6
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  }
451  inline int secondaryStatus() const
452  {
453  return secondaryStatus_;
454  }
455  inline void setSecondaryStatus(int newstatus)
456  {
457  secondaryStatus_ = newstatus;
458  }
460  inline bool isAbandoned() const
461  {
462  return problemStatus_ == 4;
463  }
465  inline bool isProvenOptimal() const
466  {
467  return problemStatus_ == 0;
468  }
470  inline bool isProvenPrimalInfeasible() const
471  {
472  return problemStatus_ == 1;
473  }
475  inline bool isProvenDualInfeasible() const
476  {
477  return problemStatus_ == 2;
478  }
480  bool isPrimalObjectiveLimitReached() const;
482  bool isDualObjectiveLimitReached() const;
484  inline bool isIterationLimitReached() const
485  {
486  return problemStatus_ == 3;
487  }
489  inline double optimizationDirection() const
490  {
491  return optimizationDirection_;
492  }
493  inline double getObjSense() const
494  {
495  return optimizationDirection_;
496  }
497  void setOptimizationDirection(double value);
499  inline double *primalRowSolution() const
500  {
501  return rowActivity_;
502  }
503  inline const double *getRowActivity() const
504  {
505  return rowActivity_;
506  }
508  inline double *primalColumnSolution() const
509  {
510  return columnActivity_;
511  }
512  inline const double *getColSolution() const
513  {
514  return columnActivity_;
515  }
516  inline void setColSolution(const double *input)
517  {
518  memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
519  }
521  inline double *dualRowSolution() const
522  {
523  return dual_;
524  }
525  inline const double *getRowPrice() const
526  {
527  return dual_;
528  }
530  inline double *dualColumnSolution() const
531  {
532  return reducedCost_;
533  }
534  inline const double *getReducedCost() const
535  {
536  return reducedCost_;
537  }
539  inline double *rowLower() const
540  {
541  return rowLower_;
542  }
543  inline const double *getRowLower() const
544  {
545  return rowLower_;
546  }
548  inline double *rowUpper() const
549  {
550  return rowUpper_;
551  }
552  inline const double *getRowUpper() const
553  {
554  return rowUpper_;
555  }
556  //-------------------------------------------------------------------------
560  void setObjectiveCoefficient(int elementIndex, double elementValue);
562  inline void setObjCoeff(int elementIndex, double elementValue)
563  {
564  setObjectiveCoefficient(elementIndex, elementValue);
565  }
566 
569  void setColumnLower(int elementIndex, double elementValue);
570 
573  void setColumnUpper(int elementIndex, double elementValue);
574 
576  void setColumnBounds(int elementIndex,
577  double lower, double upper);
578 
587  void setColumnSetBounds(const int *indexFirst,
588  const int *indexLast,
589  const double *boundList);
590 
593  inline void setColLower(int elementIndex, double elementValue)
594  {
595  setColumnLower(elementIndex, elementValue);
596  }
599  inline void setColUpper(int elementIndex, double elementValue)
600  {
601  setColumnUpper(elementIndex, elementValue);
602  }
603 
605  inline void setColBounds(int elementIndex,
606  double lower, double upper)
607  {
608  setColumnBounds(elementIndex, lower, upper);
609  }
610 
617  inline void setColSetBounds(const int *indexFirst,
618  const int *indexLast,
619  const double *boundList)
620  {
621  setColumnSetBounds(indexFirst, indexLast, boundList);
622  }
623 
626  void setRowLower(int elementIndex, double elementValue);
627 
630  void setRowUpper(int elementIndex, double elementValue);
631 
633  void setRowBounds(int elementIndex,
634  double lower, double upper);
635 
642  void setRowSetBounds(const int *indexFirst,
643  const int *indexLast,
644  const double *boundList);
645 
647  inline const double *rowScale() const
649  {
650  return rowScale_;
651  }
652  inline const double *columnScale() const
653  {
654  return columnScale_;
655  }
656  inline const double *inverseRowScale() const
657  {
658  return inverseRowScale_;
659  }
660  inline const double *inverseColumnScale() const
661  {
662  return inverseColumnScale_;
663  }
664  inline double *mutableRowScale() const
665  {
666  return rowScale_;
667  }
668  inline double *mutableColumnScale() const
669  {
670  return columnScale_;
671  }
672  inline double *mutableInverseRowScale() const
673  {
674  return inverseRowScale_;
675  }
676  inline double *mutableInverseColumnScale() const
677  {
678  return inverseColumnScale_;
679  }
680  inline double *swapRowScale(double *newScale)
681  {
682  double *oldScale = rowScale_;
683  rowScale_ = newScale;
684  return oldScale;
685  }
686  void setRowScale(double *scale);
687  void setColumnScale(double *scale);
689  inline double objectiveScale() const
690  {
691  return objectiveScale_;
692  }
693  inline void setObjectiveScale(double value)
694  {
695  objectiveScale_ = value;
696  }
698  inline double rhsScale() const
699  {
700  return rhsScale_;
701  }
702  inline void setRhsScale(double value)
703  {
704  rhsScale_ = value;
705  }
707  void scaling(int mode = 1);
710  void unscale();
712  inline int scalingFlag() const
713  {
714  return scalingFlag_;
715  }
717  inline double *objective() const
718  {
719  if (objective_) {
720  double offset;
721  return objective_->gradient(NULL, NULL, offset, false);
722  } else {
723  return NULL;
724  }
725  }
726  inline double *objective(const double *solution, double &offset, bool refresh = true) const
727  {
728  offset = 0.0;
729  if (objective_) {
730  return objective_->gradient(NULL, solution, offset, refresh);
731  } else {
732  return NULL;
733  }
734  }
735  inline const double *getObjCoefficients() const
736  {
737  if (objective_) {
738  double offset;
739  return objective_->gradient(NULL, NULL, offset, false);
740  } else {
741  return NULL;
742  }
743  }
745  inline double *rowObjective() const
746  {
747  return rowObjective_;
748  }
749  inline const double *getRowObjCoefficients() const
750  {
751  return rowObjective_;
752  }
754  inline double *columnLower() const
755  {
756  return columnLower_;
757  }
758  inline const double *getColLower() const
759  {
760  return columnLower_;
761  }
763  inline double *columnUpper() const
764  {
765  return columnUpper_;
766  }
767  inline const double *getColUpper() const
768  {
769  return columnUpper_;
770  }
772  inline CoinPackedMatrix *matrix() const
773  {
774  if (matrix_ == NULL)
775  return NULL;
776  else
777  return matrix_->getPackedMatrix();
778  }
780  inline CoinBigIndex getNumElements() const
781  {
782  return matrix_->getNumElements();
783  }
786  inline double getSmallElementValue() const
787  {
788  return smallElement_;
789  }
790  inline void setSmallElementValue(double value)
791  {
792  smallElement_ = value;
793  }
795  inline ClpMatrixBase *rowCopy() const
796  {
797  return rowCopy_;
798  }
800  void setNewRowCopy(ClpMatrixBase *newCopy);
802  inline ClpMatrixBase *clpMatrix() const
803  {
804  return matrix_;
805  }
808  {
809  return scaledMatrix_;
810  }
812  inline void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
813  {
814  delete scaledMatrix_;
815  scaledMatrix_ = scaledMatrix;
816  }
819  {
820  ClpPackedMatrix *oldMatrix = scaledMatrix_;
821  scaledMatrix_ = scaledMatrix;
822  return oldMatrix;
823  }
829  void replaceMatrix(ClpMatrixBase *matrix, bool deleteCurrent = false);
835  inline void replaceMatrix(CoinPackedMatrix *newmatrix,
836  bool deleteCurrent = false)
837  {
838  replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
839  }
841  inline double objectiveValue() const
842  {
844  }
845  inline void setObjectiveValue(double value)
846  {
848  }
849  inline double getObjValue() const
850  {
852  }
854  inline char *integerInformation() const
855  {
856  return integerType_;
857  }
860  double *infeasibilityRay(bool fullRay = false) const;
861  double *unboundedRay() const;
863  inline double *ray() const
864  {
865  return ray_;
866  }
868  inline bool rayExists() const
869  {
870  return (ray_ != NULL);
871  }
873  inline void deleteRay()
874  {
875  delete[] ray_;
876  ray_ = NULL;
877  }
879  inline const double *internalRay() const
880  {
881  return ray_;
882  }
884  inline bool statusExists() const
885  {
886  return (status_ != NULL);
887  }
889  inline unsigned char *statusArray() const
890  {
891  return status_;
892  }
895  unsigned char *statusCopy() const;
897  void copyinStatus(const unsigned char *statusArray);
898 
900  inline void setUserPointer(void *pointer)
901  {
902  userPointer_ = pointer;
903  }
904  inline void *getUserPointer() const
905  {
906  return userPointer_;
907  }
909  inline void setTrustedUserPointer(ClpTrustedData *pointer)
910  {
911  trustedUserPointer_ = pointer;
912  }
914  {
915  return trustedUserPointer_;
916  }
918  inline int whatsChanged() const
919  {
920  return whatsChanged_;
921  }
922  inline void setWhatsChanged(int value)
923  {
924  whatsChanged_ = value;
925  }
927  inline int numberThreads() const
928  {
929  return numberThreads_;
930  }
931  inline void setNumberThreads(int value)
932  {
933  numberThreads_ = value;
934  }
936 
938  void passInMessageHandler(CoinMessageHandler *handler);
941  CoinMessageHandler *pushMessageHandler(CoinMessageHandler *handler,
942  bool &oldDefault);
944  void popMessageHandler(CoinMessageHandler *oldHandler, bool oldDefault);
946  void newLanguage(CoinMessages::Language language);
947  inline void setLanguage(CoinMessages::Language language)
948  {
949  newLanguage(language);
950  }
954  inline CoinMessageHandler *messageHandler() const
955  {
956  return handler_;
957  }
959  inline CoinMessages messages() const
960  {
961  return messages_;
962  }
964  inline CoinMessages *messagesPointer()
965  {
966  return &messages_;
967  }
969  inline CoinMessages coinMessages() const
970  {
971  return coinMessages_;
972  }
974  inline CoinMessages *coinMessagesPointer()
975  {
976  return &coinMessages_;
977  }
986  inline void setLogLevel(int value)
987  {
988  handler_->setLogLevel(value);
989  }
990  inline int logLevel() const
991  {
992  return handler_->logLevel();
993  }
995  inline bool defaultHandler() const
996  {
997  return defaultHandler_;
998  }
1003  {
1004  return eventHandler_;
1005  }
1007  inline CoinThreadRandom *randomNumberGenerator()
1008  {
1009  return &randomNumberGenerator_;
1010  }
1012  inline CoinThreadRandom &mutableRandomNumberGenerator()
1013  {
1014  return randomNumberGenerator_;
1015  }
1017  inline void setRandomSeed(int value)
1018  {
1019  randomNumberGenerator_.setSeed(value);
1020  }
1022  inline int lengthNames() const
1023  {
1024  return lengthNames_;
1025  }
1026 #ifndef CLP_NO_STD
1027  inline void setLengthNames(int value)
1029  {
1030  lengthNames_ = value;
1031  }
1033  inline const std::vector< std::string > *rowNames() const
1034  {
1035  return &rowNames_;
1036  }
1037  inline const std::string &rowName(int iRow) const
1038  {
1039  return rowNames_[iRow];
1040  }
1042  std::string getRowName(int iRow) const;
1044  inline const std::vector< std::string > *columnNames() const
1045  {
1046  return &columnNames_;
1047  }
1048  inline const std::string &columnName(int iColumn) const
1049  {
1050  return columnNames_[iColumn];
1051  }
1053  std::string getColumnName(int iColumn) const;
1054 #endif
1055  inline ClpObjective *objectiveAsObject() const
1057  {
1058  return objective_;
1059  }
1061  inline void setObjectivePointer(ClpObjective *newobjective)
1062  {
1063  objective_ = newobjective;
1064  }
1067  int emptyProblem(int *infeasNumber = NULL, double *infeasSum = NULL, bool printMessage = true);
1068 
1070 
1079  void times(double scalar,
1080  const double *x, double *y) const;
1084  void transposeTimes(double scalar,
1085  const double *x, double *y) const;
1087 
1088  //---------------------------------------------------------------------------
1106  bool setIntParam(ClpIntParam key, int value);
1109  bool setDblParam(ClpDblParam key, double value);
1110 #ifndef CLP_NO_STD
1111  bool setStrParam(ClpStrParam key, const std::string &value);
1113 #endif
1114  // Get an integer parameter
1115  inline bool getIntParam(ClpIntParam key, int &value) const
1116  {
1117  if (key < ClpLastIntParam) {
1118  value = intParam_[key];
1119  return true;
1120  } else {
1121  return false;
1122  }
1123  }
1124  // Get an double parameter
1125  inline bool getDblParam(ClpDblParam key, double &value) const
1126  {
1127  if (key < ClpLastDblParam) {
1128  value = dblParam_[key];
1129  return true;
1130  } else {
1131  return false;
1132  }
1133  }
1134 #ifndef CLP_NO_STD
1135  // Get a string parameter
1136  inline bool getStrParam(ClpStrParam key, std::string &value) const
1137  {
1138  if (key < ClpLastStrParam) {
1139  value = strParam_[key];
1140  return true;
1141  } else {
1142  return false;
1143  }
1144  }
1145 #endif
1146  void generateCpp(FILE *fp);
1184  inline unsigned int specialOptions() const
1185  {
1186  return specialOptions_;
1187  }
1188  void setSpecialOptions(unsigned int value);
1189 #define COIN_CBC_USING_CLP 0x01000000
1190  inline bool inCbcBranchAndBound() const
1191  {
1192  return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1193  }
1195 
1198 protected:
1200  void gutsOfDelete(int type);
1204  void gutsOfCopy(const ClpModel &rhs, int trueCopy = 1);
1206  void getRowBound(int iRow, double &lower, double &upper) const;
1209  const double *collb, const double *colub,
1210  const double *obj,
1211  const double *rowlb, const double *rowub,
1212  const double *rowObjective = NULL);
1214  void gutsOfScaling();
1216  inline double rawObjectiveValue() const
1217  {
1218  return objectiveValue_;
1219  }
1221  inline bool permanentArrays() const
1222  {
1223  return (specialOptions_ & 65536) != 0;
1224  }
1226  void startPermanentArrays();
1228  void stopPermanentArrays();
1230  const char *const *rowNamesAsChar() const;
1232  const char *const *columnNamesAsChar() const;
1234  void deleteNamesAsChar(const char *const *names, int number) const;
1236  void onStopped();
1238 
1240 protected:
1243  double optimizationDirection_;
1254  double rhsScale_;
1260  double *rowActivity_;
1264  double *dual_;
1266  double *reducedCost_;
1268  double *rowLower_;
1270  double *rowUpper_;
1274  double *rowObjective_;
1276  double *columnLower_;
1278  double *columnUpper_;
1286  double *ray_;
1288  double *rowScale_;
1290  double *columnScale_;
1305  unsigned char *status_;
1334 #define ROW_COLUMN_COUNTS_SAME 1
1335 #define MATRIX_SAME 2
1336 #define MATRIX_JUST_ROWS_ADDED 4
1337 #define MATRIX_JUST_COLUMNS_ADDED 8
1338 #define ROW_LOWER_SAME 16
1339 #define ROW_UPPER_SAME 32
1340 #define OBJECTIVE_SAME 64
1341 #define COLUMN_LOWER_SAME 128
1342 #define COLUMN_UPPER_SAME 256
1343 #define BASIS_SAME 512
1344 #define ALL_SAME 65339
1345 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1346  unsigned int whatsChanged_;
1358  unsigned int specialOptions_;
1360  CoinMessageHandler *handler_;
1364  CoinThreadRandom randomNumberGenerator_;
1367 #ifndef CLP_NO_STD
1368  std::vector< std::string > rowNames_;
1371  std::vector< std::string > columnNames_;
1372 #endif
1373  CoinMessages messages_;
1376  CoinMessages coinMessages_;
1386  CoinPackedMatrix baseMatrix_;
1388  CoinPackedMatrix baseRowCopy_;
1393 #ifndef CLP_NO_STD
1394  std::string strParam_[ClpLastStrParam];
1396 #endif
1397 
1398 };
1402 
1403 public:
1407  ClpDataSave();
1409 
1411  ClpDataSave(const ClpDataSave &);
1413  ClpDataSave &operator=(const ClpDataSave &rhs);
1415  ~ClpDataSave();
1416 
1418 
1420 public:
1423  double dualBound_;
1434  unsigned int specialOptions_;
1436 };
1437 
1438 #endif
1439 
1440 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1441 */
CoinThreadRandom * randomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1007
ClpDataSave & operator=(const ClpDataSave &rhs)
Assignment operator. This copies the data.
~ClpDataSave()
Destructor.
CoinBigIndex getNumElements() const
Number of elements in matrix.
Definition: ClpModel.hpp:780
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:1244
double primalTolerance() const
Primal tolerance to use.
Definition: ClpModel.hpp:337
double * savedColumnScale_
Saved column scale factors.
Definition: ClpModel.hpp:1392
void setClpScaledMatrix(ClpPackedMatrix *scaledMatrix)
Sets pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:812
double objectiveScale_
Scaling of objective.
Definition: ClpModel.hpp:1252
The maximum amount the primal constraints can be violated and still be considered feasible...
bool getDblParam(ClpDblParam key, double &value) const
Definition: ClpModel.hpp:1125
void startPermanentArrays()
Start using maximumRows_ and Columns_.
const std::string & columnName(int iColumn) const
Definition: ClpModel.hpp:1048
unsigned char * statusArray() const
Return address of status (i.e. basis) array (char[numberRows+numberColumns])
Definition: ClpModel.hpp:889
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:1294
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)
double * primalColumnSolution() const
Primal column solution.
Definition: ClpModel.hpp:508
double objectiveScale() const
Scaling of objective.
Definition: ClpModel.hpp:689
bool isInteger(int index) const
Return true if the index-th variable is an integer variable.
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1270
double dblParam_[ClpLastDblParam]
Array of double parameters.
Definition: ClpModel.hpp:1246
int secondaryStatus_
Secondary status of problem.
Definition: ClpModel.hpp:1350
CoinMessages coinMessages() const
Return Coin messages.
Definition: ClpModel.hpp:969
unsigned char * statusCopy() const
Return copy of status (i.e.
void copyColumnNames(const std::vector< std::string > &columnNames, int first, int last)
Copies in Column names - modifies names first .. last-1.
double * columnScale_
Column scale factors.
Definition: ClpModel.hpp:1290
bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
Definition: ClpModel.hpp:470
void setColumnName(int colIndex, std::string &name)
Set name of col.
void setObjectivePointer(ClpObjective *newobjective)
Definition: ClpModel.hpp:1061
void setContinuous(int index)
Set the index-th variable to be a continuous variable.
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:863
void getRowBound(int iRow, double &lower, double &upper) const
gets lower and upper bounds on rows
ClpMatrixBase * rowCopy_
Row copy if wanted.
Definition: ClpModel.hpp:1282
int sparseThreshold_
Definition: ClpModel.hpp:1430
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:599
std::string strParam_[ClpLastStrParam]
Array of string parameters.
Definition: ClpModel.hpp:1395
bool isIterationLimitReached() const
Iteration limit reached?
Definition: ClpModel.hpp:484
ClpIntParam
This is where to put any useful stuff.
int perturbation_
Definition: ClpModel.hpp:1431
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.
double * mutableColumnScale() const
Definition: ClpModel.hpp:668
Abstract base class for Clp Matrices.
int numberColumns() const
Definition: ClpModel.hpp:332
const double * getColUpper() const
Definition: ClpModel.hpp:767
int maximumRows_
Maximum number of rows in model.
Definition: ClpModel.hpp:1380
void setMaximumSeconds(double value)
CoinMessages messages_
Messages.
Definition: ClpModel.hpp:1374
double * objective() const
Objective.
Definition: ClpModel.hpp:717
double * dual_
Duals.
Definition: ClpModel.hpp:1264
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
bool setStrParam(ClpStrParam key, const std::string &value)
Set an string parameter.
const char *const * columnNamesAsChar() const
Create column names as char **.
const double * inverseRowScale() const
Definition: ClpModel.hpp:656
void addColumns(int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
Add columns.
bool rayExists() const
just test if infeasibility or unbounded Ray exists
Definition: ClpModel.hpp:868
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.
double * reducedCost_
Reduced costs.
Definition: ClpModel.hpp:1266
int findNetwork(char *rotate, double fractionNeeded=0.75)
Find a network subset.
double dualTolerance() const
Dual tolerance to use.
Definition: ClpModel.hpp:343
bool getStrParam(ClpStrParam key, std::string &value) const
Definition: ClpModel.hpp:1136
ClpDblParam
For a structure to be used by trusted code.
ClpMatrixBase * matrix_
Packed matrix.
Definition: ClpModel.hpp:1280
CoinMessages coinMessages_
Coin messages.
Definition: ClpModel.hpp:1376
bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
CoinMessages * coinMessagesPointer()
Return pointer to Coin messages.
Definition: ClpModel.hpp:974
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:391
void setObjectiveScale(double value)
Definition: ClpModel.hpp:693
ClpMatrixBase * rowCopy() const
Row Matrix.
Definition: ClpModel.hpp:795
double * rowLower() const
Row lower.
Definition: ClpModel.hpp:539
const char *const * rowNamesAsChar() const
Create row names as char **.
double * columnLower() const
Column Lower.
Definition: ClpModel.hpp:754
bool hitMaximumIterations() const
Returns true if hit maximum iterations (or time)
int numberRows_
Number of rows.
Definition: ClpModel.hpp:1256
int solveType_
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:1317
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:1315
void synchronizeMatrix()
Makes sure matrix dimensions are at least model dimensions.
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: ClpModel.hpp:489
const double * getColSolution() const
Definition: ClpModel.hpp:512
double * columnUpper() const
Column Upper.
Definition: ClpModel.hpp:763
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
~ClpModel()
Destructor.
double objectiveScale_
Definition: ClpModel.hpp:1429
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
Add one row.
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:772
double * rowObjective_
Row Objective (? sign) - may be NULL.
Definition: ClpModel.hpp:1274
ClpObjective * objectiveAsObject() const
Objective methods.
Definition: ClpModel.hpp:1056
bool permanentArrays() const
If we are using maximumRows_ and Columns_.
Definition: ClpModel.hpp:1221
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:1002
ClpPackedMatrix * clpScaledMatrix() const
Scaled ClpPackedMatrix.
Definition: ClpModel.hpp:807
void setColSolution(const double *input)
Definition: ClpModel.hpp:516
Objective Abstract Base Class.
void gutsOfScaling()
Does much of scaling.
int getIterationCount() const
Definition: ClpModel.hpp:382
int maximumInternalRows_
Maximum number of rows (internal arrays) in model.
Definition: ClpModel.hpp:1384
int maximumInternalColumns_
Maximum number of columns (internal arrays) in model.
Definition: ClpModel.hpp:1382
void setInteger(int index)
Set the index-th variable to be an integer variable.
void setWhatsChanged(int value)
Definition: ClpModel.hpp:922
double * unboundedRay() const
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:835
void stopPermanentArrays()
Stop using maximumRows_ and Columns_.
double * swapRowScale(double *newScale)
Definition: ClpModel.hpp:680
bool inCbcBranchAndBound() const
Definition: ClpModel.hpp:1190
CoinMessages * messagesPointer()
Return pointer to messages.
Definition: ClpModel.hpp:964
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
Definition: ClpModel.hpp:1364
Set Dual objective limit.
int secondaryStatus() const
Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reac...
Definition: ClpModel.hpp:451
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:617
void newLanguage(CoinMessages::Language language)
Set language.
const double * getRowObjCoefficients() const
Definition: ClpModel.hpp:749
const std::string & problemName() const
Definition: ClpModel.hpp:372
unsigned int whatsChanged_
Definition: ClpModel.hpp:1346
double maximumSeconds() const
Maximum time in seconds (from when set called)
Definition: ClpModel.hpp:406
void onStopped()
On stopped - sets secondary status.
void setRhsScale(double value)
Definition: ClpModel.hpp:702
int logLevel() const
Definition: ClpModel.hpp:990
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
double rawObjectiveValue() const
Objective value - always minimize.
Definition: ClpModel.hpp:1216
void createEmptyMatrix()
Create empty ClpPackedMatrix.
#define COIN_CBC_USING_CLP
Definition: ClpModel.hpp:1189
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
double rhsScale() const
Scaling of rhs and bounds.
Definition: ClpModel.hpp:698
double * inverseRowScale_
Inverse row scale factors for matrix (end of rowScale_)
Definition: ClpModel.hpp:1292
CoinMessageHandler * messageHandler() const
Return handler.
Definition: ClpModel.hpp:954
char * integerType_
Integer information.
Definition: ClpModel.hpp:1307
The maximum amount the dual constraints can be violated and still be considered feasible.
void setDualObjectiveLimit(double value)
int scalingFlag() const
Gets scalingFlag.
Definition: ClpModel.hpp:712
double getSmallElementValue() const
Small element value - elements less than this set to zero, default is 1.0e-20.
Definition: ClpModel.hpp:786
void setNumberIterations(int numberIterationsNew)
Definition: ClpModel.hpp:386
std::vector< std::string > rowNames_
Row names.
Definition: ClpModel.hpp:1369
char * integerInformation() const
Integer information.
Definition: ClpModel.hpp:854
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.
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
void addColumn(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objective=0.0)
Add one column.
double pivotTolerance_
Definition: ClpModel.hpp:1425
ClpPackedMatrix * scaledMatrix_
Scaled packed matrix.
Definition: ClpModel.hpp:1284
double * mutableRowScale() const
Definition: ClpModel.hpp:664
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
const double * getReducedCost() const
Definition: ClpModel.hpp:534
void setOptimizationDirection(double value)
int lengthNames_
length of names (0 means no names)
Definition: ClpModel.hpp:1352
ClpMatrixBase * clpMatrix() const
Clp Matrix.
Definition: ClpModel.hpp:802
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...
bool getIntParam(ClpIntParam key, int &value) const
Definition: ClpModel.hpp:1115
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
Load up quadratic objective.
const double * getRowLower() const
Definition: ClpModel.hpp:543
void chgObjCoefficients(const double *objIn)
Change objective coefficients.
const double * rowScale() const
Scaling.
Definition: ClpModel.hpp:648
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1278
CoinPackedMatrix baseMatrix_
Base packed matrix.
Definition: ClpModel.hpp:1386
void times(double scalar, const double *x, double *y) const
Return y + A * x * scalar in y.
double * mutableInverseColumnScale() const
Definition: ClpModel.hpp:676
void deleteQuadraticObjective()
Get rid of quadratic objective.
void setSolveType(int type)
Definition: ClpModel.hpp:395
CoinMessages messages() const
Return messages.
Definition: ClpModel.hpp:959
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
void setSpecialOptions(unsigned int value)
void setMaximumIterations(int value)
bool statusExists() const
See if status (i.e. basis) array exists (partly for OsiClp)
Definition: ClpModel.hpp:884
int lengthNames() const
length of names (0 means no names0
Definition: ClpModel.hpp:1022
double * ray_
Infeasible/unbounded ray.
Definition: ClpModel.hpp:1286
double zeroSimplexTolerance_
Definition: ClpModel.hpp:1427
double * dualColumnSolution() const
Reduced costs.
Definition: ClpModel.hpp:530
double objectiveOffset() const
Objective offset.
Definition: ClpModel.hpp:361
int forceFactorization_
Definition: ClpModel.hpp:1432
void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1258
Objective function constant.
void * getUserPointer() const
Definition: ClpModel.hpp:904
int scalingFlag_
Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic, 5 geometric on rows...
Definition: ClpModel.hpp:1297
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1401
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpModel.hpp:562
double * dualRowSolution() const
Dual row solution.
Definition: ClpModel.hpp:521
const double * getRowActivity() const
Definition: ClpModel.hpp:503
double objectiveValue() const
Objective value.
Definition: ClpModel.hpp:841
std::string getColumnName(int iColumn) const
Return name or Cnnnnnnn.
ClpTrustedData * getTrustedUserPointer() const
Definition: ClpModel.hpp:913
bool defaultHandler_
Flag to say if default handler (so delete)
Definition: ClpModel.hpp:1362
double getObjValue() const
Definition: ClpModel.hpp:849
void setNumberThreads(int value)
Definition: ClpModel.hpp:931
void setLengthNames(int value)
length of names (0 means no names0
Definition: ClpModel.hpp:1028
double * rowScale_
Row scale factors for matrix.
Definition: ClpModel.hpp:1288
void deleteRows(int number, const int *which)
Deletes rows.
void chgRowLower(const double *rowLower)
Change row lower bounds.
bool isAbandoned() const
Are there a numerical difficulties?
Definition: ClpModel.hpp:460
void setNewRowCopy(ClpMatrixBase *newCopy)
Set new row matrix.
const std::string & rowName(int iRow) const
Definition: ClpModel.hpp:1037
int emptyProblem(int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
Solve a problem with no elements - return status and dual and primal infeasibilites.
virtual CoinBigIndex getNumElements() const =0
Number of entries in the packed matrix.
void setDualTolerance(double value)
const double * getColLower() const
Definition: ClpModel.hpp:758
void setSmallElementValue(double value)
Definition: ClpModel.hpp:790
double acceptablePivot_
Definition: ClpModel.hpp:1428
void chgRowUpper(const double *rowUpper)
Change row upper bounds.
ClpDataSave()
Default constructor.
void deleteNamesAsChar(const char *const *names, int number) const
Delete char * version of names.
double getObjSense() const
Definition: ClpModel.hpp:493
const double * internalRay() const
Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead...
Definition: ClpModel.hpp:879
double * rowUpper() const
Row upper.
Definition: ClpModel.hpp:548
double dualBound_
Definition: ClpModel.hpp:1423
void setObjectiveValue(double value)
Definition: ClpModel.hpp:845
unsigned int specialOptions_
Definition: ClpModel.hpp:1434
double dualObjectiveLimit() const
Dual objective limit.
Definition: ClpModel.hpp:355
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...
int whatsChanged() const
What has changed in model (only for masochistic users)
Definition: ClpModel.hpp:918
ClpEventHandler * eventHandler_
Event handler.
Definition: ClpModel.hpp:1366
void setLanguage(CoinMessages::Language language)
Definition: ClpModel.hpp:947
bool defaultHandler() const
Return true if default handler.
Definition: ClpModel.hpp:995
void setProblemStatus(int problemStatusNew)
Set problem status.
Definition: ClpModel.hpp:432
bool isProvenOptimal() const
Is optimality proven?
Definition: ClpModel.hpp:465
const double * getRowPrice() const
Definition: ClpModel.hpp:525
CoinBigIndex cleanMatrix(double threshold=1.0e-20)
Really clean up matrix (if ClpPackedMatrix).
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:1388
void deleteRay()
just delete ray if exists
Definition: ClpModel.hpp:873
void setPrimalTolerance(double value)
int numberThreads_
Number of threads (not very operational)
Definition: ClpModel.hpp:1354
Base class for Clp event handling.
double * mutableInverseRowScale() const
Definition: ClpModel.hpp:672
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition: ClpModel.hpp:593
void setRowObjective(const double *rowObjective)
This just loads up a row objective.
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of a matrix.
Definition: ClpModel.hpp:234
CoinThreadRandom & mutableRandomNumberGenerator()
Thread specific random number generator.
Definition: ClpModel.hpp:1012
Primal objective limit.
Just a marker, so that we can allocate a static sized array to store parameters.
unsigned int specialOptions() const
For advanced options 1 - Don&#39;t keep changing infeasibility weight 2 - Keep nonLinearCost round solves...
Definition: ClpModel.hpp:1184
double infeasibilityCost_
Definition: ClpModel.hpp:1424
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:1250
int scalingFlag_
Definition: ClpModel.hpp:1433
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:378
void setColumnSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously The default implementation just invokes setColL...
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:319
void copyinStatus(const unsigned char *statusArray)
Copy in status (basis) vector.
CoinMessageHandler * handler_
Message handler.
Definition: ClpModel.hpp:1360
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1305
const double * getObjCoefficients() const
Definition: ClpModel.hpp:735
double rhsScale_
Scaling of rhs and bounds.
Definition: ClpModel.hpp:1254
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:986
int problemStatus() const
Definition: ClpModel.hpp:427
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:1017
double * rowActivity_
Row activities.
Definition: ClpModel.hpp:1260
void deleteColumns(int number, const int *which)
Deletes columns.
const std::vector< std::string > * columnNames() const
Column names.
Definition: ClpModel.hpp:1044
double * primalRowSolution() const
Primal row solution.
Definition: ClpModel.hpp:499
const double * inverseColumnScale() const
Definition: ClpModel.hpp:660
double * columnActivity_
Column activities.
Definition: ClpModel.hpp:1262
ClpObjective * objective_
Objective.
Definition: ClpModel.hpp:1272
double zeroFactorizationTolerance_
Definition: ClpModel.hpp:1426
std::vector< std::string > columnNames_
Column names.
Definition: ClpModel.hpp:1371
int problemStatus_
Status of problem.
Definition: ClpModel.hpp:1348
ClpModel(bool emptyMessages=false)
Default constructor.
int getNumRows() const
Definition: ClpModel.hpp:323
void addRows(int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
Add rows.
double presolveTolerance() const
Presolve tolerance to use.
Definition: ClpModel.hpp:367
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1268
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:745
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
void setSecondaryStatus(int newstatus)
Definition: ClpModel.hpp:455
void chgColumnUpper(const double *columnUpper)
Change column upper bounds.
void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: ClpModel.hpp:605
double primalObjectiveLimit() const
Primal objective limit.
Definition: ClpModel.hpp:349
int numberThreads() const
Number of threads (not really being used)
Definition: ClpModel.hpp:927
const double * columnScale() const
Definition: ClpModel.hpp:652
void setRowScale(double *scale)
void setColumnScale(double *scale)
int status() const
Status of problem: -1 - unknown e.g.
Definition: ClpModel.hpp:423
double * objective(const double *solution, double &offset, bool refresh=true) const
Definition: ClpModel.hpp:726
void dropNames()
Drops names - makes lengthnames 0 and names empty.
bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
Definition: ClpModel.hpp:475
int getNumCols() const
Number of columns.
Definition: ClpModel.hpp:328
ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix *scaledMatrix)
Swaps pointer to scaled ClpPackedMatrix.
Definition: ClpModel.hpp:818
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1248
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
void returnModel(ClpModel &otherModel)
Return model - nulls all arrays so can be deleted safely also updates any scalars.
int maximumIterations() const
Maximum number of iterations.
Definition: ClpModel.hpp:400
Name of the problem.
Tolerance to use in presolve.
void setTrustedUserPointer(ClpTrustedData *pointer)
Trusted user pointer.
Definition: ClpModel.hpp:909
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:1378
std::string getRowName(int iRow) const
Return name or Rnnnnnnn.
Just a marker, so that we can allocate a static sized array to store parameters.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
void * userPointer_
User pointer for whatever reason.
Definition: ClpModel.hpp:1309
void passInMessageHandler(CoinMessageHandler *handler)
Pass in Message handler (not deleted at end)
void setUserPointer(void *pointer)
User pointer for whatever reason.
Definition: ClpModel.hpp:900
void chgColumnLower(const double *columnLower)
Change column lower bounds.
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1276
void unscale()
If we constructed a "really" scaled model then this reverses the operation.
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
ClpTrustedData * trustedUserPointer_
Trusted user pointer e.g. for heuristics.
Definition: ClpModel.hpp:1311
int intParam_[ClpLastIntParam]
Array of integer parameters.
Definition: ClpModel.hpp:1313
double * infeasibilityRay(bool fullRay=false) const
Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays...
bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
const double * getRowUpper() const
Definition: ClpModel.hpp:552
double * savedRowScale_
Saved row scale factors for matrix.
Definition: ClpModel.hpp:1390
CoinModel * createCoinModel() const
This creates a coinModel object.
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
const std::vector< std::string > * rowNames() const
Row names.
Definition: ClpModel.hpp:1033
unsigned int specialOptions_
For advanced options See get and set for meaning.
Definition: ClpModel.hpp:1358