ClpModel Class Reference

#include <ClpModel.hpp>

Inheritance diagram for ClpModel:

Inheritance graph
[legend]
Collaboration diagram for ClpModel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const double * rowScale () const
 Scaling.
const double * columnScale () const
void setRowScale (double *scale)
void setColumnScale (double *scale)
double objectiveScale () const
 Scaling of objective.
void setObjectiveScale (double value)
double rhsScale () const
 Scaling of rhs and bounds.
void setRhsScale (double value)
void scaling (int mode=1)
 Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later).
void unscale ()
 If we constructed a "really" scaled model then this reverses the operation.
int scalingFlag () const
 Gets scalingFlag.
double * objective () const
 Objective.
double * objective (const double *solution, double &offset, bool refresh=true) const
const double * getObjCoefficients () const
double * rowObjective () const
 Row Objective.
const double * getRowObjCoefficients () const
double * columnLower () const
 Column Lower.
const double * getColLower () const
double * columnUpper () const
 Column Upper.
const double * getColUpper () const
CoinPackedMatrixmatrix () const
 Matrix (if not ClpPackedmatrix be careful about memory leak.
int getNumElements () const
 Number of elements in matrix.
double getSmallElementValue () const
 Small element value - elements less than this set to zero, default is 1.0e-20.
void setSmallElementValue (double value)
ClpMatrixBaserowCopy () const
 Row Matrix.
ClpMatrixBaseclpMatrix () const
 Clp Matrix.
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 current.
void replaceMatrix (CoinPackedMatrix *matrix, bool deleteCurrent=false)
 Replace Clp Matrix (current is not deleted unless told to and new is used) So up to user to delete current.
double objectiveValue () const
 Objective value.
void setObjectiveValue (double value)
double getObjValue () const
char * integerInformation () const
 Integer information.
double * infeasibilityRay () const
 Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays.
double * unboundedRay () const
bool statusExists () const
 See if status (i.e. basis) array exists (partly for OsiClp).
unsigned char * statusArray () const
 Return address of status (i.e. basis) array (char[numberRows+numberColumns]).
unsigned char * statusCopy () const
 Return copy of status (i.e.
void copyinStatus (const unsigned char *statusArray)
 Copy in status (basis) vector.
void setUserPointer (void *pointer)
 User pointer for whatever reason.
void * getUserPointer () const
int whatsChanged () const
 What has changed in model (only for masochistic users).
void setWhatsChanged (int value)
int numberThreads () const
 Number of threads (not really being used).
void setNumberThreads (int value)
Constructors and destructor
Note - copy methods copy ALL data so can chew up memory until other copy is freed

 ClpModel (bool emptyMessages=false)
 Default constructor.
 ClpModel (const ClpModel &rhs, int scalingMode=-1)
 Copy constructor.
ClpModeloperator= (const ClpModel &rhs)
 Assignment operator. This copies the data.
 ClpModel (const ClpModel *wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns, bool dropNames=true, bool dropIntegers=true)
 Subproblem constructor.
 ~ClpModel ()
 Destructor.
Load model - loads some stuff and initializes others
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).
void loadProblem (const CoinPackedMatrix &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).
void loadProblem (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, const double *rowObjective=NULL)
 Just like the other loadProblem() method except that the matrix is given in a standard column major ordered format (without gaps).
int loadProblem (CoinModel &modelObject, bool tryPlusMinusOne=false)
 This loads a model from a coinModel object - returns number of errors.
void loadProblem (const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const int *length, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
 This one is for after presolve to save memory.
void loadQuadraticObjective (const int numberColumns, const CoinBigIndex *start, const int *column, const double *element)
 Load up quadratic objective.
void loadQuadraticObjective (const CoinPackedMatrix &matrix)
 Loads a problem (the constraints on the rows are given by lower and upper bounds).
void deleteQuadraticObjective ()
 Get rid of quadratic objective.
void setRowObjective (const double *rowObjective)
 This just loads up a row objective.
int readMps (const char *filename, bool keepNames=false, bool ignoreErrors=false)
 Read an mps file from the given filename.
int readGMPL (const char *filename, const char *dataName, bool keepNames=false)
 Read GMPL files from the given filenames.
void copyInIntegerInformation (const char *information)
 Copy in integer informations.
void deleteIntegerInformation ()
 Drop integer informations.
void setContinuous (int index)
 Set the index-th variable to be a continuous variable.
void setInteger (int index)
 Set the index-th variable to be an integer variable.
bool isInteger (int index) const
 Return true if the index-th variable is an integer variable.
void resize (int newNumberRows, int newNumberColumns)
 Resizes rim part of model.
void deleteRows (int number, const int *which)
 Deletes rows.
void addRow (int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX)
 Add one row.
void addRows (int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *columns, const double *elements)
 Add rows.
void addRows (int number, const double *rowLower, const double *rowUpper, const CoinBigIndex *rowStarts, const int *rowLengths, const int *columns, const double *elements)
 Add rows.
void addRows (int number, const double *rowLower, const double *rowUpper, const CoinPackedVectorBase *const *rows)
 Loads a problem (the constraints on the rows are given by lower and upper bounds).
int addRows (const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
 Add rows from a build object.
int addRows (CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
 Add rows from a model object.
void deleteColumns (int number, const int *which)
 Deletes columns.
void addColumn (int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objective=0.0)
 Add one column.
void addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *rows, const double *elements)
 Add columns.
void addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinBigIndex *columnStarts, const int *columnLengths, const int *rows, const double *elements)
 Loads a problem (the constraints on the rows are given by lower and upper bounds).
void addColumns (int number, const double *columnLower, const double *columnUpper, const double *objective, const CoinPackedVectorBase *const *columns)
 Loads a problem (the constraints on the rows are given by lower and upper bounds).
int addColumns (const CoinBuild &buildObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
 Add columns from a build object If tryPlusMinusOne then will try adding as +-1 matrix if no matrix exists.
int addColumns (CoinModel &modelObject, bool tryPlusMinusOne=false, bool checkDuplicates=true)
 Add columns from a model object.
void modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
 Modify one element of a matrix.
void chgRowLower (const double *rowLower)
 Change row lower bounds.
void chgRowUpper (const double *rowUpper)
 Change row upper bounds.
void chgColumnLower (const double *columnLower)
 Change column lower bounds.
void chgColumnUpper (const double *columnUpper)
 Change column upper bounds.
void chgObjCoefficients (const double *objIn)
 Change objective coefficients.
void borrowModel (ClpModel &otherModel)
 Borrow model.
void returnModel (ClpModel &otherModel)
 Return model - nulls all arrays so can be deleted safely also updates any scalars.
void createEmptyMatrix ()
 Create empty ClpPackedMatrix.
int cleanMatrix (double threshold=1.0e-20)
 Really clean up matrix (if ClpPackedMatrix).
void dropNames ()
 Drops names - makes lengthnames 0 and names empty.
void copyNames (std::vector< std::string > &rowNames, std::vector< std::string > &columnNames)
 Copies in names.
void copyRowNames (const std::vector< std::string > &rowNames, int first, int last)
 Copies in Row names - modifies names first .. last-1.
void copyColumnNames (const std::vector< std::string > &columnNames, int first, int last)
 Copies in Column names - modifies names first .. last-1.
void copyRowNames (const char *const *rowNames, int first, int last)
 Copies in Row names - modifies names first .. last-1.
void copyColumnNames (const char *const *columnNames, int first, int last)
 Copies in Column names - modifies names first .. last-1.
void setRowName (int rowIndex, std::string &name)
 Set name of row.
void setColumnName (int colIndex, std::string &name)
 Set name of col.
int findNetwork (char *rotate, double fractionNeeded=0.75)
 Find a network subset.
CoinModelcreateCoinModel () const
 This creates a coinModel object.
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.
gets and sets
int numberRows () const
 Number of rows.
int getNumRows () const
 Number of rows.
int getNumCols () const
 Number of columns.
int numberColumns () const
 Number of rows.
double primalTolerance () const
 Primal tolerance to use.
void setPrimalTolerance (double value)
 Number of rows.
double dualTolerance () const
 Dual tolerance to use.
void setDualTolerance (double value)
 Number of rows.
double primalObjectiveLimit () const
 Primal objective limit.
void setPrimalObjectiveLimit (double value)
 Number of rows.
double dualObjectiveLimit () const
 Dual objective limit.
void setDualObjectiveLimit (double value)
 Number of rows.
double objectiveOffset () const
 Objective offset.
void setObjectiveOffset (double value)
 Number of rows.
std::string problemName () const
 Number of rows.
int numberIterations () const
 Number of iterations.
int getIterationCount () const
 Number of rows.
void setNumberIterations (int numberIterations)
 Number of rows.
int solveType () const
 Solve type - 1 simplex, 2 simplex interface, 3 Interior.
void setSolveType (int type)
 Number of rows.
int maximumIterations () const
 Maximum number of iterations.
void setMaximumIterations (int value)
 Number of rows.
double maximumSeconds () const
 Maximum time in seconds (from when set called).
void setMaximumSeconds (double value)
 Number of rows.
bool hitMaximumIterations () const
 Returns true if hit maximum iterations (or time).
int status () const
 Status of problem: -1 - unknown e.g.
int problemStatus () const
 Number of rows.
void setProblemStatus (int problemStatus)
 Set problem status.
int secondaryStatus () const
 Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reached OR probably primal infeasible but can't prove it (main status 4) 2 - scaled problem optimal - unscaled problem has primal infeasibilities 3 - scaled problem optimal - unscaled problem has dual infeasibilities 4 - scaled problem optimal - unscaled problem has primal and dual infeasibilities 5 - giving up in primal with flagged variables 6 - failed due to empty problem check 7 - postSolve says not optimal 8 - failed due to bad element check 9 - status was 3 and stopped on time 100 up - translation of enum from ClpEventHandler.
void setSecondaryStatus (int status)
 Number of rows.
bool isAbandoned () const
 Are there a numerical difficulties?
bool isProvenOptimal () const
 Is optimality proven?
bool isProvenPrimalInfeasible () const
 Is primal infeasiblity proven?
bool isProvenDualInfeasible () const
 Is dual infeasiblity proven?
bool isPrimalObjectiveLimitReached () const
 Is the given primal objective limit reached?
bool isDualObjectiveLimitReached () const
 Is the given dual objective limit reached?
bool isIterationLimitReached () const
 Iteration limit reached?
double optimizationDirection () const
 Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
double getObjSense () const
 Number of rows.
void setOptimizationDirection (double value)
 Number of rows.
double * primalRowSolution () const
 Primal row solution.
const double * getRowActivity () const
 Number of rows.
double * primalColumnSolution () const
 Primal column solution.
const double * getColSolution () const
 Number of rows.
void setColSolution (const double *input)
 Number of rows.
double * dualRowSolution () const
 Dual row solution.
const double * getRowPrice () const
 Number of rows.
double * dualColumnSolution () const
 Reduced costs.
const double * getReducedCost () const
 Number of rows.
double * rowLower () const
 Row lower.
const double * getRowLower () const
 Number of rows.
double * rowUpper () const
 Row upper.
const double * getRowUpper () const
 Number of rows.
Changing bounds on variables and constraints
void setObjectiveCoefficient (int elementIndex, double elementValue)
 Set an objective function coefficient.
void setObjCoeff (int elementIndex, double elementValue)
 Set an objective function coefficient.
void setColumnLower (int elementIndex, double elementValue)
 Set a single column lower bound
Use -DBL_MAX for -infinity.
void setColumnUpper (int elementIndex, double elementValue)
 Set a single column upper bound
Use DBL_MAX for infinity.
void setColumnBounds (int elementIndex, double lower, double upper)
 Set a single column lower and upper bound.
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 setColLower() and setColUpper() over and over again.
void setColLower (int elementIndex, double elementValue)
 Set a single column lower bound
Use -DBL_MAX for -infinity.
void setColUpper (int elementIndex, double elementValue)
 Set a single column upper bound
Use DBL_MAX for infinity.
void setColBounds (int elementIndex, double lower, double upper)
 Set a single column lower and upper bound.
void setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
 Set the bounds on a number of columns simultaneously
.
void setRowLower (int elementIndex, double elementValue)
 Set a single row lower bound
Use -DBL_MAX for -infinity.
void setRowUpper (int elementIndex, double elementValue)
 Set a single row upper bound
Use DBL_MAX for infinity.
void setRowBounds (int elementIndex, double lower, double upper)
 Set a single row lower and upper bound.
void setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundList)
 Set the bounds on a number of rows simultaneously
.
Message handling
void passInMessageHandler (CoinMessageHandler *handler)
 Pass in Message handler (not deleted at end).
CoinMessageHandlerpushMessageHandler (CoinMessageHandler *handler, bool &oldDefault)
 Pass in Message handler (not deleted at end) and return current.
void popMessageHandler (CoinMessageHandler *oldHandler, bool oldDefault)
 back to previous message handler
void newLanguage (CoinMessages::Language language)
 Set language.
void setLanguage (CoinMessages::Language language)
 Pass in Message handler (not deleted at end).
CoinMessageHandlermessageHandler () const
 Return handler.
CoinMessages messages () const
 Return messages.
CoinMessagesmessagesPointer ()
 Return pointer to messages.
CoinMessages coinMessages () const
 Return Coin messages.
CoinMessagescoinMessagesPointer ()
 Return pointer to Coin messages.
void setLogLevel (int value)
 Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - verbose above that 8,16,32 etc just for selective debug.
int logLevel () const
 Pass in Message handler (not deleted at end).
bool defaultHandler () const
 Return true if default handler.
void passInEventHandler (const ClpEventHandler *eventHandler)
 Pass in Event handler (cloned and deleted at end).
ClpEventHandlereventHandler () const
 Event handler.
int lengthNames () const
 length of names (0 means no names0
void setLengthNames (int value)
 length of names (0 means no names0
const std::vector< std::string > * rowNames () const
 Row names.
const std::string & rowName (int iRow) const
 Pass in Message handler (not deleted at end).
std::string getRowName (int iRow) const
 Return name or Rnnnnnnn.
const std::vector< std::string > * columnNames () const
 Column names.
const std::string & columnName (int iColumn) const
 Pass in Message handler (not deleted at end).
std::string getColumnName (int iColumn) const
 Return name or Cnnnnnnn.
ClpObjectiveobjectiveAsObject () const
 Objective methods.
void setObjective (ClpObjective *objective)
 Pass in Message handler (not deleted at end).
void setObjectivePointer (ClpObjective *objective)
 Pass in Message handler (not deleted at end).
int emptyProblem (int *infeasNumber=NULL, double *infeasSum=NULL, bool printMessage=true)
 Solve a problem with no elements - return status and dual and primal infeasibilites.
Matrix times vector methods
They can be faster if scalar is +- 1 These are covers so user need not worry about scaling Also for simplex I am not using basic/non-basic split

void times (double scalar, const double *x, double *y) const
 Return y + A * x * scalar in y.
void transposeTimes (double scalar, const double *x, double *y) const
 Return y + x * scalar * A in y.
Parameter set/get methods
The set methods return true if the parameter was set to the given value, false otherwise. There can be various reasons for failure: the given parameter is not applicable for the solver (e.g., refactorization frequency for the volume algorithm), the parameter is not yet implemented for the solver or simply the value of the parameter is out of the range the solver accepts. If a parameter setting call returns false check the details of your solver.

The get methods return true if the given parameter is applicable for the solver and is implemented. In this case the value of the parameter is returned in the second argument. Otherwise they return false.

once it has been decided where solver sits this may be redone

bool setIntParam (ClpIntParam key, int value)
 Set an integer parameter.
bool setDblParam (ClpDblParam key, double value)
 Set an double parameter.
bool setStrParam (ClpStrParam key, const std::string &value)
 Set an string parameter.
bool getIntParam (ClpIntParam key, int &value) const
 Set an integer parameter.
bool getDblParam (ClpDblParam key, double &value) const
 Set an integer parameter.
bool getStrParam (ClpStrParam key, std::string &value) const
 Set an integer parameter.
void generateCpp (FILE *fp)
 Create C++ lines to get to current state.
unsigned int specialOptions () const
 Set an integer parameter.
void setSpecialOptions (unsigned int value)
 Set an integer parameter.

Protected Member Functions

private or protected methods
void gutsOfDelete ()
 Does most of deletion.
void gutsOfCopy (const ClpModel &rhs, bool trueCopy=true)
 Does most of copying If trueCopy false then just points to arrays.
void getRowBound (int iRow, double &lower, double &upper) const
 gets lower and upper bounds on rows
void gutsOfLoadModel (int numberRows, int numberColumns, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
 puts in format I like - 4 array matrix - may make row copy
void gutsOfScaling ()
 Does much of scaling.
double rawObjectiveValue () const
 Objective value - always minimize.
const char *const * rowNamesAsChar () const
 Create row names as char **.
const char *const * columnNamesAsChar () const
 Create column names as char **.
void deleteNamesAsChar (const char *const *names, int number) const
 Delete char * version of names.
void onStopped ()
 On stopped - sets secondary status.

Protected Attributes

data
double optimizationDirection_
 Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
double dblParam_ [ClpLastDblParam]
 Array of double parameters.
double objectiveValue_
 Objective value.
double smallElement_
 Small element value.
double objectiveScale_
 Scaling of objective.
double rhsScale_
 Scaling of rhs and bounds.
int numberRows_
 Number of rows.
int numberColumns_
 Number of columns.
double * rowActivity_
 Row activities.
double * columnActivity_
 Column activities.
double * dual_
 Duals.
double * reducedCost_
 Reduced costs.
double * rowLower_
 Row lower.
double * rowUpper_
 Row upper.
ClpObjectiveobjective_
 Objective.
double * rowObjective_
 Row Objective (? sign) - may be NULL.
double * columnLower_
 Column Lower.
double * columnUpper_
 Column Upper.
ClpMatrixBasematrix_
 Packed matrix.
ClpMatrixBaserowCopy_
 Row copy if wanted.
double * ray_
 Infeasible/unbounded ray.
double * rowScale_
 Row scale factors for matrix.
double * columnScale_
 Column scale factors.
int scalingFlag_
 Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic.
unsigned char * status_
 Status (i.e.
char * integerType_
 Integer information.
void * userPointer_
 User pointer for whatever reason.
int intParam_ [ClpLastIntParam]
 Array of integer parameters.
int numberIterations_
 Number of iterations.
int solveType_
 Solve type - 1 simplex, 2 simplex interface, 3 Interior.
unsigned int whatsChanged_
 Whats changed since last solve.
int problemStatus_
 Status of problem.
int secondaryStatus_
 Secondary status of problem.
int lengthNames_
 length of names (0 means no names)
int numberThreads_
 Number of threads (not very operational).
unsigned int specialOptions_
 For advanced options See get and set for meaning.
CoinMessageHandlerhandler_
 Message handler.
bool defaultHandler_
 Flag to say if default handler (so delete).
ClpEventHandlereventHandler_
 Event handler.
std::vector< std::string > rowNames_
 Row names.
std::vector< std::string > columnNames_
 Column names.
CoinMessages messages_
 Messages.
CoinMessages coinMessages_
 Coin messages.
std::string strParam_ [ClpLastStrParam]
 Array of string parameters.

Detailed Description

Definition at line 38 of file ClpModel.hpp.


Constructor & Destructor Documentation

ClpModel::ClpModel ( bool  emptyMessages = false  ) 

Default constructor.

ClpModel::ClpModel ( const ClpModel rhs,
int  scalingMode = -1 
)

Copy constructor.

May scale depending on mode -1 leave mode as is 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later)

ClpModel::ClpModel ( const ClpModel wholeModel,
int  numberRows,
const int *  whichRows,
int  numberColumns,
const int *  whichColumns,
bool  dropNames = true,
bool  dropIntegers = true 
)

Subproblem constructor.

A subset of whole model is created from the row and column lists given. The new order is given by list order and duplicates are allowed. Name and integer information can be dropped

ClpModel::~ClpModel (  ) 

Destructor.


Member Function Documentation

ClpModel& ClpModel::operator= ( const ClpModel rhs  ) 

Assignment operator. This copies the data.

void ClpModel::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).

If a pointer is 0 then the following values are the default:

Reimplemented in ClpInterior, and ClpSimplex.

void ClpModel::loadProblem ( const CoinPackedMatrix 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).

If a pointer is 0 then the following values are the default:

Reimplemented in ClpInterior, and ClpSimplex.

void ClpModel::loadProblem ( 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,
const double *  rowObjective = NULL 
)

Just like the other loadProblem() method except that the matrix is given in a standard column major ordered format (without gaps).

Reimplemented in ClpInterior, and ClpSimplex.

int ClpModel::loadProblem ( CoinModel modelObject,
bool  tryPlusMinusOne = false 
)

This loads a model from a coinModel object - returns number of errors.

modelObject not const as may be changed as part of process If tryPlusMinusOne then will try adding as +-1 matrix

Reimplemented in ClpSimplex.

void ClpModel::loadProblem ( const int  numcols,
const int  numrows,
const CoinBigIndex start,
const int *  index,
const double *  value,
const int *  length,
const double *  collb,
const double *  colub,
const double *  obj,
const double *  rowlb,
const double *  rowub,
const double *  rowObjective = NULL 
)

This one is for after presolve to save memory.

Reimplemented in ClpInterior, and ClpSimplex.

void ClpModel::loadQuadraticObjective ( const int  numberColumns,
const CoinBigIndex start,
const int *  column,
const double *  element 
)

Load up quadratic objective.

This is stored as a CoinPackedMatrix

void ClpModel::loadQuadraticObjective ( const CoinPackedMatrix matrix  ) 

Loads a problem (the constraints on the rows are given by lower and upper bounds).

If a pointer is 0 then the following values are the default:

void ClpModel::deleteQuadraticObjective (  ) 

Get rid of quadratic objective.

void ClpModel::setRowObjective ( const double *  rowObjective  ) 

This just loads up a row objective.

int ClpModel::readMps ( const char *  filename,
bool  keepNames = false,
bool  ignoreErrors = false 
)

Read an mps file from the given filename.

Reimplemented in ClpInterior, and ClpSimplex.

int ClpModel::readGMPL ( const char *  filename,
const char *  dataName,
bool  keepNames = false 
)

Read GMPL files from the given filenames.

Reimplemented in ClpSimplex.

void ClpModel::copyInIntegerInformation ( const char *  information  ) 

Copy in integer informations.

void ClpModel::deleteIntegerInformation (  ) 

Drop integer informations.

void ClpModel::setContinuous ( int  index  ) 

Set the index-th variable to be a continuous variable.

void ClpModel::setInteger ( int  index  ) 

Set the index-th variable to be an integer variable.

bool ClpModel::isInteger ( int  index  )  const

Return true if the index-th variable is an integer variable.

void ClpModel::resize ( int  newNumberRows,
int  newNumberColumns 
)

Resizes rim part of model.

void ClpModel::deleteRows ( int  number,
const int *  which 
)

Deletes rows.

void ClpModel::addRow ( int  numberInRow,
const int *  columns,
const double *  elements,
double  rowLower = -COIN_DBL_MAX,
double  rowUpper = COIN_DBL_MAX 
)

Add one row.

void ClpModel::addRows ( int  number,
const double *  rowLower,
const double *  rowUpper,
const CoinBigIndex rowStarts,
const int *  columns,
const double *  elements 
)

Add rows.

void ClpModel::addRows ( int  number,
const double *  rowLower,
const double *  rowUpper,
const CoinBigIndex rowStarts,
const int *  rowLengths,
const int *  columns,
const double *  elements 
)

Add rows.

void ClpModel::addRows ( int  number,
const double *  rowLower,
const double *  rowUpper,
const CoinPackedVectorBase *const *  rows 
)

Loads a problem (the constraints on the rows are given by lower and upper bounds).

If a pointer is 0 then the following values are the default:

int ClpModel::addRows ( const CoinBuild buildObject,
bool  tryPlusMinusOne = false,
bool  checkDuplicates = true 
)

Add rows from a build object.

If tryPlusMinusOne then will try adding as +-1 matrix if no matrix exists. Returns number of errors e.g. duplicates

int ClpModel::addRows ( CoinModel modelObject,
bool  tryPlusMinusOne = false,
bool  checkDuplicates = true 
)

Add rows from a model object.

returns -1 if object in bad state (i.e. has column information) otherwise number of errors.

modelObject non const as can be regularized as part of build If tryPlusMinusOne then will try adding as +-1 matrix if no matrix exists.

void ClpModel::deleteColumns ( int  number,
const int *  which 
)

Deletes columns.

void ClpModel::addColumn ( int  numberInColumn,
const int *  rows,
const double *  elements,
double  columnLower = 0.0,
double  columnUpper = COIN_DBL_MAX,
double  objective = 0.0 
)

Add one column.

void ClpModel::addColumns ( int  number,
const double *  columnLower,
const double *  columnUpper,
const double *  objective,
const CoinBigIndex columnStarts,
const int *  rows,
const double *  elements 
)

Add columns.

void ClpModel::addColumns ( int  number,
const double *  columnLower,
const double *  columnUpper,
const double *  objective,
const CoinBigIndex columnStarts,
const int *  columnLengths,
const int *  rows,
const double *  elements 
)

Loads a problem (the constraints on the rows are given by lower and upper bounds).

If a pointer is 0 then the following values are the default:

void ClpModel::addColumns ( int  number,
const double *  columnLower,
const double *  columnUpper,
const double *  objective,
const CoinPackedVectorBase *const *  columns 
)

Loads a problem (the constraints on the rows are given by lower and upper bounds).

If a pointer is 0 then the following values are the default:

int ClpModel::addColumns ( const CoinBuild buildObject,
bool  tryPlusMinusOne = false,
bool  checkDuplicates = true 
)

Add columns from a build object If tryPlusMinusOne then will try adding as +-1 matrix if no matrix exists.

Returns number of errors e.g. duplicates

int ClpModel::addColumns ( CoinModel modelObject,
bool  tryPlusMinusOne = false,
bool  checkDuplicates = true 
)

Add columns from a model object.

returns -1 if object in bad state (i.e. has row information) otherwise number of errors modelObject non const as can be regularized as part of build If tryPlusMinusOne then will try adding as +-1 matrix if no matrix exists.

void ClpModel::modifyCoefficient ( int  row,
int  column,
double  newElement,
bool  keepZero = false 
) [inline]

Modify one element of a matrix.

Definition at line 228 of file ClpModel.hpp.

References matrix_, and ClpMatrixBase::modifyCoefficient().

void ClpModel::chgRowLower ( const double *  rowLower  ) 

Change row lower bounds.

void ClpModel::chgRowUpper ( const double *  rowUpper  ) 

Change row upper bounds.

void ClpModel::chgColumnLower ( const double *  columnLower  ) 

Change column lower bounds.

void ClpModel::chgColumnUpper ( const double *  columnUpper  ) 

Change column upper bounds.

void ClpModel::chgObjCoefficients ( const double *  objIn  ) 

Change objective coefficients.

void ClpModel::borrowModel ( ClpModel otherModel  ) 

Borrow model.

This is so we don't have to copy large amounts of data around. It assumes a derived class wants to overwrite an empty model with a real one - while it does an algorithm

Reimplemented in ClpInterior, and ClpSimplex.

void ClpModel::returnModel ( ClpModel otherModel  ) 

Return model - nulls all arrays so can be deleted safely also updates any scalars.

Reimplemented in ClpInterior.

void ClpModel::createEmptyMatrix (  ) 

Create empty ClpPackedMatrix.

int ClpModel::cleanMatrix ( double  threshold = 1.0e-20  ) 

Really clean up matrix (if ClpPackedMatrix).

a) eliminate all duplicate AND small elements in matrix b) remove all gaps and set extraGap_ and extraMajor_ to 0.0 c) reallocate arrays and make max lengths equal to lengths d) orders elements returns number of elements eliminated or -1 if not ClpPackedMatrix

void ClpModel::dropNames (  ) 

Drops names - makes lengthnames 0 and names empty.

void ClpModel::copyNames ( std::vector< std::string > &  rowNames,
std::vector< std::string > &  columnNames 
)

Copies in names.

void ClpModel::copyRowNames ( const std::vector< std::string > &  rowNames,
int  first,
int  last 
)

Copies in Row names - modifies names first .. last-1.

void ClpModel::copyColumnNames ( const std::vector< std::string > &  columnNames,
int  first,
int  last 
)

Copies in Column names - modifies names first .. last-1.

void ClpModel::copyRowNames ( const char *const *  rowNames,
int  first,
int  last 
)

Copies in Row names - modifies names first .. last-1.

void ClpModel::copyColumnNames ( const char *const *  columnNames,
int  first,
int  last 
)

Copies in Column names - modifies names first .. last-1.

void ClpModel::setRowName ( int  rowIndex,
std::string &  name 
)

Set name of row.

void ClpModel::setColumnName ( int  colIndex,
std::string &  name 
)

Set name of col.

int ClpModel::findNetwork ( char *  rotate,
double  fractionNeeded = 0.75 
)

Find a network subset.

rotate array should be numberRows. On output -1 not in network 0 in network as is 1 in network with signs swapped Returns number of network rows

CoinModel* ClpModel::createCoinModel (  )  const

This creates a coinModel object.

int ClpModel::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.

Row and column names may be null. formatType is

Returns non-zero on I/O error

int ClpModel::numberRows (  )  const [inline]

Number of rows.

Definition at line 309 of file ClpModel.hpp.

References numberRows_.

int ClpModel::getNumRows (  )  const [inline]

Number of rows.

Definition at line 312 of file ClpModel.hpp.

References numberRows_.

int ClpModel::getNumCols (  )  const [inline]

Number of columns.

Definition at line 316 of file ClpModel.hpp.

References numberColumns_.

int ClpModel::numberColumns (  )  const [inline]

Number of rows.

Definition at line 319 of file ClpModel.hpp.

References numberColumns_.

double ClpModel::primalTolerance (  )  const [inline]

Primal tolerance to use.

Definition at line 323 of file ClpModel.hpp.

References ClpPrimalTolerance, and dblParam_.

void ClpModel::setPrimalTolerance ( double  value  ) 

Number of rows.

double ClpModel::dualTolerance (  )  const [inline]

Dual tolerance to use.

Definition at line 328 of file ClpModel.hpp.

References ClpDualTolerance, and dblParam_.

void ClpModel::setDualTolerance ( double  value  ) 

Number of rows.

double ClpModel::primalObjectiveLimit (  )  const [inline]

Primal objective limit.

Definition at line 331 of file ClpModel.hpp.

References ClpPrimalObjectiveLimit, and dblParam_.

void ClpModel::setPrimalObjectiveLimit ( double  value  ) 

Number of rows.

double ClpModel::dualObjectiveLimit (  )  const [inline]

Dual objective limit.

Definition at line 334 of file ClpModel.hpp.

References ClpDualObjectiveLimit, and dblParam_.

void ClpModel::setDualObjectiveLimit ( double  value  ) 

Number of rows.

double ClpModel::objectiveOffset (  )  const [inline]

Objective offset.

Definition at line 337 of file ClpModel.hpp.

References ClpObjOffset, and dblParam_.

void ClpModel::setObjectiveOffset ( double  value  ) 

Number of rows.

std::string ClpModel::problemName (  )  const [inline]

Number of rows.

Definition at line 340 of file ClpModel.hpp.

References ClpProbName, and strParam_.

int ClpModel::numberIterations (  )  const [inline]

Number of iterations.

Definition at line 343 of file ClpModel.hpp.

int ClpModel::getIterationCount (  )  const [inline]

Number of rows.

Definition at line 344 of file ClpModel.hpp.

References numberIterations_.

void ClpModel::setNumberIterations ( int  numberIterations  )  [inline]

Number of rows.

Definition at line 345 of file ClpModel.hpp.

References numberIterations_.

int ClpModel::solveType (  )  const [inline]

Solve type - 1 simplex, 2 simplex interface, 3 Interior.

Definition at line 348 of file ClpModel.hpp.

References solveType_.

void ClpModel::setSolveType ( int  type  )  [inline]

Number of rows.

Definition at line 350 of file ClpModel.hpp.

References solveType_.

int ClpModel::maximumIterations (  )  const [inline]

Maximum number of iterations.

Definition at line 353 of file ClpModel.hpp.

References ClpMaxNumIteration, and intParam_.

void ClpModel::setMaximumIterations ( int  value  ) 

Number of rows.

double ClpModel::maximumSeconds (  )  const [inline]

Maximum time in seconds (from when set called).

Definition at line 356 of file ClpModel.hpp.

References ClpMaxSeconds, and dblParam_.

void ClpModel::setMaximumSeconds ( double  value  ) 

Number of rows.

bool ClpModel::hitMaximumIterations (  )  const

Returns true if hit maximum iterations (or time).

int ClpModel::status (  )  const [inline]

Status of problem: -1 - unknown e.g.

before solve or if postSolve says not optimal 0 - optimal 1 - primal infeasible 2 - dual infeasible 3 - stopped on iterations or time 4 - stopped due to errors 5 - stopped by event handler (virtual int ClpEventHandler::event())

Definition at line 369 of file ClpModel.hpp.

References problemStatus_.

int ClpModel::problemStatus (  )  const [inline]

Number of rows.

Definition at line 370 of file ClpModel.hpp.

References problemStatus_.

void ClpModel::setProblemStatus ( int  problemStatus  )  [inline]

Set problem status.

Definition at line 372 of file ClpModel.hpp.

References problemStatus_.

int ClpModel::secondaryStatus (  )  const [inline]

Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reached OR probably primal infeasible but can't prove it (main status 4) 2 - scaled problem optimal - unscaled problem has primal infeasibilities 3 - scaled problem optimal - unscaled problem has dual infeasibilities 4 - scaled problem optimal - unscaled problem has primal and dual infeasibilities 5 - giving up in primal with flagged variables 6 - failed due to empty problem check 7 - postSolve says not optimal 8 - failed due to bad element check 9 - status was 3 and stopped on time 100 up - translation of enum from ClpEventHandler.

Definition at line 388 of file ClpModel.hpp.

References secondaryStatus_.

void ClpModel::setSecondaryStatus ( int  status  )  [inline]

Number of rows.

Definition at line 389 of file ClpModel.hpp.

References secondaryStatus_.

bool ClpModel::isAbandoned (  )  const [inline]

Are there a numerical difficulties?

Definition at line 392 of file ClpModel.hpp.

References problemStatus_.

bool ClpModel::isProvenOptimal (  )  const [inline]

Is optimality proven?

Definition at line 394 of file ClpModel.hpp.

References problemStatus_.

bool ClpModel::isProvenPrimalInfeasible (  )  const [inline]

Is primal infeasiblity proven?

Definition at line 396 of file ClpModel.hpp.

References problemStatus_.

bool ClpModel::isProvenDualInfeasible (  )  const [inline]

Is dual infeasiblity proven?

Definition at line 398 of file ClpModel.hpp.

References problemStatus_.

bool ClpModel::isPrimalObjectiveLimitReached (  )  const

Is the given primal objective limit reached?

bool ClpModel::isDualObjectiveLimitReached (  )  const

Is the given dual objective limit reached?

bool ClpModel::isIterationLimitReached (  )  const [inline]

Iteration limit reached?

Definition at line 404 of file ClpModel.hpp.

References problemStatus_.

double ClpModel::optimizationDirection (  )  const [inline]

Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.

Definition at line 406 of file ClpModel.hpp.

References optimizationDirection_.

double ClpModel::getObjSense (  )  const [inline]

Number of rows.

Definition at line 409 of file ClpModel.hpp.

References optimizationDirection_.

void ClpModel::setOptimizationDirection ( double  value  ) 

Number of rows.

double* ClpModel::primalRowSolution (  )  const [inline]

Primal row solution.

Definition at line 412 of file ClpModel.hpp.

References rowActivity_.

const double* ClpModel::getRowActivity (  )  const [inline]

Number of rows.

Definition at line 413 of file ClpModel.hpp.

References rowActivity_.

double* ClpModel::primalColumnSolution (  )  const [inline]

Primal column solution.

Definition at line 415 of file ClpModel.hpp.

References columnActivity_.

const double* ClpModel::getColSolution (  )  const [inline]

Number of rows.

Definition at line 416 of file ClpModel.hpp.

References columnActivity_.

void ClpModel::setColSolution ( const double *  input  )  [inline]

Number of rows.

Definition at line 417 of file ClpModel.hpp.

References columnActivity_, and numberColumns_.

double* ClpModel::dualRowSolution (  )  const [inline]

Dual row solution.

Definition at line 420 of file ClpModel.hpp.

References dual_.

const double* ClpModel::getRowPrice (  )  const [inline]

Number of rows.

Definition at line 421 of file ClpModel.hpp.

References dual_.

double* ClpModel::dualColumnSolution (  )  const [inline]

Reduced costs.

Definition at line 423 of file ClpModel.hpp.

References reducedCost_.

const double* ClpModel::getReducedCost (  )  const [inline]

Number of rows.

Definition at line 424 of file ClpModel.hpp.

References reducedCost_.

double* ClpModel::rowLower (  )  const [inline]

Row lower.

Definition at line 426 of file ClpModel.hpp.

References rowLower_.

const double* ClpModel::getRowLower (  )  const [inline]

Number of rows.

Definition at line 427 of file ClpModel.hpp.

References rowLower_.

double* ClpModel::rowUpper (  )  const [inline]

Row upper.

Definition at line 429 of file ClpModel.hpp.

References rowUpper_.

const double* ClpModel::getRowUpper (  )  const [inline]

Number of rows.

Definition at line 430 of file ClpModel.hpp.

References rowUpper_.

void ClpModel::setObjectiveCoefficient ( int  elementIndex,
double  elementValue 
)

Set an objective function coefficient.

Reimplemented in ClpSimplex.

Referenced by setObjCoeff().

void ClpModel::setObjCoeff ( int  elementIndex,
double  elementValue 
) [inline]

Set an objective function coefficient.

Reimplemented in ClpSimplex.

Definition at line 437 of file ClpModel.hpp.

References setObjectiveCoefficient().

void ClpModel::setColumnLower ( int  elementIndex,
double  elementValue 
)

Set a single column lower bound
Use -DBL_MAX for -infinity.

Reimplemented in ClpSimplex.

Referenced by setColLower().

void ClpModel::setColumnUpper ( int  elementIndex,
double  elementValue 
)

Set a single column upper bound
Use DBL_MAX for infinity.

Reimplemented in ClpSimplex.

Referenced by setColUpper().

void ClpModel::setColumnBounds ( int  elementIndex,
double  lower,
double  upper 
)

Set a single column lower and upper bound.

Reimplemented in ClpSimplex.

Referenced by setColBounds().

void ClpModel::setColumnSetBounds ( const int *  indexFirst,
const int *  indexLast,
const double *  boundList 
)

Set the bounds on a number of columns simultaneously
The default implementation just invokes setColLower() and setColUpper() over and over again.

Parameters:
indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes
boundList the new lower/upper bound pairs for the variables

Reimplemented in ClpSimplex.

Referenced by setColSetBounds().

void ClpModel::setColLower ( int  elementIndex,
double  elementValue 
) [inline]

Set a single column lower bound
Use -DBL_MAX for -infinity.

Reimplemented in ClpSimplex.

Definition at line 466 of file ClpModel.hpp.

References setColumnLower().

void ClpModel::setColUpper ( int  elementIndex,
double  elementValue 
) [inline]

Set a single column upper bound
Use DBL_MAX for infinity.

Reimplemented in ClpSimplex.

Definition at line 470 of file ClpModel.hpp.

References setColumnUpper().

void ClpModel::setColBounds ( int  elementIndex,
double  lower,
double  upper 
) [inline]

Set a single column lower and upper bound.

Reimplemented in ClpSimplex.

Definition at line 474 of file ClpModel.hpp.

References setColumnBounds().

void ClpModel::setColSetBounds ( const int *  indexFirst,
const int *  indexLast,
const double *  boundList 
) [inline]

Set the bounds on a number of columns simultaneously
.

Parameters:
indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the variables whose either bound changes
boundList the new lower/upper bound pairs for the variables

Reimplemented in ClpSimplex.

Definition at line 484 of file ClpModel.hpp.

References setColumnSetBounds().

void ClpModel::setRowLower ( int  elementIndex,
double  elementValue 
)

Set a single row lower bound
Use -DBL_MAX for -infinity.

Reimplemented in ClpSimplex.

void ClpModel::setRowUpper ( int  elementIndex,
double  elementValue 
)

Set a single row upper bound
Use DBL_MAX for infinity.

Reimplemented in ClpSimplex.

void ClpModel::setRowBounds ( int  elementIndex,
double  lower,
double  upper 
)

Set a single row lower and upper bound.

Reimplemented in ClpSimplex.

void ClpModel::setRowSetBounds ( const int *  indexFirst,
const int *  indexLast,
const double *  boundList 
)

Set the bounds on a number of rows simultaneously
.

Parameters:
indexFirst,indexLast pointers to the beginning and after the end of the array of the indices of the constraints whose either bound changes
boundList the new lower/upper bound pairs for the constraints

Reimplemented in ClpSimplex.

const double* ClpModel::rowScale (  )  const [inline]

Scaling.

Definition at line 513 of file ClpModel.hpp.

References rowScale_.

const double* ClpModel::columnScale (  )  const [inline]

Definition at line 514 of file ClpModel.hpp.

References columnScale_.

void ClpModel::setRowScale ( double *  scale  )  [inline]

Definition at line 515 of file ClpModel.hpp.

References rowScale_.

void ClpModel::setColumnScale ( double *  scale  )  [inline]

Definition at line 516 of file ClpModel.hpp.

References columnScale_.

double ClpModel::objectiveScale (  )  const [inline]

Scaling of objective.

Definition at line 518 of file ClpModel.hpp.

References objectiveScale_.

void ClpModel::setObjectiveScale ( double  value  )  [inline]

Definition at line 520 of file ClpModel.hpp.

References objectiveScale_.

double ClpModel::rhsScale (  )  const [inline]

Scaling of rhs and bounds.

Definition at line 523 of file ClpModel.hpp.

References rhsScale_.

void ClpModel::setRhsScale ( double  value  )  [inline]

Definition at line 525 of file ClpModel.hpp.

References rhsScale_.

void ClpModel::scaling ( int  mode = 1  ) 

Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later).

void ClpModel::unscale (  ) 

If we constructed a "really" scaled model then this reverses the operation.

Quantities may not be exactly as they were before due to rounding errors

int ClpModel::scalingFlag (  )  const [inline]

Gets scalingFlag.

Definition at line 533 of file ClpModel.hpp.

References scalingFlag_.

double* ClpModel::objective (  )  const [inline]

Objective.

Definition at line 535 of file ClpModel.hpp.

References ClpObjective::gradient(), and objective_.

double* ClpModel::objective ( const double *  solution,
double &  offset,
bool  refresh = true 
) const [inline]

Definition at line 544 of file ClpModel.hpp.

References ClpObjective::gradient(), and objective_.

const double* ClpModel::getObjCoefficients (  )  const [inline]

Definition at line 553 of file ClpModel.hpp.

References ClpObjective::gradient(), and objective_.

double* ClpModel::rowObjective (  )  const [inline]

Row Objective.

Definition at line 563 of file ClpModel.hpp.

References rowObjective_.

const double* ClpModel::getRowObjCoefficients (  )  const [inline]

Definition at line 564 of file ClpModel.hpp.

References rowObjective_.

double* ClpModel::columnLower (  )  const [inline]

Column Lower.

Definition at line 568 of file ClpModel.hpp.

References columnLower_.

const double* ClpModel::getColLower (  )  const [inline]

Definition at line 569 of file ClpModel.hpp.

References columnLower_.

double* ClpModel::columnUpper (  )  const [inline]

Column Upper.

Definition at line 571 of file ClpModel.hpp.

References columnUpper_.

const double* ClpModel::getColUpper (  )  const [inline]

Definition at line 572 of file ClpModel.hpp.

References columnUpper_.

CoinPackedMatrix* ClpModel::matrix (  )  const [inline]

Matrix (if not ClpPackedmatrix be careful about memory leak.

Definition at line 574 of file ClpModel.hpp.

References ClpMatrixBase::getPackedMatrix(), and matrix_.

Referenced by replaceMatrix().

int ClpModel::getNumElements (  )  const [inline]

Number of elements in matrix.

Definition at line 579 of file ClpModel.hpp.

References ClpMatrixBase::getNumElements(), and matrix_.

double ClpModel::getSmallElementValue (  )  const [inline]

Small element value - elements less than this set to zero, default is 1.0e-20.

Definition at line 583 of file ClpModel.hpp.

References smallElement_.

void ClpModel::setSmallElementValue ( double  value  )  [inline]

Definition at line 585 of file ClpModel.hpp.

References smallElement_.

ClpMatrixBase* ClpModel::rowCopy (  )  const [inline]

Row Matrix.

Definition at line 588 of file ClpModel.hpp.

References rowCopy_.

ClpMatrixBase* ClpModel::clpMatrix (  )  const [inline]

Clp Matrix.

Definition at line 590 of file ClpModel.hpp.

References matrix_.

void ClpModel::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 current.

This was used where matrices were being rotated. ClpModel takes ownership.

Referenced by replaceMatrix().

void ClpModel::replaceMatrix ( CoinPackedMatrix matrix,
bool  deleteCurrent = false 
) [inline]

Replace Clp Matrix (current is not deleted unless told to and new is used) So up to user to delete current.

This was used where matrices were being rotated. This version changes CoinPackedMatrix to ClpPackedMatrix. ClpModel takes ownership.

Definition at line 602 of file ClpModel.hpp.

References matrix(), and replaceMatrix().

double ClpModel::objectiveValue (  )  const [inline]

Objective value.

Definition at line 606 of file ClpModel.hpp.

References ClpObjOffset, dblParam_, objectiveValue_, and optimizationDirection_.

void ClpModel::setObjectiveValue ( double  value  )  [inline]

Definition at line 609 of file ClpModel.hpp.

References ClpObjOffset, dblParam_, objectiveValue_, and optimizationDirection_.

double ClpModel::getObjValue (  )  const [inline]

Definition at line 612 of file ClpModel.hpp.

References ClpObjOffset, dblParam_, objectiveValue_, and optimizationDirection_.

char* ClpModel::integerInformation (  )  const [inline]

Integer information.

Definition at line 616 of file ClpModel.hpp.

References integerType_.

double* ClpModel::infeasibilityRay (  )  const

Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays.

double* ClpModel::unboundedRay (  )  const

bool ClpModel::statusExists (  )  const [inline]

See if status (i.e. basis) array exists (partly for OsiClp).

Definition at line 622 of file ClpModel.hpp.

References status_.

unsigned char* ClpModel::statusArray (  )  const [inline]

Return address of status (i.e. basis) array (char[numberRows+numberColumns]).

Definition at line 625 of file ClpModel.hpp.

References status_.

unsigned char* ClpModel::statusCopy (  )  const

Return copy of status (i.e.

basis) array (char[numberRows+numberColumns]), use delete []

void ClpModel::copyinStatus ( const unsigned char *  statusArray  ) 

Copy in status (basis) vector.

void ClpModel::setUserPointer ( void *  pointer  )  [inline]

User pointer for whatever reason.

Definition at line 634 of file ClpModel.hpp.

References userPointer_.

void* ClpModel::getUserPointer (  )  const [inline]

Definition at line 636 of file ClpModel.hpp.

References userPointer_.

int ClpModel::whatsChanged (  )  const [inline]

What has changed in model (only for masochistic users).

Definition at line 639 of file ClpModel.hpp.

References whatsChanged_.

void ClpModel::setWhatsChanged ( int  value  )  [inline]

Definition at line 641 of file ClpModel.hpp.

References whatsChanged_.

int ClpModel::numberThreads (  )  const [inline]

Number of threads (not really being used).

Definition at line 644 of file ClpModel.hpp.

References numberThreads_.

void ClpModel::setNumberThreads ( int  value  )  [inline]

Definition at line 646 of file ClpModel.hpp.

References numberThreads_.

void ClpModel::passInMessageHandler ( CoinMessageHandler handler  ) 

Pass in Message handler (not deleted at end).

CoinMessageHandler* ClpModel::pushMessageHandler ( CoinMessageHandler handler,
bool &  oldDefault 
)

Pass in Message handler (not deleted at end) and return current.

void ClpModel::popMessageHandler ( CoinMessageHandler oldHandler,
bool  oldDefault 
)

back to previous message handler

void ClpModel::newLanguage ( CoinMessages::Language  language  ) 

Set language.

Referenced by setLanguage().

void ClpModel::setLanguage ( CoinMessages::Language  language  )  [inline]

Pass in Message handler (not deleted at end).

Definition at line 660 of file ClpModel.hpp.

References newLanguage().

CoinMessageHandler* ClpModel::messageHandler (  )  const [inline]

Return handler.

Definition at line 662 of file ClpModel.hpp.

References handler_.

CoinMessages ClpModel::messages (  )  const [inline]

Return messages.

Definition at line 664 of file ClpModel.hpp.

References messages_.

CoinMessages* ClpModel::messagesPointer (  )  [inline]

Return pointer to messages.

Definition at line 666 of file ClpModel.hpp.

References messages_.

CoinMessages ClpModel::coinMessages (  )  const [inline]

Return Coin messages.

Definition at line 668 of file ClpModel.hpp.

References coinMessages_.

CoinMessages* ClpModel::coinMessagesPointer (  )  [inline]

Return pointer to Coin messages.

Definition at line 670 of file ClpModel.hpp.

References coinMessages_.

void ClpModel::setLogLevel ( int  value  )  [inline]

Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - verbose above that 8,16,32 etc just for selective debug.

Definition at line 679 of file ClpModel.hpp.

References handler_, and CoinMessageHandler::setLogLevel().

int ClpModel::logLevel (  )  const [inline]

Pass in Message handler (not deleted at end).

Definition at line 680 of file ClpModel.hpp.

References handler_, and CoinMessageHandler::logLevel().

bool ClpModel::defaultHandler (  )  const [inline]

Return true if default handler.

Definition at line 682 of file ClpModel.hpp.

References defaultHandler_.

void ClpModel::passInEventHandler ( const ClpEventHandler eventHandler  ) 

Pass in Event handler (cloned and deleted at end).

Reimplemented in ClpSimplex.

ClpEventHandler* ClpModel::eventHandler (  )  const [inline]

Event handler.

Definition at line 687 of file ClpModel.hpp.

References eventHandler_.

int ClpModel::lengthNames (  )  const [inline]

length of names (0 means no names0

Definition at line 690 of file ClpModel.hpp.

References lengthNames_.

void ClpModel::setLengthNames ( int  value  )  [inline]

length of names (0 means no names0

Definition at line 693 of file ClpModel.hpp.

const std::vector<std::string>* ClpModel::rowNames (  )  const [inline]

Row names.

Definition at line 695 of file ClpModel.hpp.

const std::string& ClpModel::rowName ( int  iRow  )  const [inline]

Pass in Message handler (not deleted at end).

Definition at line 698 of file ClpModel.hpp.

std::string ClpModel::getRowName ( int  iRow  )  const

Return name or Rnnnnnnn.

const std::vector<std::string>* ClpModel::columnNames (  )  const [inline]

Column names.

Definition at line 704 of file ClpModel.hpp.

const std::string& ClpModel::columnName ( int  iColumn  )  const [inline]

Pass in Message handler (not deleted at end).

Definition at line 707 of file ClpModel.hpp.

std::string ClpModel::getColumnName ( int  iColumn  )  const

Return name or Cnnnnnnn.

ClpObjective* ClpModel::objectiveAsObject (  )  const [inline]

Objective methods.

Definition at line 714 of file ClpModel.hpp.

void ClpModel::setObjective ( ClpObjective objective  ) 

Pass in Message handler (not deleted at end).

void ClpModel::setObjectivePointer ( ClpObjective objective  )  [inline]

Pass in Message handler (not deleted at end).

Definition at line 717 of file ClpModel.hpp.

int ClpModel::emptyProblem ( int *  infeasNumber = NULL,
double *  infeasSum = NULL,
bool  printMessage = true 
)

Solve a problem with no elements - return status and dual and primal infeasibilites.

void ClpModel::times ( double  scalar,
const double *  x,
double *  y 
) const

Return y + A * x * scalar in y.

Precondition:
x must be of size numColumns()

y must be of size numRows()

void ClpModel::transposeTimes ( double  scalar,
const double *  x,
double *  y 
) const

Return y + x * scalar * A in y.

Precondition:
x must be of size numRows()

y must be of size numColumns()

bool ClpModel::setIntParam ( ClpIntParam  key,
int  value 
)

Set an integer parameter.

bool ClpModel::setDblParam ( ClpDblParam  key,
double  value 
)

Set an double parameter.

bool ClpModel::setStrParam ( ClpStrParam  key,
const std::string &  value 
)

Set an string parameter.

bool ClpModel::getIntParam ( ClpIntParam  key,
int &  value 
) const [inline]

Set an integer parameter.

Definition at line 770 of file ClpModel.hpp.

References ClpLastIntParam.

bool ClpModel::getDblParam ( ClpDblParam  key,
double &  value 
) const [inline]

Set an integer parameter.

Definition at line 779 of file ClpModel.hpp.

References ClpLastDblParam.

bool ClpModel::getStrParam ( ClpStrParam  key,
std::string &  value 
) const [inline]

Set an integer parameter.

Definition at line 789 of file ClpModel.hpp.

References ClpLastStrParam.

void ClpModel::generateCpp ( FILE *  fp  ) 

Create C++ lines to get to current state.

unsigned int ClpModel::specialOptions (  )  const [inline]

Set an integer parameter.

Definition at line 830 of file ClpModel.hpp.

void ClpModel::setSpecialOptions ( unsigned int  value  ) 

Set an integer parameter.

void ClpModel::gutsOfDelete (  )  [protected]

Does most of deletion.

Reimplemented in ClpInterior.

void ClpModel::gutsOfCopy ( const ClpModel rhs,
bool  trueCopy = true 
) [protected]

Does most of copying If trueCopy false then just points to arrays.

void ClpModel::getRowBound ( int  iRow,
double &  lower,
double &  upper 
) const [protected]

gets lower and upper bounds on rows

void ClpModel::gutsOfLoadModel ( int  numberRows,
int  numberColumns,
const double *  collb,
const double *  colub,
const double *  obj,
const double *  rowlb,
const double *  rowub,
const double *  rowObjective = NULL 
) [protected]

puts in format I like - 4 array matrix - may make row copy

void ClpModel::gutsOfScaling (  )  [protected]

Does much of scaling.

double ClpModel::rawObjectiveValue (  )  const [inline, protected]

Objective value - always minimize.

Reimplemented in ClpInterior, and ClpSimplex.

Definition at line 854 of file ClpModel.hpp.

const char* const* ClpModel::rowNamesAsChar (  )  const [protected]

Create row names as char **.

const char* const* ClpModel::columnNamesAsChar (  )  const [protected]

Create column names as char **.

void ClpModel::deleteNamesAsChar ( const char *const *  names,
int  number 
) const [protected]

Delete char * version of names.

void ClpModel::onStopped (  )  [protected]

On stopped - sets secondary status.


Member Data Documentation

double ClpModel::optimizationDirection_ [protected]

Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.

Definition at line 874 of file ClpModel.hpp.

Referenced by getObjSense(), getObjValue(), objectiveValue(), optimizationDirection(), and setObjectiveValue().

double ClpModel::dblParam_[ClpLastDblParam] [protected]

Array of double parameters.

Definition at line 876 of file ClpModel.hpp.

Referenced by dualObjectiveLimit(), dualTolerance(), getObjValue(), maximumSeconds(), objectiveOffset(), objectiveValue(), primalObjectiveLimit(), primalTolerance(), and setObjectiveValue().

double ClpModel::objectiveValue_ [protected]

Objective value.

Definition at line 878 of file ClpModel.hpp.

Referenced by getObjValue(), objectiveValue(), ClpSimplex::rawObjectiveValue(), ClpInterior::rawObjectiveValue(), and setObjectiveValue().

double ClpModel::smallElement_ [protected]

Small element value.

Definition at line 880 of file ClpModel.hpp.

Referenced by getSmallElementValue(), and setSmallElementValue().

double ClpModel::objectiveScale_ [protected]

Scaling of objective.

Definition at line 882 of file ClpModel.hpp.

Referenced by objectiveScale(), and setObjectiveScale().

double ClpModel::rhsScale_ [protected]

Scaling of rhs and bounds.

Definition at line 884 of file ClpModel.hpp.

Referenced by rhsScale(), and setRhsScale().

int ClpModel::numberRows_ [protected]

Number of rows.

Definition at line 886 of file ClpModel.hpp.

Referenced by getNumRows(), and numberRows().

int ClpModel::numberColumns_ [protected]

Number of columns.

Definition at line 888 of file ClpModel.hpp.

Referenced by getNumCols(), ClpSimplex::getRowStatus(), ClpSimplex::isColumn(), ClpInterior::isColumn(), numberColumns(), ClpSimplex::originalLower(), ClpSimplex::originalUpper(), ClpSimplex::sequenceWithin(), ClpInterior::sequenceWithin(), setColSolution(), and ClpSimplex::setRowStatus().

double* ClpModel::rowActivity_ [protected]

Row activities.

Definition at line 890 of file ClpModel.hpp.

Referenced by getRowActivity(), and primalRowSolution().

double* ClpModel::columnActivity_ [protected]

Column activities.

Definition at line 892 of file ClpModel.hpp.

Referenced by getColSolution(), primalColumnSolution(), and setColSolution().

double* ClpModel::dual_ [protected]

Duals.

Definition at line 894 of file ClpModel.hpp.

Referenced by dualRowSolution(), and getRowPrice().

double* ClpModel::reducedCost_ [protected]

Reduced costs.

Definition at line 896 of file ClpModel.hpp.

Referenced by dualColumnSolution(), and getReducedCost().

double* ClpModel::rowLower_ [protected]

Row lower.

Definition at line 898 of file ClpModel.hpp.

Referenced by getRowLower(), ClpSimplex::originalLower(), and rowLower().

double* ClpModel::rowUpper_ [protected]

Row upper.

Definition at line 900 of file ClpModel.hpp.

Referenced by getRowUpper(), ClpSimplex::originalUpper(), and rowUpper().

ClpObjective* ClpModel::objective_ [protected]

Objective.

Definition at line 902 of file ClpModel.hpp.

Referenced by getObjCoefficients(), and objective().

double* ClpModel::rowObjective_ [protected]

Row Objective (? sign) - may be NULL.

Definition at line 904 of file ClpModel.hpp.

Referenced by getRowObjCoefficients(), and rowObjective().

double* ClpModel::columnLower_ [protected]

Column Lower.

Definition at line 906 of file ClpModel.hpp.

Referenced by columnLower(), getColLower(), and ClpSimplex::originalLower().

double* ClpModel::columnUpper_ [protected]

Column Upper.

Definition at line 908 of file ClpModel.hpp.

Referenced by columnUpper(), getColUpper(), and ClpSimplex::originalUpper().

ClpMatrixBase* ClpModel::matrix_ [protected]

Packed matrix.

Definition at line 910 of file ClpModel.hpp.

Referenced by clpMatrix(), getNumElements(), matrix(), and modifyCoefficient().

ClpMatrixBase* ClpModel::rowCopy_ [protected]

Row copy if wanted.

Definition at line 912 of file ClpModel.hpp.

Referenced by rowCopy().

double* ClpModel::ray_ [protected]

Infeasible/unbounded ray.

Definition at line 914 of file ClpModel.hpp.

double* ClpModel::rowScale_ [protected]

Row scale factors for matrix.

Definition at line 916 of file ClpModel.hpp.

Referenced by rowScale(), and setRowScale().

double* ClpModel::columnScale_ [protected]

Column scale factors.

Definition at line 918 of file ClpModel.hpp.

Referenced by columnScale(), and setColumnScale().

int ClpModel::scalingFlag_ [protected]

Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic.

Definition at line 920 of file ClpModel.hpp.

Referenced by scalingFlag().

unsigned char* ClpModel::status_ [protected]

Status (i.e.

basis) Region. I know that not all algorithms need a status array, but it made sense for things like crossover and put all permanent stuff in one place. No assumption is made about what is in status array (although it might be good to reserve bottom 3 bits (i.e. 0-7 numeric) for classic status). This is number of columns + number of rows long (in that order).

Definition at line 928 of file ClpModel.hpp.

Referenced by ClpSimplex::active(), ClpSimplex::clearActive(), ClpInterior::clearFakeLower(), ClpInterior::clearFakeUpper(), ClpInterior::clearFixed(), ClpInterior::clearFixedOrFree(), ClpSimplex::clearFlagged(), ClpInterior::clearFlagged(), ClpInterior::clearLowerBound(), ClpSimplex::clearPivoted(), ClpInterior::clearUpperBound(), ClpInterior::fakeLower(), ClpInterior::fakeUpper(), ClpInterior::fixed(), ClpInterior::fixedOrFree(), ClpSimplex::flagged(), ClpInterior::flagged(), ClpSimplex::getColumnStatus(), ClpSimplex::getFakeBound(), ClpSimplex::getRowStatus(), ClpSimplex::getStatus(), ClpInterior::lowerBound(), ClpSimplex::pivoted(), ClpSimplex::setActive(), ClpSimplex::setColumnStatus(), ClpSimplex::setFakeBound(), ClpInterior::setFakeLower(), ClpInterior::setFakeUpper(), ClpInterior::setFixed(), ClpInterior::setFixedOrFree(), ClpInterior::setFlagged(), ClpInterior::setLowerBound(), ClpSimplex::setPivoted(), ClpSimplex::setRowStatus(), ClpSimplex::setStatus(), ClpInterior::setUpperBound(), statusArray(), statusExists(), and ClpInterior::upperBound().

char* ClpModel::integerType_ [protected]

Integer information.

Definition at line 930 of file ClpModel.hpp.

Referenced by integerInformation().

void* ClpModel::userPointer_ [protected]

User pointer for whatever reason.

Definition at line 932 of file ClpModel.hpp.

Referenced by getUserPointer(), and setUserPointer().

int ClpModel::intParam_[ClpLastIntParam] [protected]

Array of integer parameters.

Definition at line 934 of file ClpModel.hpp.

Referenced by maximumIterations().

int ClpModel::numberIterations_ [protected]

Number of iterations.

Definition at line 936 of file ClpModel.hpp.

Referenced by getIterationCount(), and setNumberIterations().

int ClpModel::solveType_ [protected]

Solve type - 1 simplex, 2 simplex interface, 3 Interior.

Definition at line 938 of file ClpModel.hpp.

Referenced by setSolveType(), and solveType().

unsigned int ClpModel::whatsChanged_ [protected]

Whats changed since last solve.

This is a work in progress It is designed so careful people can make go faster. It is only used when startFinishOptions used in dual or primal. Bit 1 - number of rows/columns has not changed (so work arrays valid) 2 - matrix has not changed 4 - if matrix has changed only by adding rows 8 - if matrix has changed only by adding columns 16 - row lbs not changed 32 - row ubs not changed 64 - column objective not changed 128 - column lbs not changed 256 - column ubs not changed 512 - basis not changed (up to user to set this to 0) top bits may be used internally

Definition at line 954 of file ClpModel.hpp.

Referenced by setWhatsChanged(), and whatsChanged().

int ClpModel::problemStatus_ [protected]

Status of problem.

Definition at line 956 of file ClpModel.hpp.

Referenced by isAbandoned(), isIterationLimitReached(), isProvenDualInfeasible(), isProvenOptimal(), isProvenPrimalInfeasible(), problemStatus(), setProblemStatus(), and status().

int ClpModel::secondaryStatus_ [protected]

Secondary status of problem.

Definition at line 958 of file ClpModel.hpp.

Referenced by secondaryStatus(), and setSecondaryStatus().

int ClpModel::lengthNames_ [protected]

length of names (0 means no names)

Definition at line 960 of file ClpModel.hpp.

Referenced by lengthNames().

int ClpModel::numberThreads_ [protected]

Number of threads (not very operational).

Definition at line 962 of file ClpModel.hpp.

Referenced by numberThreads(), and setNumberThreads().

unsigned int ClpModel::specialOptions_ [protected]

For advanced options See get and set for meaning.

Definition at line 966 of file ClpModel.hpp.

CoinMessageHandler* ClpModel::handler_ [protected]

Message handler.

Definition at line 968 of file ClpModel.hpp.

Referenced by logLevel(), messageHandler(), and setLogLevel().

bool ClpModel::defaultHandler_ [protected]

Flag to say if default handler (so delete).

Definition at line 970 of file ClpModel.hpp.

Referenced by defaultHandler().

ClpEventHandler* ClpModel::eventHandler_ [protected]

Event handler.

Definition at line 972 of file ClpModel.hpp.

Referenced by eventHandler().

std::vector<std::string> ClpModel::rowNames_ [protected]

Row names.

Definition at line 975 of file ClpModel.hpp.

std::vector<std::string> ClpModel::columnNames_ [protected]

Column names.

Definition at line 977 of file ClpModel.hpp.

CoinMessages ClpModel::messages_ [protected]

Messages.

Definition at line 980 of file ClpModel.hpp.

Referenced by messages(), and messagesPointer().

CoinMessages ClpModel::coinMessages_ [protected]

Coin messages.

Definition at line 982 of file ClpModel.hpp.

Referenced by coinMessages(), and coinMessagesPointer().

std::string ClpModel::strParam_[ClpLastStrParam] [protected]

Array of string parameters.

Definition at line 985 of file ClpModel.hpp.

Referenced by problemName().


The documentation for this class was generated from the following file:
Generated on Fri Oct 26 03:02:38 2007 by  doxygen 1.4.7