#include <IpOptionsList.hpp>
Each options is identified by a case-insensitive keyword (tag). Its value is stored internally as a string (always lower case), but for convenience set and get methods are provided to obtain Index and Number type values. For each keyword we also keep track of how often the value of an option has been requested by a get method.
Public Member Functions | |
void | PrintList (std::string &list) const |
Get a string with the list of all options (tag, value, counter). | |
void | PrintUserOptions (std::string &list) const |
Get a string with the list of all options set by the user (tag, value, use/notused). | |
bool | ReadFromStream (const Journalist &jnlst, std::istream &is) |
Read options from the stream is. | |
Constructors/Destructors | |
OptionsList (SmartPtr< RegisteredOptions > reg_options, SmartPtr< Journalist > jnlst) | |
Copy Constructor. | |
OptionsList () | |
Copy Constructor. | |
OptionsList (const OptionsList ©) | |
Copy Constructor. | |
virtual | ~OptionsList () |
Default destructor. | |
void | operator= (const OptionsList &source) |
Overloaded Equals Operator. | |
Get / Set Methods | |
void | SetRegisteredOptions (const SmartPtr< RegisteredOptions > reg_options) |
void | SetJournalist (const SmartPtr< Journalist > jnlst) |
Methods for setting options | |
bool | SetStringValue (const std::string &tag, const std::string &value, bool allow_clobber=true, bool dont_print=false) |
bool | SetNumericValue (const std::string &tag, Number value, bool allow_clobber=true, bool dont_print=false) |
bool | SetIntegerValue (const std::string &tag, Index value, bool allow_clobber=true, bool dont_print=false) |
Methods for retrieving values from the options list. If | |
a tag is not found, the methods return false, and value is set to the default value defined in the registered options. | |
bool | GetStringValue (const std::string &tag, std::string &value, const std::string &prefix) const |
bool | GetEnumValue (const std::string &tag, Index &value, const std::string &prefix) const |
bool | GetBoolValue (const std::string &tag, bool &value, const std::string &prefix) const |
bool | GetNumericValue (const std::string &tag, Number &value, const std::string &prefix) const |
bool | GetIntegerValue (const std::string &tag, Index &value, const std::string &prefix) const |
Classes | |
class | OptionValue |
Class for storing the value and counter for each option in OptionsList. |
OptionsList | ( | SmartPtr< RegisteredOptions > | reg_options, | |
SmartPtr< Journalist > | jnlst | |||
) | [inline] |
Copy Constructor.
OptionsList | ( | ) | [inline] |
Copy Constructor.
OptionsList | ( | const OptionsList & | copy | ) | [inline] |
virtual ~OptionsList | ( | ) | [inline, virtual] |
Default destructor.
void operator= | ( | const OptionsList & | source | ) | [inline] |
void SetRegisteredOptions | ( | const SmartPtr< RegisteredOptions > | reg_options | ) | [inline] |
void SetJournalist | ( | const SmartPtr< Journalist > | jnlst | ) | [inline] |
bool SetStringValue | ( | const std::string & | tag, | |
const std::string & | value, | |||
bool | allow_clobber = true , |
|||
bool | dont_print = false | |||
) |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::J_ERROR, Ipopt::J_MAIN, Ipopt::J_WARNING, Ipopt::OT_Integer, Ipopt::OT_Number, and Ipopt::OT_String.
Referenced by OptionsList::ReadFromStream().
bool SetNumericValue | ( | const std::string & | tag, | |
Number | value, | |||
bool | allow_clobber = true , |
|||
bool | dont_print = false | |||
) |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::J_ERROR, Ipopt::J_MAIN, Ipopt::J_WARNING, Ipopt::OT_Integer, Ipopt::OT_Number, and Ipopt::OT_String.
Referenced by OptionsList::ReadFromStream().
bool SetIntegerValue | ( | const std::string & | tag, | |
Index | value, | |||
bool | allow_clobber = true , |
|||
bool | dont_print = false | |||
) |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::J_ERROR, Ipopt::J_MAIN, Ipopt::J_WARNING, Ipopt::OT_Integer, Ipopt::OT_Number, and Ipopt::OT_String.
Referenced by OptionsList::ReadFromStream().
bool GetStringValue | ( | const std::string & | tag, | |
std::string & | value, | |||
const std::string & | prefix | |||
) | const |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::OT_Integer, Ipopt::OT_Number, Ipopt::OT_String, and THROW_EXCEPTION.
Referenced by AlgorithmBuilder::BuildBasicAlgorithm(), AlgorithmBuilder::BuildIpoptObjects(), and OptionsList::GetBoolValue().
bool GetEnumValue | ( | const std::string & | tag, | |
Index & | value, | |||
const std::string & | prefix | |||
) | const |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::OT_Integer, Ipopt::OT_Number, Ipopt::OT_String, and THROW_EXCEPTION.
Referenced by AlgorithmBuilder::BuildBasicAlgorithm(), RestoIpoptNLP::Initialize(), OrigIpoptNLP::Initialize(), IpoptCalculatedQuantities::Initialize(), QualityFunctionMuOracle::InitializeImpl(), LimMemQuasiNewtonUpdater::InitializeImpl(), IpoptAlgorithm::InitializeImpl(), FilterLSAcceptor::InitializeImpl(), BacktrackingLineSearch::InitializeImpl(), AdaptiveMuUpdate::InitializeImpl(), and TNLPAdapter::ProcessOptions().
bool GetBoolValue | ( | const std::string & | tag, | |
bool & | value, | |||
const std::string & | prefix | |||
) | const |
References OptionsList::GetStringValue(), and THROW_EXCEPTION.
Referenced by RestoIpoptNLP::Initialize(), OrigIpoptNLP::Initialize(), IpoptCalculatedQuantities::Initialize(), WarmStartIterateInitializer::InitializeImpl(), TSymLinearSolver::InitializeImpl(), StdAugSystemSolver::InitializeImpl(), MinC_1NrmRestorationPhase::InitializeImpl(), RestoIterationOutput::InitializeImpl(), OrigIterationOutput::InitializeImpl(), MonotoneMuUpdate::InitializeImpl(), IpoptAlgorithm::InitializeImpl(), FilterLSAcceptor::InitializeImpl(), DefaultIterateInitializer::InitializeImpl(), BacktrackingLineSearch::InitializeImpl(), AdaptiveMuUpdate::InitializeImpl(), and TNLPAdapter::ProcessOptions().
bool GetNumericValue | ( | const std::string & | tag, | |
Number & | value, | |||
const std::string & | prefix | |||
) | const |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::OT_Integer, Ipopt::OT_Number, Ipopt::OT_String, and THROW_EXCEPTION.
Referenced by OrigIpoptNLP::Initialize(), IpoptData::Initialize(), IpoptCalculatedQuantities::Initialize(), WarmStartIterateInitializer::InitializeImpl(), MinC_1NrmRestorationPhase::InitializeImpl(), RestoIterateInitializer::InitializeImpl(), RestoFilterConvergenceCheck::InitializeImpl(), QualityFunctionMuOracle::InitializeImpl(), ProbingMuOracle::InitializeImpl(), PDPerturbationHandler::InitializeImpl(), PDFullSpaceSolver::InitializeImpl(), OptimalityErrorConvergenceCheck::InitializeImpl(), StandardScalingBase::InitializeImpl(), MonotoneMuUpdate::InitializeImpl(), LimMemQuasiNewtonUpdater::InitializeImpl(), IpoptAlgorithm::InitializeImpl(), GradientScaling::InitializeImpl(), FilterLSAcceptor::InitializeImpl(), DefaultIterateInitializer::InitializeImpl(), BacktrackingLineSearch::InitializeImpl(), AdaptiveMuUpdate::InitializeImpl(), and TNLPAdapter::ProcessOptions().
bool GetIntegerValue | ( | const std::string & | tag, | |
Index & | value, | |||
const std::string & | prefix | |||
) | const |
References Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::OT_Integer, Ipopt::OT_Number, Ipopt::OT_String, and THROW_EXCEPTION.
Referenced by RestoFilterConvergenceCheck::InitializeImpl(), QualityFunctionMuOracle::InitializeImpl(), PDFullSpaceSolver::InitializeImpl(), OptimalityErrorConvergenceCheck::InitializeImpl(), LimMemQuasiNewtonUpdater::InitializeImpl(), FilterLSAcceptor::InitializeImpl(), BacktrackingLineSearch::InitializeImpl(), and AdaptiveMuUpdate::InitializeImpl().
void PrintList | ( | std::string & | list | ) | const |
Get a string with the list of all options (tag, value, counter).
void PrintUserOptions | ( | std::string & | list | ) | const |
Get a string with the list of all options set by the user (tag, value, use/notused).
Here, options with dont_print flag set to true are not printed.
bool ReadFromStream | ( | const Journalist & | jnlst, | |
std::istream & | is | |||
) |
Read options from the stream is.
Returns false if an error was encountered.
References ASSERT_EXCEPTION, DBG_ASSERT, Ipopt::IsNull(), Ipopt::IsValid(), Ipopt::J_DETAILED, Ipopt::J_ERROR, Ipopt::J_MAIN, Ipopt::OT_Integer, Ipopt::OT_Number, Ipopt::OT_String, Journalist::Printf(), OptionsList::SetIntegerValue(), OptionsList::SetNumericValue(), OptionsList::SetStringValue(), and THROW_EXCEPTION.