Cbc
2.10.5
|
Class for control parameters that act on a OsiSolverInterface object. More...
#include <CbcGenOsiParam.hpp>
Public Member Functions | |
Constructors and Destructors | |
Be careful how you specify parameters for the constructors! There's great potential for confusion. | |
CbcOsiParam () | |
Default constructor. More... | |
CbcOsiParam (CbcOsiParamCode code, std::string name, std::string help, double lower, double upper, double dflt=0.0, bool display=true) | |
Constructor for a parameter with a double value. More... | |
CbcOsiParam (CbcOsiParamCode code, std::string name, std::string help, int lower, int upper, int dflt=0, bool display=true) | |
Constructor for a parameter with an integer value. More... | |
CbcOsiParam (CbcOsiParamCode code, std::string name, std::string help, std::string firstValue, int dflt, bool display=true) | |
Constructor for a parameter with keyword values. More... | |
CbcOsiParam (CbcOsiParamCode code, std::string name, std::string help, std::string dflt, bool display=true) | |
Constructor for a string parameter. More... | |
CbcOsiParam (CbcOsiParamCode code, std::string name, std::string help, bool display=true) | |
Constructor for an action parameter. More... | |
CbcOsiParam (const CbcOsiParam &orig) | |
Copy constructor. More... | |
CbcOsiParam * | clone () |
Clone. More... | |
CbcOsiParam & | operator= (const CbcOsiParam &rhs) |
Assignment. More... | |
~CbcOsiParam () | |
Destructor. More... | |
Methods to query and manipulate a parameter object | |
CbcOsiParamCode | paramCode () const |
Get the parameter code. More... | |
void | setParamCode (CbcOsiParamCode code) |
Set the parameter code. More... | |
OsiSolverInterface * | obj () const |
Get the underlying OsiSolverInterface object. More... | |
void | setObj (OsiSolverInterface *obj) |
Set the underlying OsiSolverInterace object. More... | |
![]() | |
CoinParam () | |
Default constructor. More... | |
CoinParam (std::string name, std::string help, double lower, double upper, double dflt=0.0, bool display=true) | |
Constructor for a parameter with a double value. More... | |
CoinParam (std::string name, std::string help, int lower, int upper, int dflt=0, bool display=true) | |
Constructor for a parameter with an integer value. More... | |
CoinParam (std::string name, std::string help, std::string firstValue, int dflt, bool display=true) | |
Constructor for a parameter with keyword values. More... | |
CoinParam (std::string name, std::string help, std::string dflt, bool display=true) | |
Constructor for a string parameter. More... | |
CoinParam (std::string name, std::string help, bool display=true) | |
Constructor for an action parameter. More... | |
CoinParam (const CoinParam &orig) | |
Copy constructor. More... | |
CoinParam & | operator= (const CoinParam &rhs) |
Assignment. More... | |
virtual | ~CoinParam () |
Destructor. More... | |
void | appendKwd (std::string kwd) |
Add an additional value-keyword to a keyword parameter. More... | |
int | kwdIndex (std::string kwd) const |
Return the integer associated with the specified value-keyword. More... | |
std::string | kwdVal () const |
Return the value-keyword that is the current value of the keyword parameter. More... | |
void | setKwdVal (int value, bool printIt=false) |
Set the value of the keyword parameter using the integer associated with a value-keyword. More... | |
void | setKwdVal (const std::string value) |
Set the value of the keyword parameter using a value-keyword string. More... | |
void | printKwds () const |
Prints the set of value-keywords defined for this keyword parameter. More... | |
void | setStrVal (std::string value) |
Set the value of a string parameter. More... | |
std::string | strVal () const |
Get the value of a string parameter. More... | |
void | setDblVal (double value) |
Set the value of a double parameter. More... | |
double | dblVal () const |
Get the value of a double parameter. More... | |
void | setIntVal (int value) |
Set the value of a integer parameter. More... | |
int | intVal () const |
Get the value of a integer parameter. More... | |
void | setShortHelp (const std::string help) |
Add a short help string to a parameter. More... | |
std::string | shortHelp () const |
Retrieve the short help string. More... | |
void | setLongHelp (const std::string help) |
Add a long help message to a parameter. More... | |
std::string | longHelp () const |
Retrieve the long help message. More... | |
void | printLongHelp () const |
Print long help. More... | |
CoinParamType | type () const |
Return the type of the parameter. More... | |
void | setType (CoinParamType type) |
Set the type of the parameter. More... | |
std::string | name () const |
Return the parameter keyword (name) string. More... | |
void | setName (std::string name) |
Set the parameter keyword (name) string. More... | |
int | matches (std::string input) const |
Check if the specified string matches the parameter keyword (name) string. More... | |
std::string | matchName () const |
Return the parameter keyword (name) string formatted to show the minimum match length. More... | |
void | setDisplay (bool display) |
Set visibility of parameter. More... | |
bool | display () const |
Get visibility of parameter. More... | |
CoinParamFunc | pushFunc () |
Get push function. More... | |
void | setPushFunc (CoinParamFunc func) |
Set push function. More... | |
CoinParamFunc | pullFunc () |
Get pull function. More... | |
void | setPullFunc (CoinParamFunc func) |
Set pull function. More... | |
Private Attributes | |
Data | |
CbcOsiParamCode | paramCode_ |
Parameter code. More... | |
OsiSolverInterface * | obj_ |
OsiSolverInterface object. More... | |
Additional Inherited Members | |
![]() | |
typedef std::vector< CoinParam * > | CoinParamVec |
A type for a parameter vector. More... | |
std::ostream & | operator<< (std::ostream &s, const CoinParam ¶m) |
A stream output function for a CoinParam object. More... | |
void | setInputSrc (FILE *src) |
Take command input from the file specified by src. More... | |
bool | isCommandLine () |
Returns true if command line parameters are being processed. More... | |
bool | isInteractive () |
Returns true if parameters are being obtained from stdin. More... | |
std::string | getStringField (int argc, const char *argv[], int *valid) |
Attempt to read a string from the input. More... | |
int | getIntField (int argc, const char *argv[], int *valid) |
Attempt to read an integer from the input. More... | |
double | getDoubleField (int argc, const char *argv[], int *valid) |
Attempt to read a real (double) from the input. More... | |
int | matchParam (const CoinParamVec ¶mVec, std::string name, int &matchNdx, int &shortCnt) |
Scan a parameter vector for parameters whose keyword (name) string matches name using minimal match rules. More... | |
std::string | getCommand (int argc, const char *argv[], const std::string prompt, std::string *pfx=0) |
Get the next command keyword (name) More... | |
int | lookupParam (std::string name, CoinParamVec ¶mVec, int *matchCnt=0, int *shortCnt=0, int *queryCnt=0) |
Look up the command keyword (name) in the parameter vector. Print help if requested. More... | |
void | printIt (const char *msg) |
Utility to print a long message as filled lines of text. More... | |
void | shortOrHelpOne (CoinParamVec ¶mVec, int matchNdx, std::string name, int numQuery) |
Utility routine to print help given a short match or explicit request for help. More... | |
void | shortOrHelpMany (CoinParamVec ¶mVec, std::string name, int numQuery) |
Utility routine to print help given multiple matches. More... | |
void | printGenericHelp () |
Print a generic `how to use the command interface' help message. More... | |
void | printHelp (CoinParamVec ¶mVec, int firstParam, int lastParam, std::string prefix, bool shortHelp, bool longHelp, bool hidden) |
Utility routine to print help messages for one or more parameters. More... | |
Class for control parameters that act on a OsiSolverInterface object.
Adds parameter type codes and push/pull functions to the generic parameter object.
Definition at line 31 of file CbcGenOsiParam.hpp.
Enumeration for parameters that control an OsiSolverInterface object.
These are parameters that control the operation of an OsiSolverInterface object. CBCOSI_FIRSTPARAM and CBCOSI_LASTPARAM are markers to allow convenient separation of parameter groups.
Definition at line 45 of file CbcGenOsiParam.hpp.
CbcOsiParam::CbcOsiParam | ( | ) |
Default constructor.
CbcOsiParam::CbcOsiParam | ( | CbcOsiParamCode | code, |
std::string | name, | ||
std::string | help, | ||
double | lower, | ||
double | upper, | ||
double | dflt = 0.0 , |
||
bool | display = true |
||
) |
Constructor for a parameter with a double value.
The default value is 0.0. Be careful to clearly indicate that lower
and upper
are real (double) values to distinguish this constructor from the constructor for an integer parameter.
CbcOsiParam::CbcOsiParam | ( | CbcOsiParamCode | code, |
std::string | name, | ||
std::string | help, | ||
int | lower, | ||
int | upper, | ||
int | dflt = 0 , |
||
bool | display = true |
||
) |
Constructor for a parameter with an integer value.
The default value is 0.
CbcOsiParam::CbcOsiParam | ( | CbcOsiParamCode | code, |
std::string | name, | ||
std::string | help, | ||
std::string | firstValue, | ||
int | dflt, | ||
bool | display = true |
||
) |
Constructor for a parameter with keyword values.
The string supplied as firstValue
becomes the first keyword. Additional keywords can be added using appendKwd(). Keywords are numbered from zero. It's necessary to specify both the first keyword (firstValue
) and the default keyword index (dflt
) in order to distinguish this constructor from the string and action parameter constructors.
CbcOsiParam::CbcOsiParam | ( | CbcOsiParamCode | code, |
std::string | name, | ||
std::string | help, | ||
std::string | dflt, | ||
bool | display = true |
||
) |
Constructor for a string parameter.
The default string value must be specified explicitly to distinguish a string constructor from an action parameter constructor.
CbcOsiParam::CbcOsiParam | ( | CbcOsiParamCode | code, |
std::string | name, | ||
std::string | help, | ||
bool | display = true |
||
) |
Constructor for an action parameter.
CbcOsiParam::CbcOsiParam | ( | const CbcOsiParam & | orig | ) |
Copy constructor.
CbcOsiParam::~CbcOsiParam | ( | ) |
Destructor.
|
virtual |
Clone.
Reimplemented from CoinParam.
CbcOsiParam& CbcOsiParam::operator= | ( | const CbcOsiParam & | rhs | ) |
Assignment.
|
inline |
Get the parameter code.
Definition at line 180 of file CbcGenOsiParam.hpp.
|
inline |
Set the parameter code.
Definition at line 187 of file CbcGenOsiParam.hpp.
|
inline |
Get the underlying OsiSolverInterface object.
Definition at line 194 of file CbcGenOsiParam.hpp.
|
inline |
Set the underlying OsiSolverInterace object.
Definition at line 201 of file CbcGenOsiParam.hpp.
|
private |
Parameter code.
Definition at line 213 of file CbcGenOsiParam.hpp.
|
private |
OsiSolverInterface object.
Definition at line 216 of file CbcGenOsiParam.hpp.