Cbc
2.9.8
|
This allows the use of the standalone solver in a flexible manner. More...
#include <CbcSolver.hpp>
Public Member Functions | |
Solve method | |
int | solve (int argc, const char *argv[], int returnMode) |
This takes a list of commands, does "stuff" and returns returnMode - 0 model and solver untouched - babModel updated 1 model updated - just with solution basis etc 2 model updated i.e. More... | |
int | solve (const char *input, int returnMode) |
This takes a list of commands, does "stuff" and returns returnMode - 0 model and solver untouched - babModel updated 1 model updated - just with solution basis etc 2 model updated i.e. More... | |
Constructors and destructors etc | |
CbcSolver () | |
Default Constructor. More... | |
CbcSolver (const OsiClpSolverInterface &) | |
Constructor from solver. More... | |
CbcSolver (const CbcModel &) | |
Constructor from model. More... | |
CbcSolver (const CbcSolver &rhs) | |
Copy constructor . More... | |
CbcSolver & | operator= (const CbcSolver &rhs) |
Assignment operator. More... | |
~CbcSolver () | |
Destructor. More... | |
void | fillParameters () |
Fill with standard parameters. More... | |
void | fillValuesInSolver () |
Set default values in solvers from parameters. More... | |
void | addUserFunction (CbcUser *function) |
Add user function. More... | |
void | setUserCallBack (CbcStopNow *function) |
Set user call back. More... | |
void | addCutGenerator (CglCutGenerator *generator) |
Add cut generator. More... | |
miscellaneous methods to line up with old | |
int * | analyze (OsiClpSolverInterface *solverMod, int &numberChanged, double &increment, bool changeInt, CoinMessageHandler *generalMessageHandler) |
void | updateModel (ClpSimplex *model2, int returnMode) |
1 - add heuristics to model 2 - do heuristics (and set cutoff and best solution) 3 - for miplib test so skip some (out model later) More... | |
useful stuff | |
int | intValue (CbcOrClpParameterType type) const |
Get int value. More... | |
void | setIntValue (CbcOrClpParameterType type, int value) |
Set int value. More... | |
double | doubleValue (CbcOrClpParameterType type) const |
Get double value. More... | |
void | setDoubleValue (CbcOrClpParameterType type, double value) |
Set double value. More... | |
CbcUser * | userFunction (const char *name) const |
User function (NULL if no match) More... | |
CbcModel * | model () |
Return original Cbc model. More... | |
CbcModel * | babModel () |
Return updated Cbc model. More... | |
int | numberUserFunctions () const |
Number of userFunctions. More... | |
CbcUser ** | userFunctionArray () const |
User function array. More... | |
OsiClpSolverInterface * | originalSolver () const |
Copy of model on initial load (will contain output solutions) More... | |
CoinModel * | originalCoinModel () const |
Copy of model on initial load. More... | |
void | setOriginalSolver (OsiClpSolverInterface *originalSolver) |
Copy of model on initial load (will contain output solutions) More... | |
void | setOriginalCoinModel (CoinModel *originalCoinModel) |
Copy of model on initial load. More... | |
int | numberCutGenerators () const |
Number of cutgenerators. More... | |
CglCutGenerator ** | cutGeneratorArray () const |
Cut generator array. More... | |
double | startTime () const |
Start time. More... | |
void | setPrinting (bool onOff) |
Whether to print to std::cout. More... | |
void | setReadMode (int value) |
Where to start reading commands. More... | |
This allows the use of the standalone solver in a flexible manner.
It has an original OsiClpSolverInterface and CbcModel which it can use repeatedly, e.g., to get a heuristic solution and then start again.
So I [jjf] will need a primitive scripting language which can then call solve and manipulate solution value and solution arrays.
Also provides for user callback functions. Currently two ideas in gestation, CbcUser and CbcStopNow. The latter seems limited to deciding whether or not to stop. The former seems completely general, with a notion of importing and exporting, and a `solve', which should be interpreted as `do whatever this user function does'.
Parameter initialisation is at last centralised in fillParameters().
Definition at line 56 of file CbcSolver.hpp.
CbcSolver::CbcSolver | ( | ) |
Default Constructor.
CbcSolver::CbcSolver | ( | const OsiClpSolverInterface & | ) |
Constructor from solver.
CbcSolver::CbcSolver | ( | const CbcModel & | ) |
Constructor from model.
CbcSolver::CbcSolver | ( | const CbcSolver & | rhs | ) |
Copy constructor .
CbcSolver::~CbcSolver | ( | ) |
Destructor.
int CbcSolver::solve | ( | int | argc, |
const char * | argv[], | ||
int | returnMode | ||
) |
This takes a list of commands, does "stuff" and returns returnMode - 0 model and solver untouched - babModel updated 1 model updated - just with solution basis etc 2 model updated i.e.
as babModel (babModel NULL) (only use without preprocessing)
int CbcSolver::solve | ( | const char * | input, |
int | returnMode | ||
) |
This takes a list of commands, does "stuff" and returns returnMode - 0 model and solver untouched - babModel updated 1 model updated - just with solution basis etc 2 model updated i.e.
as babModel (babModel NULL) (only use without preprocessing)
void CbcSolver::fillParameters | ( | ) |
Fill with standard parameters.
void CbcSolver::fillValuesInSolver | ( | ) |
Set default values in solvers from parameters.
Misleading. The current code actually reads default values from the underlying solvers and installs them as default values for a subset of parameters in #parameters_.
void CbcSolver::addUserFunction | ( | CbcUser * | function | ) |
Add user function.
void CbcSolver::setUserCallBack | ( | CbcStopNow * | function | ) |
Set user call back.
void CbcSolver::addCutGenerator | ( | CglCutGenerator * | generator | ) |
Add cut generator.
int* CbcSolver::analyze | ( | OsiClpSolverInterface * | solverMod, |
int & | numberChanged, | ||
double & | increment, | ||
bool | changeInt, | ||
CoinMessageHandler * | generalMessageHandler | ||
) |
void CbcSolver::updateModel | ( | ClpSimplex * | model2, |
int | returnMode | ||
) |
1 - add heuristics to model 2 - do heuristics (and set cutoff and best solution) 3 - for miplib test so skip some (out model later)
Updates model_ from babModel_ according to returnMode returnMode - 0 model and solver untouched - babModel updated 1 model updated - just with solution basis etc 2 model updated i.e. as babModel (babModel NULL) (only use without preprocessing)
int CbcSolver::intValue | ( | CbcOrClpParameterType | type | ) | const |
Get int value.
void CbcSolver::setIntValue | ( | CbcOrClpParameterType | type, |
int | value | ||
) |
Set int value.
double CbcSolver::doubleValue | ( | CbcOrClpParameterType | type | ) | const |
Get double value.
void CbcSolver::setDoubleValue | ( | CbcOrClpParameterType | type, |
double | value | ||
) |
Set double value.
CbcUser* CbcSolver::userFunction | ( | const char * | name | ) | const |
User function (NULL if no match)
|
inline |
Return original Cbc model.
Definition at line 144 of file CbcSolver.hpp.
|
inline |
Return updated Cbc model.
Definition at line 148 of file CbcSolver.hpp.
|
inline |
Number of userFunctions.
Definition at line 152 of file CbcSolver.hpp.
|
inline |
User function array.
Definition at line 156 of file CbcSolver.hpp.
|
inline |
Copy of model on initial load (will contain output solutions)
Definition at line 160 of file CbcSolver.hpp.
|
inline |
Copy of model on initial load.
Definition at line 164 of file CbcSolver.hpp.
void CbcSolver::setOriginalSolver | ( | OsiClpSolverInterface * | originalSolver | ) |
Copy of model on initial load (will contain output solutions)
void CbcSolver::setOriginalCoinModel | ( | CoinModel * | originalCoinModel | ) |
Copy of model on initial load.
|
inline |
Number of cutgenerators.
Definition at line 172 of file CbcSolver.hpp.
|
inline |
Cut generator array.
Definition at line 176 of file CbcSolver.hpp.
|
inline |
Start time.
Definition at line 180 of file CbcSolver.hpp.
|
inline |
Whether to print to std::cout.
Definition at line 184 of file CbcSolver.hpp.
|
inline |
Where to start reading commands.
Definition at line 188 of file CbcSolver.hpp.