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