CoinUtils  2.10.14
CoinModel.hpp
Go to the documentation of this file.
1 /* $Id: CoinModel.hpp 1691 2014-03-19 12:43:56Z forrest $ */
2 // Copyright (C) 2005, 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 CoinModel_H
7 #define CoinModel_H
8 
9 #include "CoinModelUseful.hpp"
10 #include "CoinMessageHandler.hpp"
11 #include "CoinPackedMatrix.hpp"
12 #include "CoinFinite.hpp"
14 
15 public:
16 
17 
20  CoinBaseModel ();
22 
25 
28 
30  virtual CoinBaseModel * clone() const=0;
31 
33  virtual ~CoinBaseModel () ;
35 
38  inline int numberRows() const
40  { return numberRows_;}
42  inline int numberColumns() const
43  { return numberColumns_;}
45  virtual CoinBigIndex numberElements() const = 0;
49  inline double objectiveOffset() const
50  { return objectiveOffset_;}
52  inline void setObjectiveOffset(double value)
53  { objectiveOffset_=value;}
55  inline double optimizationDirection() const {
57  }
59  inline void setOptimizationDirection(double value)
60  { optimizationDirection_=value;}
62  inline int logLevel() const
63  { return logLevel_;}
65  void setLogLevel(int value);
67  inline const char * getProblemName() const
68  { return problemName_.c_str();}
70  void setProblemName(const char *name) ;
72  void setProblemName(const std::string &name) ;
74  inline const std::string & getRowBlock() const
75  { return rowBlockName_;}
77  inline void setRowBlock(const std::string &name)
78  { rowBlockName_ = name;}
80  inline const std::string & getColumnBlock() const
81  { return columnBlockName_;}
83  inline void setColumnBlock(const std::string &name)
84  { columnBlockName_ = name;}
88 
89 protected:
92  int numberRows_;
101  std::string problemName_;
103  std::string rowBlockName_;
105  std::string columnBlockName_;
110 
121 
123 };
124 
161 class CoinModel : public CoinBaseModel {
162 
163 public:
167  void addRow(int numberInRow, const int * columns,
168  const double * elements, double rowLower=-COIN_DBL_MAX,
169  double rowUpper=COIN_DBL_MAX, const char * name=NULL);
171  void addColumn(int numberInColumn, const int * rows,
172  const double * elements,
173  double columnLower=0.0,
174  double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0,
175  const char * name=NULL, bool isInteger=false);
177  inline void addCol(int numberInColumn, const int * rows,
178  const double * elements,
179  double columnLower=0.0,
180  double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0,
181  const char * name=NULL, bool isInteger=false)
182  { addColumn(numberInColumn, rows, elements, columnLower, columnUpper, objectiveValue,
183  name,isInteger);}
185  inline void operator() (int i,int j,double value)
186  { setElement(i,j,value);}
188  void setElement(int i,int j,double value) ;
194  int getRow(int whichRow, int * column, double * element);
200  int getColumn(int whichColumn, int * column, double * element);
202  void setQuadraticElement(int i,int j,double value) ;
204  inline void operator() (int i,int j,const char * value)
205  { setElement(i,j,value);}
207  void setElement(int i,int j,const char * value) ;
209  int associateElement(const char * stringValue, double value);
213  void setRowLower(int whichRow,double rowLower);
217  void setRowUpper(int whichRow,double rowUpper);
221  void setRowBounds(int whichRow,double rowLower,double rowUpper);
225  void setRowName(int whichRow,const char * rowName);
229  void setColumnLower(int whichColumn,double columnLower);
233  void setColumnUpper(int whichColumn,double columnUpper);
237  void setColumnBounds(int whichColumn,double columnLower,double columnUpper);
241  void setColumnObjective(int whichColumn,double columnObjective);
245  void setColumnName(int whichColumn,const char * columnName);
249  void setColumnIsInteger(int whichColumn,bool columnIsInteger);
253  inline void setObjective(int whichColumn,double columnObjective)
254  { setColumnObjective( whichColumn, columnObjective);}
258  inline void setIsInteger(int whichColumn,bool columnIsInteger)
259  { setColumnIsInteger( whichColumn, columnIsInteger);}
263  inline void setInteger(int whichColumn)
264  { setColumnIsInteger( whichColumn, true);}
268  inline void setContinuous(int whichColumn)
269  { setColumnIsInteger( whichColumn, false);}
273  inline void setColLower(int whichColumn,double columnLower)
274  { setColumnLower( whichColumn, columnLower);}
278  inline void setColUpper(int whichColumn,double columnUpper)
279  { setColumnUpper( whichColumn, columnUpper);}
283  inline void setColBounds(int whichColumn,double columnLower,double columnUpper)
284  { setColumnBounds( whichColumn, columnLower, columnUpper);}
288  inline void setColObjective(int whichColumn,double columnObjective)
289  { setColumnObjective( whichColumn, columnObjective);}
293  inline void setColName(int whichColumn,const char * columnName)
294  { setColumnName( whichColumn, columnName);}
298  inline void setColIsInteger(int whichColumn,bool columnIsInteger)
299  { setColumnIsInteger( whichColumn, columnIsInteger);}
303  void setRowLower(int whichRow,const char * rowLower);
307  void setRowUpper(int whichRow,const char * rowUpper);
311  void setColumnLower(int whichColumn,const char * columnLower);
315  void setColumnUpper(int whichColumn,const char * columnUpper);
319  void setColumnObjective(int whichColumn,const char * columnObjective);
323  void setColumnIsInteger(int whichColumn,const char * columnIsInteger);
327  inline void setObjective(int whichColumn,const char * columnObjective)
328  { setColumnObjective( whichColumn, columnObjective);}
332  inline void setIsInteger(int whichColumn,const char * columnIsInteger)
333  { setColumnIsInteger( whichColumn, columnIsInteger);}
336  void deleteRow(int whichRow);
339  void deleteColumn(int whichColumn);
342  inline void deleteCol(int whichColumn)
343  { deleteColumn(whichColumn);}
345  int deleteElement(int row, int column);
347  void deleteThisElement(int row, int column,int position);
350  int packRows();
353  int packColumns();
356  inline int packCols()
357  { return packColumns();}
362  int pack();
363 
366  void setObjective(int numberColumns,const double * objective) ;
369  void setColumnLower(int numberColumns,const double * columnLower);
372  inline void setColLower(int numberColumns,const double * columnLower)
376  void setColumnUpper(int numberColumns,const double * columnUpper);
379  inline void setColUpper(int numberColumns,const double * columnUpper)
383  void setRowLower(int numberRows,const double * rowLower);
386  void setRowUpper(int numberRows,const double * rowUpper);
387 
413  int writeMps(const char *filename, int compression = 0,
414  int formatType = 0, int numberAcross = 2, bool keepStrings=false) ;
415 
420  int differentModel(CoinModel & other, bool ignoreNames);
422 
423 
426  void passInMatrix(const CoinPackedMatrix & matrix);
432  inline const CoinPackedMatrix * packedMatrix() const
433  { return packedMatrix_;}
435  inline const int * originalRows() const
436  { return rowType_;}
438  inline const int * originalColumns() const
439  { return columnType_;}
441 
442 
445  inline CoinBigIndex numberElements() const
447  { return numberElements_;}
449  inline const CoinModelTriple * elements() const
450  { return elements_;}
452  inline double operator() (int i,int j) const
453  { return getElement(i,j);}
455  double getElement(int i,int j) const;
457  inline double operator() (const char * rowName,const char * columnName) const
458  { return getElement(rowName,columnName);}
460  double getElement(const char * rowName,const char * columnName) const;
462  double getQuadraticElement(int i,int j) const;
467  const char * getElementAsString(int i,int j) const;
471  double * pointer (int i,int j) const;
475  int position (int i,int j) const;
476 
477 
481  CoinModelLink firstInRow(int whichRow) const ;
485  CoinModelLink lastInRow(int whichRow) const ;
489  CoinModelLink firstInColumn(int whichColumn) const ;
493  CoinModelLink lastInColumn(int whichColumn) const ;
498  CoinModelLink next(CoinModelLink & current) const ;
509  CoinModelLink firstInQuadraticColumn(int whichColumn) const ;
513  CoinModelLink lastInQuadraticColumn(int whichColumn) const ;
516  double getRowLower(int whichRow) const ;
519  double getRowUpper(int whichRow) const ;
522  const char * getRowName(int whichRow) const ;
523  inline double rowLower(int whichRow) const
524  { return getRowLower(whichRow);}
527  inline double rowUpper(int whichRow) const
528  { return getRowUpper(whichRow) ;}
531  inline const char * rowName(int whichRow) const
532  { return getRowName(whichRow);}
535  double getColumnLower(int whichColumn) const ;
538  double getColumnUpper(int whichColumn) const ;
541  double getColumnObjective(int whichColumn) const ;
544  const char * getColumnName(int whichColumn) const ;
547  bool getColumnIsInteger(int whichColumn) const ;
550  inline double columnLower(int whichColumn) const
551  { return getColumnLower(whichColumn);}
554  inline double columnUpper(int whichColumn) const
555  { return getColumnUpper(whichColumn) ;}
558  inline double columnObjective(int whichColumn) const
559  { return getColumnObjective(whichColumn);}
562  inline double objective(int whichColumn) const
563  { return getColumnObjective(whichColumn);}
566  inline const char * columnName(int whichColumn) const
567  { return getColumnName(whichColumn);}
570  inline bool columnIsInteger(int whichColumn) const
571  { return getColumnIsInteger(whichColumn);}
574  inline bool isInteger(int whichColumn) const
575  { return getColumnIsInteger(whichColumn);}
578  inline double getColLower(int whichColumn) const
579  { return getColumnLower(whichColumn);}
582  inline double getColUpper(int whichColumn) const
583  { return getColumnUpper(whichColumn) ;}
586  inline double getColObjective(int whichColumn) const
587  { return getColumnObjective(whichColumn);}
590  inline const char * getColName(int whichColumn) const
591  { return getColumnName(whichColumn);}
594  inline bool getColIsInteger(int whichColumn) const
595  { return getColumnIsInteger(whichColumn);}
598  const char * getRowLowerAsString(int whichRow) const ;
601  const char * getRowUpperAsString(int whichRow) const ;
602  inline const char * rowLowerAsString(int whichRow) const
603  { return getRowLowerAsString(whichRow);}
606  inline const char * rowUpperAsString(int whichRow) const
607  { return getRowUpperAsString(whichRow) ;}
610  const char * getColumnLowerAsString(int whichColumn) const ;
613  const char * getColumnUpperAsString(int whichColumn) const ;
616  const char * getColumnObjectiveAsString(int whichColumn) const ;
619  const char * getColumnIsIntegerAsString(int whichColumn) const ;
622  inline const char * columnLowerAsString(int whichColumn) const
623  { return getColumnLowerAsString(whichColumn);}
626  inline const char * columnUpperAsString(int whichColumn) const
627  { return getColumnUpperAsString(whichColumn) ;}
630  inline const char * columnObjectiveAsString(int whichColumn) const
631  { return getColumnObjectiveAsString(whichColumn);}
634  inline const char * objectiveAsString(int whichColumn) const
635  { return getColumnObjectiveAsString(whichColumn);}
638  inline const char * columnIsIntegerAsString(int whichColumn) const
639  { return getColumnIsIntegerAsString(whichColumn);}
642  inline const char * isIntegerAsString(int whichColumn) const
643  { return getColumnIsIntegerAsString(whichColumn);}
645  int row(const char * rowName) const;
647  int column(const char * columnName) const;
649  inline int type() const
650  { return type_;}
652  inline double unsetValue() const
653  { return -1.23456787654321e-97;}
656  const double * associated);
662  int countPlusMinusOne(CoinBigIndex * startPositive, CoinBigIndex * startNegative,
663  const double * associated);
666  void createPlusMinusOne(CoinBigIndex * startPositive, CoinBigIndex * startNegative,
667  int * indices,
668  const double * associated);
670  int createArrays(double * & rowLower, double * & rowUpper,
671  double * & columnLower, double * & columnUpper,
672  double * & objective, int * & integerType,
673  double * & associated);
675  inline bool stringsExist() const
676  { return string_.numberItems()!=0;}
678  inline const CoinModelHash * stringArray() const
679  { return &string_;}
681  inline double * associatedArray() const
682  { return associated_;}
684  inline double * rowLowerArray() const
685  { return rowLower_;}
687  inline double * rowUpperArray() const
688  { return rowUpper_;}
690  inline double * columnLowerArray() const
691  { return columnLower_;}
693  inline double * columnUpperArray() const
694  { return columnUpper_;}
696  inline double * objectiveArray() const
697  { return objective_;}
699  inline int * integerTypeArray() const
700  { return integerType_;}
702  inline const CoinModelHash * rowNames() const
703  { return &rowName_;}
705  inline const CoinModelHash * columnNames() const
706  { return &columnName_;}
708  inline void zapRowNames()
709  { rowName_=CoinModelHash();}
711  inline void zapColumnNames()
714  inline const int * cutMarker() const
715  { return cut_;}
717  inline double optimizationDirection() const {
718  return optimizationDirection_;
719  }
721  inline void setOptimizationDirection(double value)
722  { optimizationDirection_=value;}
724  inline void * moreInfo() const
725  { return moreInfo_;}
727  inline void setMoreInfo(void * info)
728  { moreInfo_ = info;}
737  int whatIsSet() const;
739 
757  void loadBlock (const CoinPackedMatrix& matrix,
758  const double* collb, const double* colub,
759  const double* obj,
760  const double* rowlb, const double* rowub) ;
777  void loadBlock (const CoinPackedMatrix& matrix,
778  const double* collb, const double* colub,
779  const double* obj,
780  const char* rowsen, const double* rowrhs,
781  const double* rowrng) ;
782 
795  void loadBlock (const int numcols, const int numrows,
796  const CoinBigIndex * start, const int* index,
797  const double* value,
798  const double* collb, const double* colub,
799  const double* obj,
800  const double* rowlb, const double* rowub) ;
801 
814  void loadBlock (const int numcols, const int numrows,
815  const CoinBigIndex * start, const int* index,
816  const double* value,
817  const double* collb, const double* colub,
818  const double* obj,
819  const char* rowsen, const double* rowrhs,
820  const double* rowrng) ;
821 
823 
829  CoinModel(int firstRows, int firstColumns, int firstElements,bool noNames=false);
832  CoinModel(const char *fileName, int allowStrings=0);
836  CoinModel( int nonLinear, const char * fileName,const void * info);
839  const CoinPackedMatrix * matrix,
840  const double * rowLower, const double * rowUpper,
841  const double * columnLower, const double * columnUpper,
842  const double * objective);
844  virtual CoinBaseModel * clone() const;
845 
847  virtual ~CoinModel();
849 
857 
860  void validateLinks() const;
863 private:
865  void resize(int maximumRows, int maximumColumns, int maximumElements);
867  void fillRows(int which,bool forceCreation,bool fromAddRow=false);
869  void fillColumns(int which,bool forceCreation,bool fromAddColumn=false);
872  void fillList(int which, CoinModelLinkedList & list,int type) const ;
876  void createList(int type) const;
878  int addString(const char * string);
882  double getDoubleFromString(CoinYacc & info, const char * string);
885 public:
887  int computeAssociated(double * associated);
893  CoinPackedMatrix * quadraticRow(int rowNumber,double * linear,
894  int & numberBad) const;
896  void replaceQuadraticRow(int rowNumber,const double * linear, const CoinPackedMatrix * quadraticPart);
901  CoinModel * reorder(const char * mark) const;
912  int expandKnapsack(int knapsackRow, int & numberOutput,double * buildObj, CoinBigIndex * buildStart,
913  int * buildRow, double * buildElement,int reConstruct=-1) const;
915  void setCutMarker(int size,const int * marker);
917  void setPriorities(int size,const int * priorities);
919  inline const int * priorities() const
920  { return priority_;}
922  void setOriginalIndices(const int * row, const int * column);
923 
924 private:
928  void gdb( int nonLinear, const char * fileName, const void * info);
930  int decodeBit(char * phrase, char * & nextPhrase, double & coefficient, bool ifFirst) const;
932  void badType() const;
935  int maximumRows_;
948  double * rowLower_;
950  double * rowUpper_;
960  int * rowType_;
962  double * objective_;
964  double * columnLower_;
966  double * columnUpper_;
982  int * columnType_;
984  int * start_;
1002  double * sortElements_;
1012  double * associated_;
1016  int * startSOS_;
1018  int * memberSOS_;
1020  int * typeSOS_;
1024  double * referenceSOS_;
1026  int * priority_;
1028  int * cut_;
1030  void * moreInfo_;
1038  mutable int type_;
1040  bool noNames_;
1047  mutable int links_;
1049 };
1051 double getFunctionValueFromString(const char * string, const char * x, double xValue);
1053 double getDoubleFromString(CoinYacc & info, const char * string, const char * x, double xValue);
1054 #endif
CoinModelHash
Definition: CoinModelUseful.hpp:180
CoinModel::rowUpperAsString
const char * rowUpperAsString(int whichRow) const
Gets rowUpper (if row does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:606
CoinModel::priorities
const int * priorities() const
priorities (given for all columns (-1 if not integer)
Definition: CoinModel.hpp:919
CoinModel::deleteElement
int deleteElement(int row, int column)
Takes element out of matrix - returning position (<0 if not there);.
CoinModel::setElement
void setElement(int i, int j, const char *value)
Sets value for row i and column j as string.
CoinModelTriple
for linked lists
Definition: CoinModelUseful.hpp:107
CoinModel::setColumnLower
void setColumnLower(int whichColumn, double columnLower)
Sets columnLower (if column does not exist then all columns up to this are defined with default value...
CoinModel::sizeAssociated_
int sizeAssociated_
Size of associated values.
Definition: CoinModel.hpp:1010
CoinModel::setColumnUpper
void setColumnUpper(int numberColumns, const double *columnUpper)
Sets columnUpper array.
CoinBaseModel::numberRows
int numberRows() const
Return number of rows.
Definition: CoinModel.hpp:39
CoinBaseModel::objectiveOffset
double objectiveOffset() const
Returns the (constant) objective offset This is the RHS entry for the objective row.
Definition: CoinModel.hpp:49
CoinModel::loadBlock
void loadBlock(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Load in a problem by copying the arguments.
CoinModel::next
CoinModelLink next(CoinModelLink &current) const
Returns next element in current row or column - index is -1 if none.
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
CoinModel::getRowUpper
double getRowUpper(int whichRow) const
Gets rowUpper (if row does not exist then +COIN_DBL_MAX)
CoinModel::setRowLower
void setRowLower(int whichRow, const char *rowLower)
Sets rowLower (if row does not exist then all rows up to this are defined with default values and no ...
CoinModel::fillList
void fillList(int which, CoinModelLinkedList &list, int type) const
Fill in default linked list information (1= row, 2 = column) Marked as const as list is mutable.
CoinModel::priority_
int * priority_
priorities (given for all columns (-1 if not integer)
Definition: CoinModel.hpp:1026
CoinModel::columnUpper
double columnUpper(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:554
CoinModel::rowList_
CoinModelLinkedList rowList_
Linked list for rows.
Definition: CoinModel.hpp:992
CoinModel::setOptimizationDirection
void setOptimizationDirection(double value)
Set direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:721
CoinModel::validateLinks
void validateLinks() const
Checks that links are consistent.
CoinModel::setColumnUpper
void setColumnUpper(int whichColumn, const char *columnUpper)
Sets columnUpper (if column does not exist then all columns up to this are defined with default value...
CoinModel::gdb
void gdb(int nonLinear, const char *fileName, const void *info)
Read a problem from AMPL nl file so not constructor so gdb will work.
CoinModel::originalColumns
const int * originalColumns() const
Return pointers to original columns (for decomposition)
Definition: CoinModel.hpp:438
CoinModelLinkedList
Definition: CoinModelUseful.hpp:312
CoinModel::convertMatrix
int convertMatrix()
Convert elements to CoinPackedMatrix (and switch off element updates).
CoinModel::string_
CoinModelHash string_
Strings.
Definition: CoinModel.hpp:972
CoinModel::objectiveArray
double * objectiveArray() const
Return objective array.
Definition: CoinModel.hpp:696
CoinModel::cutMarker
const int * cutMarker() const
Returns array of 0 or nonzero if can be a cut (or returns NULL)
Definition: CoinModel.hpp:714
CoinModel::quadraticRow
CoinPackedMatrix * quadraticRow(int rowNumber, double *linear, int &numberBad) const
Gets correct form for a quadratic row - user to delete If row is not quadratic then returns which oth...
CoinModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:717
CoinModel::countPlusMinusOne
int countPlusMinusOne(CoinBigIndex *startPositive, CoinBigIndex *startNegative, const double *associated)
Fills in startPositive and startNegative with counts for +-1 matrix.
CoinModel::CoinModel
CoinModel(int firstRows, int firstColumns, int firstElements, bool noNames=false)
Constructor with sizes.
CoinBaseModel::setMessageHandler
void setMessageHandler(CoinMessageHandler *handler)
Pass in message handler.
CoinModel::previous
CoinModelLink previous(CoinModelLink &current) const
Returns previous element in current row or column - index is -1 if none.
CoinModel::setObjective
void setObjective(int whichColumn, double columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
Definition: CoinModel.hpp:253
CoinBaseModel::setObjectiveOffset
void setObjectiveOffset(double value)
Set objective offset.
Definition: CoinModel.hpp:52
CoinModel::setColumnIsInteger
void setColumnIsInteger(int whichColumn, bool columnIsInteger)
Sets integer state (if column does not exist then all columns up to this are defined with default val...
CoinModel::getElement
double getElement(int i, int j) const
Returns value for row i and column j.
CoinModel::row
int row(const char *rowName) const
Row index from row name (-1 if no names or no match)
CoinModel::columnName
const char * columnName(int whichColumn) const
Gets name (if column does not exist then NULL)
Definition: CoinModel.hpp:566
CoinModel::sortIndices_
int * sortIndices_
Array for sorting indices.
Definition: CoinModel.hpp:1000
CoinModel::getColumnUpperAsString
const char * getColumnUpperAsString(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
CoinModel::pack
int pack()
Packs down all rows and columns.
CoinModel::associateElement
int associateElement(const char *stringValue, double value)
Associates a string with a value. Returns string id (or -1 if does not exist)
CoinBaseModel::logLevel_
int logLevel_
Print level.
Definition: CoinModel.hpp:119
CoinModel::lastInColumn
CoinModelLink lastInColumn(int whichColumn) const
Returns last element in given column - index is -1 if none.
CoinBaseModel::getColumnBlock
const std::string & getColumnBlock() const
Return the column block name.
Definition: CoinModel.hpp:80
CoinBaseModel::numberColumns_
int numberColumns_
Current number of columns.
Definition: CoinModel.hpp:95
CoinModel::columnType_
int * columnType_
Column types.
Definition: CoinModel.hpp:982
CoinModel::setColObjective
void setColObjective(int whichColumn, double columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
Definition: CoinModel.hpp:288
CoinModel::columnUpperArray
double * columnUpperArray() const
Return columnUpper array.
Definition: CoinModel.hpp:693
CoinModel::prioritySOS_
int * prioritySOS_
SOS priority.
Definition: CoinModel.hpp:1022
CoinModel::stringArray
const CoinModelHash * stringArray() const
Return string array.
Definition: CoinModel.hpp:678
CoinModel::setIsInteger
void setIsInteger(int whichColumn, bool columnIsInteger)
Sets integer state (if column does not exist then all columns up to this are defined with default val...
Definition: CoinModel.hpp:258
CoinModel::cut_
int * cut_
Nonzero if row is cut - done in one go e.g. from ampl.
Definition: CoinModel.hpp:1028
CoinModel::setObjective
void setObjective(int whichColumn, const char *columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
Definition: CoinModel.hpp:327
CoinMessages
Class to hold and manipulate an array of massaged messages.
Definition: CoinMessageHandler.hpp:128
CoinModel::rowLowerArray
double * rowLowerArray() const
Return rowLower array.
Definition: CoinModel.hpp:684
CoinModel::firstInQuadraticColumn
CoinModelLink firstInQuadraticColumn(int whichColumn) const
Returns first element in given quadratic column - index is -1 if none.
CoinModel::getElement
double getElement(const char *rowName, const char *columnName) const
Returns value for row rowName and column columnName.
CoinBaseModel::optimizationDirection_
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:97
CoinModel::elements_
CoinModelTriple * elements_
Actual elements.
Definition: CoinModel.hpp:986
CoinModel::originalRows
const int * originalRows() const
Return pointers to original rows (for decomposition)
Definition: CoinModel.hpp:435
CoinModel::expandKnapsack
int expandKnapsack(int knapsackRow, int &numberOutput, double *buildObj, CoinBigIndex *buildStart, int *buildRow, double *buildElement, int reConstruct=-1) const
Expands out all possible combinations for a knapsack If buildObj NULL then just computes space needed...
CoinBaseModel::~CoinBaseModel
virtual ~CoinBaseModel()
Destructor.
CoinModel::setRowUpper
void setRowUpper(int whichRow, double rowUpper)
Sets rowUpper (if row does not exist then all rows up to this are defined with default values and no ...
CoinBaseModel::columnBlockName_
std::string columnBlockName_
Columnblock name.
Definition: CoinModel.hpp:105
CoinModel::getColumnLowerAsString
const char * getColumnLowerAsString(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
CoinModel::getColumnUpper
double getColumnUpper(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
CoinModel::firstInColumn
CoinModelLink firstInColumn(int whichColumn) const
Returns first element in given column - index is -1 if none.
CoinModel::setInteger
void setInteger(int whichColumn)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
Definition: CoinModel.hpp:263
CoinModel::~CoinModel
virtual ~CoinModel()
Destructor.
CoinModel::lastInQuadraticColumn
CoinModelLink lastInQuadraticColumn(int whichColumn) const
Returns last element in given quadratic column - index is -1 if none.
CoinModel::elements
const CoinModelTriple * elements() const
Return elements as triples.
Definition: CoinModel.hpp:449
CoinModel::addRow
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX, const char *name=NULL)
add a row - numberInRow may be zero
CoinBaseModel::CoinBaseModel
CoinBaseModel(const CoinBaseModel &rhs)
Copy constructor.
CoinModel::setColumnObjective
void setColumnObjective(int whichColumn, const char *columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
CoinModel::columnIsInteger
bool columnIsInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:570
CoinModel::rowLower_
double * rowLower_
Row lower.
Definition: CoinModel.hpp:948
CoinModel::getColumnObjectiveAsString
const char * getColumnObjectiveAsString(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
CoinBaseModel::optimizationDirection
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:55
CoinBaseModel::setLogLevel
void setLogLevel(int value)
Set print level 0 - off, 1 - errors, 2 - more.
CoinModel::setColumnName
void setColumnName(int whichColumn, const char *columnName)
Sets name (if column does not exist then all columns up to this are defined with default values and n...
CoinModel::position
int position(int i, int j) const
Returns position in elements for row i column j.
CoinModel::setColumnLower
void setColumnLower(int whichColumn, const char *columnLower)
Sets columnLower (if column does not exist then all columns up to this are defined with default value...
CoinModel::start_
int * start_
If simple then start of each row/column.
Definition: CoinModel.hpp:984
CoinModel::loadBlock
void loadBlock(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
Load in a problem by copying the arguments.
CoinModel::setRowName
void setRowName(int whichRow, const char *rowName)
Sets name (if row does not exist then all rows up to this are defined with default values and no elem...
CoinModel::hashElements_
CoinModelHash2 hashElements_
Hash for elements.
Definition: CoinModel.hpp:990
CoinBaseModel::clone
virtual CoinBaseModel * clone() const =0
Clone.
CoinModel::setMoreInfo
void setMoreInfo(void *info)
Set pointer to more information.
Definition: CoinModel.hpp:727
CoinModel::type
int type() const
Returns type.
Definition: CoinModel.hpp:649
CoinModel::setRowUpper
void setRowUpper(int whichRow, const char *rowUpper)
Sets rowUpper (if row does not exist then all rows up to this are defined with default values and no ...
CoinModel::numberElements
CoinBigIndex numberElements() const
Return number of elements.
Definition: CoinModel.hpp:446
CoinModel::columnLowerArray
double * columnLowerArray() const
Return columnLower array.
Definition: CoinModel.hpp:690
CoinModel::writeMps
int writeMps(const char *filename, int compression=0, int formatType=0, int numberAcross=2, bool keepStrings=false)
Write the problem in MPS format to a file with the given filename.
CoinModel::decodeBit
int decodeBit(char *phrase, char *&nextPhrase, double &coefficient, bool ifFirst) const
returns jColumn (-2 if linear term, -1 if unknown) and coefficient
CoinModel::getColIsInteger
bool getColIsInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:594
CoinModel::columnUpper_
double * columnUpper_
Column Upper.
Definition: CoinModel.hpp:966
CoinMessageHandler.hpp
This is a first attempt at a message handler.
CoinModel::CoinModel
CoinModel(int nonLinear, const char *fileName, const void *info)
Read a problem from AMPL nl file NOTE - as I can't work out configure etc the source code is in Cbc_a...
CoinModel::lastInRow
CoinModelLink lastInRow(int whichRow) const
Returns last element in given row - index is -1 if none.
CoinModel::badType
void badType() const
Aborts with message about packedMatrix.
CoinBaseModel::handler_
CoinMessageHandler * handler_
Message handler (Passed in)
Definition: CoinModel.hpp:107
CoinModel::rowLowerAsString
const char * rowLowerAsString(int whichRow) const
Definition: CoinModel.hpp:602
CoinModel::setOriginalIndices
void setOriginalIndices(const int *row, const int *column)
For decomposition set original row and column indices.
CoinModel::integerType_
int * integerType_
Integer information.
Definition: CoinModel.hpp:970
CoinModel::computeAssociated
int computeAssociated(double *associated)
Fills in all associated - returning number of errors.
CoinModel::getColumnName
const char * getColumnName(int whichColumn) const
Gets name (if column does not exist then NULL)
CoinModel::quadraticColumnList_
CoinModelLinkedList quadraticColumnList_
Linked list for quadratic columns.
Definition: CoinModel.hpp:1008
CoinBaseModel::setColumnBlock
void setColumnBlock(const std::string &name)
Set column block name.
Definition: CoinModel.hpp:83
CoinModelHash2
For int,int hashing.
Definition: CoinModelUseful.hpp:253
CoinModel::columnLower
double columnLower(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
Definition: CoinModel.hpp:550
CoinModel::differentModel
int differentModel(CoinModel &other, bool ignoreNames)
Check two models against each other.
CoinModel
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:161
getFunctionValueFromString
double getFunctionValueFromString(const char *string, const char *x, double xValue)
Just function of single variable x.
CoinModel::resize
void resize(int maximumRows, int maximumColumns, int maximumElements)
Resize.
CoinModel::setPriorities
void setPriorities(int size, const int *priorities)
Sets priority array.
CoinModel::addCol
void addCol(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0, const char *name=NULL, bool isInteger=false)
add a column - numberInColumn may be zero *‍/
Definition: CoinModel.hpp:177
CoinModel::rowUpper
double rowUpper(int whichRow) const
Gets rowUpper (if row does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:527
CoinModel::columnObjective
double columnObjective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:558
CoinModel::quadraticRowList_
CoinModelLinkedList quadraticRowList_
Linked list for quadratic rows.
Definition: CoinModel.hpp:1006
CoinBaseModel::messages_
CoinMessages messages_
Messages.
Definition: CoinModel.hpp:109
CoinModel::moreInfo
void * moreInfo() const
Return pointer to more information.
Definition: CoinModel.hpp:724
CoinModel::associated_
double * associated_
Associated values.
Definition: CoinModel.hpp:1012
CoinModel::addColumn
void addColumn(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0, const char *name=NULL, bool isInteger=false)
add a column - numberInColumn may be zero *‍/
CoinModel::getRow
int getRow(int whichRow, int *column, double *element)
Gets sorted row - user must provide enough space (easiest is allocate number of columns).
CoinModel::getColLower
double getColLower(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
Definition: CoinModel.hpp:578
CoinModel::replaceQuadraticRow
void replaceQuadraticRow(int rowNumber, const double *linear, const CoinPackedMatrix *quadraticPart)
Replaces a quadratic row.
CoinBaseModel::problemName_
std::string problemName_
Problem name.
Definition: CoinModel.hpp:101
CoinModel::setColumnIsInteger
void setColumnIsInteger(int whichColumn, const char *columnIsInteger)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
CoinModel::setIsInteger
void setIsInteger(int whichColumn, const char *columnIsInteger)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
Definition: CoinModel.hpp:332
CoinModel::getRowLowerAsString
const char * getRowLowerAsString(int whichRow) const
Gets rowLower (if row does not exist then -COIN_DBL_MAX)
CoinModel::rowUpper_
double * rowUpper_
Row upper.
Definition: CoinModel.hpp:950
CoinModel::fillColumns
void fillColumns(int which, bool forceCreation, bool fromAddColumn=false)
Fill in default column information.
CoinModel::CoinModel
CoinModel(int numberRows, int numberColumns, const CoinPackedMatrix *matrix, const double *rowLower, const double *rowUpper, const double *columnLower, const double *columnUpper, const double *objective)
From arrays.
CoinModel::objectiveAsString
const char * objectiveAsString(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:634
CoinModel::deleteColumn
void deleteColumn(int whichColumn)
Deletes all entries in column and bounds and objective.
CoinBaseModel::operator=
CoinBaseModel & operator=(const CoinBaseModel &rhs)
Assignment operator.
CoinModel::setObjective
void setObjective(int numberColumns, const double *objective)
Sets columnObjective array.
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:327
CoinModel::getColumnObjective
double getColumnObjective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
CoinModel::quadraticElements_
CoinModelTriple * quadraticElements_
Actual quadratic elements (always linked lists)
Definition: CoinModel.hpp:996
CoinModel::getRowUpperAsString
const char * getRowUpperAsString(int whichRow) const
Gets rowUpper (if row does not exist then +COIN_DBL_MAX)
CoinModel::columnList_
CoinModelLinkedList columnList_
Linked list for columns.
Definition: CoinModel.hpp:994
CoinBaseModel::objectiveOffset_
double objectiveOffset_
Objective offset to be passed on.
Definition: CoinModel.hpp:99
CoinBaseModel::numberRows_
int numberRows_
Current number of rows.
Definition: CoinModel.hpp:93
getDoubleFromString
double getDoubleFromString(CoinYacc &info, const char *string, const char *x, double xValue)
faster version
CoinModel::noNames_
bool noNames_
True if no names EVER being used (for users who know what they are doing)
Definition: CoinModel.hpp:1040
CoinModel::rowType_
int * rowType_
Row types.
Definition: CoinModel.hpp:960
CoinBaseModel::getProblemName
const char * getProblemName() const
Return the problem name.
Definition: CoinModel.hpp:67
CoinModel::clone
virtual CoinBaseModel * clone() const
Clone.
CoinModel::unsetValue
double unsetValue() const
returns unset value
Definition: CoinModel.hpp:652
CoinBaseModel::setOptimizationDirection
void setOptimizationDirection(double value)
Set direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
Definition: CoinModel.hpp:59
CoinModel::setRowLower
void setRowLower(int numberRows, const double *rowLower)
Sets rowLower array.
CoinModel::sortSize_
int sortSize_
Size of sort arrays.
Definition: CoinModel.hpp:1004
CoinModel::packedMatrix_
CoinPackedMatrix * packedMatrix_
Actual elements as CoinPackedMatrix.
Definition: CoinModel.hpp:988
CoinModel::freeStringMemory
void freeStringMemory(CoinYacc &info)
Frees value memory.
CoinModel::numberQuadraticElements_
int numberQuadraticElements_
Current number of quadratic elements.
Definition: CoinModel.hpp:944
CoinModel::columnName_
CoinModelHash columnName_
Column names.
Definition: CoinModel.hpp:968
CoinModel::setRowLower
void setRowLower(int whichRow, double rowLower)
Sets rowLower (if row does not exist then all rows up to this are defined with default values and no ...
CoinModel::moreInfo_
void * moreInfo_
Pointer to more information.
Definition: CoinModel.hpp:1030
CoinModel::deleteCol
void deleteCol(int whichColumn)
Deletes all entries in column and bounds.
Definition: CoinModel.hpp:342
CoinBaseModel
Definition: CoinModel.hpp:13
CoinModel::columnUpperAsString
const char * columnUpperAsString(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:626
CoinPackedMatrix.hpp
CoinModel::maximumRows_
int maximumRows_
Maximum number of rows.
Definition: CoinModel.hpp:936
CoinModel::getColumn
int getColumn(int whichColumn, int *column, double *element)
Gets sorted column - user must provide enough space (easiest is allocate number of rows).
CoinModel::setRowUpper
void setRowUpper(int numberRows, const double *rowUpper)
Sets rowUpper array.
CoinModel::isInteger
bool isInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:574
CoinModel::columnObjectiveAsString
const char * columnObjectiveAsString(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:630
CoinModel::deleteThisElement
void deleteThisElement(int row, int column, int position)
Takes element out of matrix when position known.
CoinYacc
Definition: CoinModelUseful.hpp:151
CoinModel::hashQuadraticElements_
CoinModelHash2 hashQuadraticElements_
Hash for quadratic elements.
Definition: CoinModel.hpp:998
CoinModel::objective
double objective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:562
CoinBaseModel::setRowBlock
void setRowBlock(const std::string &name)
Set row block name.
Definition: CoinModel.hpp:77
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
CoinModel::getElementAsString
const char * getElementAsString(int i, int j) const
Returns value for row i and column j as string.
CoinModel::createPackedMatrix
int createPackedMatrix(CoinPackedMatrix &matrix, const double *associated)
Creates a packed matrix - return number of errors.
CoinModel::type_
int type_
Type of build - -1 unset, 0 for row, 1 for column, 2 linked.
Definition: CoinModel.hpp:1038
CoinModel::createArrays
int createArrays(double *&rowLower, double *&rowUpper, double *&columnLower, double *&columnUpper, double *&objective, int *&integerType, double *&associated)
Creates copies of various arrays - return number of errors.
CoinModel::getRowLower
double getRowLower(int whichRow) const
Gets rowLower (if row does not exist then -COIN_DBL_MAX)
CoinModel::setQuadraticElement
void setQuadraticElement(int i, int j, double value)
Sets quadratic value for column i and j.
CoinModel::rowNames
const CoinModelHash * rowNames() const
Return row names array.
Definition: CoinModel.hpp:702
CoinModel::getColumnIsIntegerAsString
const char * getColumnIsIntegerAsString(int whichColumn) const
Gets if integer (if column does not exist then false)
CoinModel::stringsExist
bool stringsExist() const
Says if strings exist.
Definition: CoinModel.hpp:675
CoinModel::zapRowNames
void zapRowNames()
Reset row names.
Definition: CoinModel.hpp:708
CoinModel::setColumnLower
void setColumnLower(int numberColumns, const double *columnLower)
Sets columnLower array.
CoinModel::operator()
void operator()(int i, int j, double value)
Sets value for row i and column j.
Definition: CoinModel.hpp:185
CoinModel::getQuadraticElement
double getQuadraticElement(int i, int j) const
Returns quadratic value for columns i and j.
CoinModel::column
int column(const char *columnName) const
Column index from column name (-1 if no names or no match)
CoinModel::objective_
double * objective_
Objective.
Definition: CoinModel.hpp:962
CoinModel::maximumQuadraticElements_
int maximumQuadraticElements_
Maximum number of quadratic elements.
Definition: CoinModel.hpp:946
CoinModel::getRowName
const char * getRowName(int whichRow) const
Gets name (if row does not exist then NULL)
CoinModel::packRows
int packRows()
Packs down all rows i.e.
CoinModel::setCutMarker
void setCutMarker(int size, const int *marker)
Sets cut marker array.
CoinModel::numberSOS_
int numberSOS_
Number of SOS - all these are done in one go e.g. from ampl.
Definition: CoinModel.hpp:1014
CoinModel::reorder
CoinModel * reorder(const char *mark) const
If possible return a model where if all variables marked nonzero are fixed the problem will be linear...
CoinModel::setColIsInteger
void setColIsInteger(int whichColumn, bool columnIsInteger)
Sets integer (if column does not exist then all columns up to this are defined with default values an...
Definition: CoinModel.hpp:298
CoinModel::CoinModel
CoinModel(const CoinModel &)
The copy constructor.
CoinModel::integerTypeArray
int * integerTypeArray() const
Return integerType array.
Definition: CoinModel.hpp:699
CoinModel::setElement
void setElement(int i, int j, double value)
Sets value for row i and column j.
CoinModel::operator=
CoinModel & operator=(const CoinModel &)
=
CoinModel::createList
void createList(int type) const
Create a linked list and synchronize free type 1 for row 2 for column Marked as const as list is muta...
CoinBaseModel::getRowBlock
const std::string & getRowBlock() const
Return the row block name.
Definition: CoinModel.hpp:74
CoinModel::setColUpper
void setColUpper(int whichColumn, double columnUpper)
Sets columnUpper (if column does not exist then all columns up to this are defined with default value...
Definition: CoinModel.hpp:278
CoinModel::memberSOS_
int * memberSOS_
SOS members.
Definition: CoinModel.hpp:1018
CoinModel::whatIsSet
int whatIsSet() const
Returns which parts of model are set 1 - matrix 2 - rhs 4 - row names 8 - column bounds and/or object...
CoinModel::columnLowerAsString
const char * columnLowerAsString(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
Definition: CoinModel.hpp:622
CoinModel::isIntegerAsString
const char * isIntegerAsString(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:642
CoinModel::rowLower
double rowLower(int whichRow) const
Definition: CoinModel.hpp:523
CoinModel::createPlusMinusOne
void createPlusMinusOne(CoinBigIndex *startPositive, CoinBigIndex *startNegative, int *indices, const double *associated)
Creates +-1 matrix given startPositive and startNegative counts for +-1 matrix.
CoinModel::getColumnLower
double getColumnLower(int whichColumn) const
Gets columnLower (if column does not exist then 0.0)
CoinModel::getColUpper
double getColUpper(int whichColumn) const
Gets columnUpper (if column does not exist then COIN_DBL_MAX)
Definition: CoinModel.hpp:582
CoinModel::setColBounds
void setColBounds(int whichColumn, double columnLower, double columnUpper)
Sets columnLower and columnUpper (if column does not exist then all columns up to this are defined wi...
Definition: CoinModel.hpp:283
CoinModel::columnNames
const CoinModelHash * columnNames() const
Return column names array.
Definition: CoinModel.hpp:705
CoinBaseModel::setProblemName
void setProblemName(const std::string &name)
Set problem name.
CoinModel::getColName
const char * getColName(int whichColumn) const
Gets name (if column does not exist then NULL)
Definition: CoinModel.hpp:590
CoinModel::pointer
double * pointer(int i, int j) const
Returns pointer to element for row i column j.
CoinModel::setContinuous
void setContinuous(int whichColumn)
Sets continuous (if column does not exist then all columns up to this are defined with default values...
Definition: CoinModel.hpp:268
CoinModel::fillRows
void fillRows(int which, bool forceCreation, bool fromAddRow=false)
Fill in default row information.
CoinBaseModel::numberElements
virtual CoinBigIndex numberElements() const =0
Return number of elements.
CoinModel::setColLower
void setColLower(int whichColumn, double columnLower)
Sets columnLower (if column does not exist then all columns up to this are defined with default value...
Definition: CoinModel.hpp:273
CoinModel::getColObjective
double getColObjective(int whichColumn) const
Gets columnObjective (if column does not exist then 0.0)
Definition: CoinModel.hpp:586
CoinModel::loadBlock
void loadBlock(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Load in a problem by copying the arguments.
CoinModel::CoinModel
CoinModel(const char *fileName, int allowStrings=0)
Read a problem in MPS or GAMS format from the given filename.
CoinModel::referenceSOS_
double * referenceSOS_
SOS reference.
Definition: CoinModel.hpp:1024
CoinBaseModel::setProblemName
void setProblemName(const char *name)
Set problem name.
CoinModel::columnIsIntegerAsString
const char * columnIsIntegerAsString(int whichColumn) const
Gets if integer (if column does not exist then false)
Definition: CoinModel.hpp:638
CoinModel::addString
int addString(const char *string)
Adds one string, returns index.
CoinModel::packColumns
int packColumns()
Packs down all columns i.e.
CoinModel::columnLower_
double * columnLower_
Column Lower.
Definition: CoinModel.hpp:964
CoinModel::CoinModel
CoinModel()
Default constructor.
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
CoinModel::maximumElements_
int maximumElements_
Maximum number of elements.
Definition: CoinModel.hpp:942
CoinBaseModel::numberColumns
int numberColumns() const
Return number of columns.
Definition: CoinModel.hpp:42
CoinModel::rowName
const char * rowName(int whichRow) const
Gets name (if row does not exist then NULL)
Definition: CoinModel.hpp:531
CoinBaseModel::CoinBaseModel
CoinBaseModel()
Default Constructor.
CoinModel::deleteRow
void deleteRow(int whichRow)
Deletes all entries in row and bounds.
CoinModel::setColLower
void setColLower(int numberColumns, const double *columnLower)
Sets columnLower array.
Definition: CoinModel.hpp:372
CoinBaseModel::logLevel
int logLevel() const
Get print level 0 - off, 1 - errors, 2 - more.
Definition: CoinModel.hpp:62
CoinModel::setColumnObjective
void setColumnObjective(int whichColumn, double columnObjective)
Sets columnObjective (if column does not exist then all columns up to this are defined with default v...
CoinModel::setColUpper
void setColUpper(int numberColumns, const double *columnUpper)
Sets columnUpper array.
Definition: CoinModel.hpp:379
CoinModel::startSOS_
int * startSOS_
SOS starts.
Definition: CoinModel.hpp:1016
CoinModelHash::numberItems
int numberItems() const
Number of items i.e. rows if just row names.
Definition: CoinModelUseful.hpp:204
CoinModel::setRowBounds
void setRowBounds(int whichRow, double rowLower, double rowUpper)
Sets rowLower and rowUpper (if row does not exist then all rows up to this are defined with default v...
CoinModel::zapColumnNames
void zapColumnNames()
Reset column names.
Definition: CoinModel.hpp:711
CoinModelUseful.hpp
CoinModel::loadBlock
void loadBlock(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
Load in a problem by copying the arguments.
CoinBaseModel::rowBlockName_
std::string rowBlockName_
Rowblock name.
Definition: CoinModel.hpp:103
CoinModel::getColumnIsInteger
bool getColumnIsInteger(int whichColumn) const
Gets if integer (if column does not exist then false)
CoinModel::setColName
void setColName(int whichColumn, const char *columnName)
Sets name (if column does not exist then all columns up to this are defined with default values and n...
Definition: CoinModel.hpp:293
CoinModel::packedMatrix
const CoinPackedMatrix * packedMatrix() const
Return a pointer to CoinPackedMatrix (or NULL)
Definition: CoinModel.hpp:432
CoinFinite.hpp
CoinModel::typeSOS_
int * typeSOS_
SOS type.
Definition: CoinModel.hpp:1020
CoinModel::maximumColumns_
int maximumColumns_
Maximum number of columns.
Definition: CoinModel.hpp:938
CoinModel::associatedArray
double * associatedArray() const
Returns associated array.
Definition: CoinModel.hpp:681
CoinModel::sortElements_
double * sortElements_
Array for sorting elements.
Definition: CoinModel.hpp:1002
CoinModel::numberElements_
int numberElements_
Current number of elements.
Definition: CoinModel.hpp:940
CoinModel::rowName_
CoinModelHash rowName_
Row names.
Definition: CoinModel.hpp:952
CoinModel::rowUpperArray
double * rowUpperArray() const
Return rowUpper array.
Definition: CoinModel.hpp:687
CoinModel::setColumnUpper
void setColumnUpper(int whichColumn, double columnUpper)
Sets columnUpper (if column does not exist then all columns up to this are defined with default value...
CoinModel::getDoubleFromString
double getDoubleFromString(CoinYacc &info, const char *string)
Gets a double from a string possibly containing named strings, returns unset if not found.
CoinModel::setColumnBounds
void setColumnBounds(int whichColumn, double columnLower, double columnUpper)
Sets columnLower and columnUpper (if column does not exist then all columns up to this are defined wi...
CoinModel::links_
int links_
Links present (could be tested by sizes of objects) 0 - none, 1 - row links, 2 - column links,...
Definition: CoinModel.hpp:1047
CoinModel::firstInRow
CoinModelLink firstInRow(int whichRow) const
Returns first element in given row - index is -1 if none.
CoinModel::passInMatrix
void passInMatrix(const CoinPackedMatrix &matrix)
Pass in CoinPackedMatrix (and switch off element updates)
CoinModel::packCols
int packCols()
Packs down all columns i.e.
Definition: CoinModel.hpp:356