Common CLP Tasks in the Samples

Below is a listing of a number of common CLP tasks, such as loading a problem from an MPS file, matched with a list of each Sample file which illustrates the performance of a given task.

Table 4.4. Contents of the Samples directory

CLP Task(s) Method(s) Sample(s)
Read problem from MPS file

int readMps(const char *filename)

defaults.cpp, driver.cpp, minimum.cpp
Solve by primal method

int primal()

driver.cpp
Choose pivot rule

void setPrimalColumnPivotAlgorithm(ClpPrimalColumnPivot &choice)
void setDualRowPivotAlgorithm(ClpDualRowPivot &choice)

defaults.cpp
Get/set infeasibility cost

void setInfeasibilityCost(double value)
void setInfeasibilityCost(double value)

defaults.cpp
Get string/"double"/integer information

bool getStrParam(ClpStrParam key, std::string &value) const
bool getDblParam(ClpDblParam key, double &value) const
bool  getIntParam (ClpIntParam key, int &value) const 

defaults.cpp
Set maximum number of iterations

void setMaximumIterations(int value)

defaults.cpp
Check solution status

int status() const
bool isAbandoned() const
bool isProvenOptimal() const
bool isProvenPrimalInfeasible() const
bool isProvenDualInfeasible() const
bool isPrimalObjectiveLimitReached() const
bool isDualObjectiveLimitReached() const
bool isIterationLimitReached() const