Cbc
2.8.12
|
#include <CbcGenCtlBlk.hpp>
Classes | |
struct | babState_struct |
State of branch-and-cut. More... | |
struct | cbcParamsInfo_struct |
Start and end of CbcModel parameters in parameter vector. More... | |
struct | chooseStrongCtl_struct |
Control variables for a strong branching method. More... | |
struct | debugSolInfo_struct |
Array of primal variable values for debugging. More... | |
struct | djFixCtl_struct |
Control use of reduced cost fixing prior to B&C. More... | |
struct | genParamsInfo_struct |
Start and end of cbc-generic parameters in parameter vector. More... | |
struct | osiParamsInfo_struct |
Start and end of OsiSolverInterface parameters in parameter vector. More... | |
Public Types | |
Enumeration types used for cbc-generic control variables | |
enum | IPPControl { IPPOff = 0, IPPOn, IPPSave, IPPEqual, IPPSOS, IPPTrySOS, IPPEqualAll, IPPStrategy } |
Codes to control integer preprocessing. More... | |
enum | CGControl { CGOff, CGOn, CGRoot, CGIfMove, CGForceOn, CGForceBut, CGMarker } |
Codes to control the use of cut generators and heuristics. More... | |
enum | BPControl { BPOff, BPCost, BPOrder, BPExt } |
Codes to specify the assignment of branching priorities. More... | |
enum | BACMajor { BACInvalid = -1, BACFinish = 0, BACStop = 1, BACAbandon = 2, BACNotRun, BACUser = 5 } |
Major status codes for branch-and-cut. More... | |
enum | BACMinor { BACmInvalid = -1, BACmFinish = 0, BACmInfeas, BACmUbnd, BACmGap, BACmNodeLimit, BACmTimeLimit, BACmSolnLimit, BACmUser, BACmOther } |
Minor status codes. More... | |
enum | BACWhere { BACwInvalid = -1, BACwNotStarted = 0, BACwBareRoot, BACwIPP, BACwIPPRelax, BACwBAC } |
Codes to specify where branch-and-cut stopped. More... | |
Public Member Functions | |
Constructors and destructors | |
CbcGenCtlBlk () | |
Default constructor. More... | |
~CbcGenCtlBlk () | |
Destructor. More... | |
Access and Control Functions for Cut Generators and Heuristics | |
Control functions, plus lazy creation functions for cut generators and heuristics cbc-generic avoids creating objects for cut generators and heuristics unless they're actually used. For cut generators, a prototype is created and reused. For heuristics, the default is to create a new object with each call, because the model may have changed. The object is returned through the reference parameter. The return value of the function is the current action state. Cut generator and heuristic objects created by these calls will be deleted with the destruction of the CbcGenCtlBlk object. | |
int | getCutDepth () |
Get cut depth setting. More... | |
void | setCutDepth (int cutDepth) |
Set cut depth setting. More... | |
IPPControl | getIPPAction () |
void | setIPPAction (IPPControl action) |
Set action state for use of integer preprocessing. More... | |
CGControl | getProbing (CglCutGenerator *&gen) |
Obtain a prototype for a probing cut generator. More... | |
void | setProbingAction (CGControl action) |
Set action state for use of probing cut generator. More... | |
CGControl | getClique (CglCutGenerator *&gen) |
Obtain a prototype for a clique cut generator. More... | |
void | setCliqueAction (CGControl action) |
Set action state for use of clique cut generator. More... | |
CGControl | getFlow (CglCutGenerator *&gen) |
Obtain a prototype for a flow cover cut generator. More... | |
void | setFlowAction (CGControl action) |
Set action state for use of flow cover cut generator. More... | |
CGControl | getGomory (CglCutGenerator *&gen) |
Obtain a prototype for a Gomory cut generator. More... | |
void | setGomoryAction (CGControl action) |
Set action state for use of Gomory cut generator. More... | |
CGControl | getKnapsack (CglCutGenerator *&gen) |
Obtain a prototype for a knapsack cover cut generator. More... | |
void | setKnapsackAction (CGControl action) |
Set action state for use of knapsack cut generator. More... | |
CGControl | getMir (CglCutGenerator *&gen) |
Obtain a prototype for a mixed integer rounding (MIR) cut generator. More... | |
void | setMirAction (CGControl action) |
Set action state for use of MIR cut generator. More... | |
CGControl | getRedSplit (CglCutGenerator *&gen) |
Obtain a prototype for a reduce and split cut generator. More... | |
void | setRedSplitAction (CGControl action) |
Set action state for use of reduce and split cut generator. More... | |
CGControl | getTwomir (CglCutGenerator *&gen) |
Obtain a prototype for a 2-MIR cut generator. More... | |
void | setTwomirAction (CGControl action) |
Set action state for use of 2-MIR cut generator. More... | |
CGControl | getFPump (CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true) |
Obtain a feasibility pump heuristic. More... | |
void | setFPumpAction (CGControl action) |
Set action state for use of feasibility pump heuristic. More... | |
CGControl | getCombine (CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true) |
Obtain a local search/combine heuristic. More... | |
void | setCombineAction (CGControl action) |
Set action state for use of local search/combine heuristic. More... | |
CGControl | getGreedyCover (CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true) |
Obtain a greedy cover heuristic. More... | |
void | setGreedyCoverAction (CGControl action) |
Set action state for use of greedy cover heuristic. More... | |
CGControl | getGreedyEquality (CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true) |
Obtain a greedy equality heuristic. More... | |
void | setGreedyEqualityAction (CGControl action) |
Set action state for use of greedy equality heuristic. More... | |
CGControl | getRounding (CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true) |
Obtain a simple rounding heuristic. More... | |
void | setRoundingAction (CGControl action) |
Set action state for use of simple rounding heuristic. More... | |
CGControl | getTreeLocal (CbcTreeLocal *&localTree, CbcModel *model, bool alwaysCreate=true) |
Obtain a local search tree object. More... | |
void | setTreeLocalAction (CGControl action) |
Set action state for use of local tree. More... | |
Status Functions | |
Convenience routines for status codes. | |
void | setBaBStatus (BACMajor majorStatus, BACMinor minorStatus, BACWhere where, bool haveAnswer, OsiSolverInterface *answerSolver) |
Set the result of branch-and-cut search. More... | |
void | setBaBStatus (const CbcModel *model, BACWhere where, bool haveAnswer=false, OsiSolverInterface *answerSolver=0) |
Set the result of branch-and-cut search. More... | |
BACMajor | translateMajor (int status) |
Translate CbcModel major status to BACMajor. More... | |
BACMinor | translateMinor (int status) |
Translate CbcModel minor status to BACMinor. More... | |
BACMinor | translateMinor (const OsiSolverInterface *osi) |
Translate OsiSolverInterface status to BACMinor. More... | |
void | printBaBStatus () |
Print the status block. More... | |
Public Attributes | |
Parameter parsing and input/output. | |
std::string | version_ |
cbc-generic version More... | |
std::string | dfltDirectory_ |
Default directory prefix. More... | |
std::string | lastMpsIn_ |
Last MPS input file. More... | |
bool | allowImportErrors_ |
Allow/disallow errors when importing a model. More... | |
std::string | lastSolnOut_ |
Last solution output file. More... | |
int | printMode_ |
Solution printing mode. More... | |
std::string | printMask_ |
Print mask. More... | |
CoinParamVec * | paramVec_ |
The parameter vector. More... | |
struct CbcGenCtlBlk::genParamsInfo_struct | genParams_ |
struct CbcGenCtlBlk::cbcParamsInfo_struct | cbcParams_ |
struct CbcGenCtlBlk::osiParamsInfo_struct | osiParams_ |
int | verbose_ |
Verbosity level for help messages. More... | |
int | paramsProcessed_ |
Number of parameters processed. More... | |
std::vector< bool > | setByUser_ |
Record of parameters changed by user command. More... | |
bool | defaultSettings_ |
False if the user has made nontrivial modifications to the default control settings. More... | |
std::string | debugCreate_ |
Control debug file creation. More... | |
std::string | debugFile_ |
Last debug input file. More... | |
struct CbcGenCtlBlk::debugSolInfo_struct | debugSol_ |
double | totalTime_ |
Total elapsed time for this run. More... | |
Models of various flavours | |
CbcModel * | model_ |
The reference CbcModel object. More... | |
OsiSolverInterface * | dfltSolver_ |
The current default LP solver. More... | |
bool | goodModel_ |
True if we have a valid model loaded, false otherwise. More... | |
struct CbcGenCtlBlk::babState_struct | bab_ |
Various algorithm control variables and settings | |
struct CbcGenCtlBlk::djFixCtl_struct | djFix_ |
BPControl | priorityAction_ |
Control the assignment of branching priorities to integer variables. More... | |
Branching Method Control | |
Usage control and prototypes for branching methods. Looking to the future, this covers only OsiChoose methods. | |
struct CbcGenCtlBlk::chooseStrongCtl_struct | chooseStrong_ |
Friends | |
void | CbcGenParamUtils::addCbcGenParams (int &numParams, CoinParamVec ¶mVec, CbcGenCtlBlk *ctlBlk) |
Messages and statistics | |
int | printOpt_ |
When greater than 0, integer presolve gives more information and branch-and-cut provides statistics. More... | |
CoinMessageHandler & | message (CbcGenMsgCode inID) |
Print a message. More... | |
void | passInMessageHandler (CoinMessageHandler *handler) |
Supply a new message handler. More... | |
CoinMessageHandler * | messageHandler () const |
Return a pointer to the message handler. More... | |
void | setMessages (CoinMessages::Language lang=CoinMessages::us_en) |
Set up messages in the specified language. More... | |
void | setLogLevel (int lvl) |
Set log level. More... | |
int | logLevel () const |
Get log level. More... | |
Definition at line 67 of file CbcGenCtlBlk.hpp.
Codes to control integer preprocessing.
IPPSOS will create SOS sets if all binary variables (except perhaps one) can be covered by SOS sets with no overlap between sets. IPPTrySOS will allow any number of binary variables to be uncovered.
Enumerator | |
---|---|
IPPOff | |
IPPOn | |
IPPSave | |
IPPEqual | |
IPPSOS | |
IPPTrySOS | |
IPPEqualAll | |
IPPStrategy |
Definition at line 99 of file CbcGenCtlBlk.hpp.
Codes to control the use of cut generators and heuristics.
The same codes are used for heuristics.
Enumerator | |
---|---|
CGOff | |
CGOn | |
CGRoot | |
CGIfMove | |
CGForceOn | |
CGForceBut | |
CGMarker |
Definition at line 129 of file CbcGenCtlBlk.hpp.
Codes to specify the assignment of branching priorities.
Enumerator | |
---|---|
BPOff | |
BPCost | |
BPOrder | |
BPExt |
Definition at line 141 of file CbcGenCtlBlk.hpp.
Major status codes for branch-and-cut.
Consult minorStatus_ for details.
These codes are (mostly) set to match the codes used by CbcModel. Additions to CbcModel codes should be reflected here and in translateMajor.
Enumerator | |
---|---|
BACInvalid | |
BACFinish | |
BACStop | |
BACAbandon | |
BACNotRun | |
BACUser |
Definition at line 158 of file CbcGenCtlBlk.hpp.
Minor status codes.
It's not possible to make these codes agree with CbcModel. The meaning varies according to context: if the BACWhere code specifies a relaxation, then the minor status reflects the underlying OSI solver. Otherwise, it reflects the integer problem.
Enumerator | |
---|---|
BACmInvalid | |
BACmFinish | |
BACmInfeas | |
BACmUbnd | |
BACmGap | |
BACmNodeLimit | |
BACmTimeLimit | |
BACmSolnLimit | |
BACmUser | |
BACmOther |
Definition at line 181 of file CbcGenCtlBlk.hpp.
Codes to specify where branch-and-cut stopped.
Enumerator | |
---|---|
BACwInvalid | |
BACwNotStarted | |
BACwBareRoot | |
BACwIPP | |
BACwIPPRelax | |
BACwBAC |
Definition at line 195 of file CbcGenCtlBlk.hpp.
CbcGenCtlBlk::CbcGenCtlBlk | ( | ) |
Default constructor.
CbcGenCtlBlk::~CbcGenCtlBlk | ( | ) |
Destructor.
|
inline |
Get cut depth setting.
The name is a bit of a misnomer. Essentially, this overrides the `every so many nodes' control with `execute when (depth in tree) mod (cut depth) == 0'.
Definition at line 236 of file CbcGenCtlBlk.hpp.
|
inline |
Set cut depth setting.
See comments for getCutDepth().
Definition at line 245 of file CbcGenCtlBlk.hpp.
|
inline |
Definition at line 251 of file CbcGenCtlBlk.hpp.
|
inline |
Set action state for use of integer preprocessing.
Definition at line 257 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getProbing | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a probing cut generator.
|
inline |
Set action state for use of probing cut generator.
Definition at line 267 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getClique | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a clique cut generator.
|
inline |
Set action state for use of clique cut generator.
Definition at line 277 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getFlow | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a flow cover cut generator.
|
inline |
Set action state for use of flow cover cut generator.
Definition at line 287 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getGomory | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a Gomory cut generator.
|
inline |
Set action state for use of Gomory cut generator.
Definition at line 297 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getKnapsack | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a knapsack cover cut generator.
|
inline |
Set action state for use of knapsack cut generator.
Definition at line 307 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getMir | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a mixed integer rounding (MIR) cut generator.
|
inline |
Set action state for use of MIR cut generator.
Definition at line 329 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getRedSplit | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a reduce and split cut generator.
|
inline |
Set action state for use of reduce and split cut generator.
Definition at line 339 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getTwomir | ( | CglCutGenerator *& | gen | ) |
Obtain a prototype for a 2-MIR cut generator.
|
inline |
Set action state for use of 2-MIR cut generator.
Definition at line 349 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getFPump | ( | CbcHeuristic *& | gen, |
CbcModel * | model, | ||
bool | alwaysCreate = true |
||
) |
Obtain a feasibility pump heuristic.
By default, any existing object is deleted and a new object is created and loaded with model
. Set alwaysCreate = false to return an existing object if one exists.
|
inline |
Set action state for use of feasibility pump heuristic.
Definition at line 366 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getCombine | ( | CbcHeuristic *& | gen, |
CbcModel * | model, | ||
bool | alwaysCreate = true |
||
) |
Obtain a local search/combine heuristic.
By default, any existing object is deleted and a new object is created and loaded with model
. Set alwaysCreate = false to return an existing object if one exists.
|
inline |
Set action state for use of local search/combine heuristic.
Definition at line 382 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getGreedyCover | ( | CbcHeuristic *& | gen, |
CbcModel * | model, | ||
bool | alwaysCreate = true |
||
) |
Obtain a greedy cover heuristic.
By default, any existing object is deleted and a new object is created and loaded with model
. Set alwaysCreate = false to return an existing object if one exists.
|
inline |
Set action state for use of greedy cover heuristic.
Definition at line 398 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getGreedyEquality | ( | CbcHeuristic *& | gen, |
CbcModel * | model, | ||
bool | alwaysCreate = true |
||
) |
Obtain a greedy equality heuristic.
By default, any existing object is deleted and a new object is created and loaded with model
. Set alwaysCreate = false to return an existing object if one exists.
|
inline |
Set action state for use of greedy equality heuristic.
Definition at line 414 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getRounding | ( | CbcHeuristic *& | gen, |
CbcModel * | model, | ||
bool | alwaysCreate = true |
||
) |
Obtain a simple rounding heuristic.
By default, any existing object is deleted and a new object is created and loaded with model
. Set alwaysCreate = false to return an existing object if one exists.
|
inline |
Set action state for use of simple rounding heuristic.
Definition at line 430 of file CbcGenCtlBlk.hpp.
CGControl CbcGenCtlBlk::getTreeLocal | ( | CbcTreeLocal *& | localTree, |
CbcModel * | model, | ||
bool | alwaysCreate = true |
||
) |
Obtain a local search tree object.
By default, any existing object is deleted and a new object is created and loaded with model
. Set alwaysCreate = false to return an existing object if one exists.
|
inline |
Set action state for use of local tree.
Definition at line 446 of file CbcGenCtlBlk.hpp.
|
inline |
Set the result of branch-and-cut search.
Definition at line 459 of file CbcGenCtlBlk.hpp.
void CbcGenCtlBlk::setBaBStatus | ( | const CbcModel * | model, |
BACWhere | where, | ||
bool | haveAnswer = false , |
||
OsiSolverInterface * | answerSolver = 0 |
||
) |
Set the result of branch-and-cut search.
This version will extract the necessary information from the CbcModel object and set appropriate status based on the value passed for where.
BACMajor CbcGenCtlBlk::translateMajor | ( | int | status | ) |
BACMinor CbcGenCtlBlk::translateMinor | ( | int | status | ) |
BACMinor CbcGenCtlBlk::translateMinor | ( | const OsiSolverInterface * | osi | ) |
void CbcGenCtlBlk::printBaBStatus | ( | ) |
Print the status block.
CoinMessageHandler& CbcGenCtlBlk::message | ( | CbcGenMsgCode | inID | ) |
Print a message.
Uses the current message handler and messages.
void CbcGenCtlBlk::passInMessageHandler | ( | CoinMessageHandler * | handler | ) |
Supply a new message handler.
Replaces the current message handler. The current handler is destroyed if ourMsgHandler_ is true, and the call will set ourMsgHandler_ = true.
|
inline |
Return a pointer to the message handler.
Definition at line 520 of file CbcGenCtlBlk.hpp.
void CbcGenCtlBlk::setMessages | ( | CoinMessages::Language | lang = CoinMessages::us_en | ) |
Set up messages in the specified language.
Building a set of messages in a given language implies rebuilding the whole set of messages, for reasons explained in the body of the code. Hence there's no separate setLanguage routine. Use this routine for the initial setup of messages and any subsequent change in language. Note that the constructor gives you a message handler by default, but not messages. You need to call setMessages explicitly.
The default value specified here for lang effectively sets the default language.
|
inline |
Set log level.
Definition at line 539 of file CbcGenCtlBlk.hpp.
|
inline |
Get log level.
Definition at line 545 of file CbcGenCtlBlk.hpp.
|
friend |
int CbcGenCtlBlk::printOpt_ |
When greater than 0, integer presolve gives more information and branch-and-cut provides statistics.
Definition at line 552 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::version_ |
cbc-generic version
Definition at line 560 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::dfltDirectory_ |
Default directory prefix.
Definition at line 564 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::lastMpsIn_ |
Last MPS input file.
Definition at line 568 of file CbcGenCtlBlk.hpp.
bool CbcGenCtlBlk::allowImportErrors_ |
Allow/disallow errors when importing a model.
Definition at line 571 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::lastSolnOut_ |
Last solution output file.
Definition at line 575 of file CbcGenCtlBlk.hpp.
int CbcGenCtlBlk::printMode_ |
Solution printing mode.
Controls the amount of information printed when printing a solution. Coding is set by the keyword declarations for the printingOptions command.
Definition at line 583 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::printMask_ |
Print mask.
Used to specify row/column names to be printed. Not implemented as of 060920.
Definition at line 590 of file CbcGenCtlBlk.hpp.
CoinParamVec* CbcGenCtlBlk::paramVec_ |
The parameter vector.
Definition at line 594 of file CbcGenCtlBlk.hpp.
struct CbcGenCtlBlk::genParamsInfo_struct CbcGenCtlBlk::genParams_ |
struct CbcGenCtlBlk::cbcParamsInfo_struct CbcGenCtlBlk::cbcParams_ |
struct CbcGenCtlBlk::osiParamsInfo_struct CbcGenCtlBlk::osiParams_ |
int CbcGenCtlBlk::verbose_ |
Verbosity level for help messages.
Interpretation is bitwise:
Definition at line 628 of file CbcGenCtlBlk.hpp.
int CbcGenCtlBlk::paramsProcessed_ |
Number of parameters processed.
Definition at line 632 of file CbcGenCtlBlk.hpp.
std::vector<bool> CbcGenCtlBlk::setByUser_ |
Record of parameters changed by user command.
Definition at line 636 of file CbcGenCtlBlk.hpp.
bool CbcGenCtlBlk::defaultSettings_ |
False if the user has made nontrivial modifications to the default control settings.
Initially true. Specifying DJFIX, TIGHTENFACTOR, or any cut or heuristic parameter will set this to false.
Definition at line 644 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::debugCreate_ |
Control debug file creation.
At the conclusion of branch-and-cut, dump the full solution in a binary format to debug.file in the current directory. When set to "createAfterPre", the solution is dumped before integer presolve transforms are removed. When set to "create", the solution is dumped after integer presolve transforms are backed out.
Definition at line 654 of file CbcGenCtlBlk.hpp.
std::string CbcGenCtlBlk::debugFile_ |
Last debug input file.
The file is expected to be in a binary format understood by activateRowCutDebugger.
Definition at line 662 of file CbcGenCtlBlk.hpp.
struct CbcGenCtlBlk::debugSolInfo_struct CbcGenCtlBlk::debugSol_ |
double CbcGenCtlBlk::totalTime_ |
Total elapsed time for this run.
Definition at line 680 of file CbcGenCtlBlk.hpp.
CbcModel* CbcGenCtlBlk::model_ |
The reference CbcModel object.
This is the CbcModel created when cbc-generic boots up. It holds the default solver with the current constraint system. CbcCbcParam parameters are applied here, and CbcOsiParam parameters are applied to the solver. Major modifications for branch-and-cut (integer preprocessing, installation of heuristics and cut generators) are performed on a clone. The solution is transferred back into this object.
Definition at line 697 of file CbcGenCtlBlk.hpp.
OsiSolverInterface* CbcGenCtlBlk::dfltSolver_ |
The current default LP solver.
This is a pointer to a reference copy. If you want the solver associated with model_, ask for it directly.
Definition at line 705 of file CbcGenCtlBlk.hpp.
bool CbcGenCtlBlk::goodModel_ |
True if we have a valid model loaded, false otherwise.
Definition at line 709 of file CbcGenCtlBlk.hpp.
struct CbcGenCtlBlk::babState_struct CbcGenCtlBlk::bab_ |
struct CbcGenCtlBlk::djFixCtl_struct CbcGenCtlBlk::djFix_ |
BPControl CbcGenCtlBlk::priorityAction_ |
Control the assignment of branching priorities to integer variables.
Definition at line 747 of file CbcGenCtlBlk.hpp.
struct CbcGenCtlBlk::chooseStrongCtl_struct CbcGenCtlBlk::chooseStrong_ |