#include <IpRegOptions.hpp>
Inheritance diagram for Ipopt::RegisteredOption:
Public Member Functions | |
DECLARE_STD_EXCEPTION (ERROR_CONVERTING_STRING_TO_ENUM) | |
void | OutputDescription (const Journalist &jnlst) const |
output a description of the option | |
void | OutputShortDescription (const Journalist &jnlst) const |
output a more concise version | |
void | OutputLatexDescription (const Journalist &jnlst) const |
output a latex version | |
RegisteredOption () | |
Constructors / Destructors. | |
RegisteredOption (const std::string &name, const std::string &short_description, const std::string &long_description, const std::string ®istering_category) | |
Constructors / Destructors. | |
RegisteredOption (const RegisteredOption ©) | |
Constructors / Destructors. | |
virtual | ~RegisteredOption () |
Constructors / Destructors. | |
const std::string & | Name () const |
Get the option's name (tag in the input file). | |
void | SetName (const std::string &name) |
Set the option's name (tag in the input file). | |
const std::string & | ShortDescription () const |
Get the short description. | |
const std::string & | LongDescription () const |
Get the long description. | |
void | SetShortDescription (const std::string &short_description) |
Set the short description. | |
void | SetLongDescription (const std::string &long_description) |
Set the long description. | |
const std::string & | RegisteringCategory () const |
Get the registering class. | |
void | SetRegisteringCategory (const std::string ®istering_category) |
Set the registering class. | |
const RegisteredOptionType & | Type () const |
Get the Option's type. | |
void | SetType (const RegisteredOptionType &type) |
Get the Option's type. | |
Index | Counter () const |
Counter. | |
Get / Set methods valid for specific types - NOTE: the Type | |
must be set before calling these methods. | |
const bool & | HasLower () const |
check if the option has a lower bound - can be called for OT_Number & OT_Integer | |
const bool & | LowerStrict () const |
check if the lower bound is strict - can be called for OT_Number | |
Number | LowerNumber () const |
get the Number version of the lower bound - can be called for OT_Number | |
void | SetLowerNumber (const Number &lower, const bool &strict) |
set the Number version of the lower bound - can be called for OT_Number | |
Index | LowerInteger () const |
get the Integer version of the lower bound can be called for OT_Integer | |
void | SetLowerInteger (const Index &lower) |
set the Integer version of the lower bound - can be called for OT_Integer | |
const bool & | HasUpper () const |
check if the option has an upper bound - can be called for OT_Number & OT_Integer | |
const bool & | UpperStrict () const |
check if the upper bound is strict - can be called for OT_Number | |
Number | UpperNumber () const |
get the Number version of the upper bound - can be called for OT_Number | |
void | SetUpperNumber (const Number &upper, const bool &strict) |
set the Number version of the upper bound - can be called for OT_Number | |
Index | UpperInteger () const |
get the Integer version of the upper bound - can be called for OT_Integer | |
void | SetUpperInteger (const Index &upper) |
set the Integer version of the upper bound - can be called for OT_Integer | |
void | AddValidStringSetting (const std::string value, const std::string description) |
method to add valid string entries - can be called for OT_String | |
Number | DefaultNumber () const |
get the default as a Number - can be called for OT_Number | |
void | SetDefaultNumber (const Number &default_value) |
Set the default as a Number - can be called for OT_Number. | |
Index | DefaultInteger () const |
get the default as an Integer - can be called for OT_Integer | |
void | SetDefaultInteger (const Index &default_value) |
Set the default as an Integer - can be called for OT_Integer. | |
std::string | DefaultString () const |
get the default as a string - can be called for OT_String | |
Index | DefaultStringAsEnum () const |
get the default as a string, but as the index of the string in the list - helps map from a string to an enum- can be called for OT_String | |
void | SetDefaultString (const std::string &default_value) |
Set the default as a string - can be called for OT_String. | |
bool | IsValidNumberSetting (const Number &value) const |
Check if the Number value is a valid setting - can be called for OT_Number. | |
bool | IsValidIntegerSetting (const Index &value) const |
Check if the Integer value is a valid setting - can be called for OT_Integer. | |
bool | IsValidStringSetting (const std::string &value) const |
Check if the String value is a valid setting - can be called for OT_String. | |
std::string | MapStringSetting (const std::string &value) const |
Map a user setting (allowing any case) to the case used when the setting was registered. | |
Index | MapStringSettingToEnum (const std::string &value) const |
Map a user setting (allowing any case) to the index of the matched setting in the list of string settings. | |
Private Member Functions | |
void | MakeValidLatexString (std::string source, std::string &dest) const |
std::string | MakeValidLatexNumber (Number value) const |
bool | string_equal_insensitive (const std::string &s1, const std::string &s2) const |
Compare two strings and return true if they are equal (case insensitive comparison). | |
Private Attributes | |
std::string | name_ |
std::string | short_description_ |
std::string | long_description_ |
std::string | registering_category_ |
RegisteredOptionType | type_ |
bool | has_lower_ |
bool | lower_strict_ |
Number | lower_ |
bool | has_upper_ |
bool | upper_strict_ |
Number | upper_ |
Number | default_number_ |
std::vector< string_entry > | valid_strings_ |
std::string | default_string_ |
const Index | counter_ |
Has the information as how many-th option this one was registered. | |
Static Private Attributes | |
static Index | next_counter_ |
Classes | |
class | string_entry |
class to hold the valid string settings for a string option More... |
The derived types are more specific to a string option or a Number (real) option, etc.
Definition at line 33 of file IpRegOptions.hpp.
Ipopt::RegisteredOption::RegisteredOption | ( | ) | [inline] |
Ipopt::RegisteredOption::RegisteredOption | ( | const std::string & | name, | |
const std::string & | short_description, | |||
const std::string & | long_description, | |||
const std::string & | registering_category | |||
) | [inline] |
Ipopt::RegisteredOption::RegisteredOption | ( | const RegisteredOption & | copy | ) | [inline] |
virtual Ipopt::RegisteredOption::~RegisteredOption | ( | ) | [inline, virtual] |
Ipopt::RegisteredOption::DECLARE_STD_EXCEPTION | ( | ERROR_CONVERTING_STRING_TO_ENUM | ) |
const std::string& Ipopt::RegisteredOption::Name | ( | ) | const [inline] |
Get the option's name (tag in the input file).
Definition at line 85 of file IpRegOptions.hpp.
References name_.
void Ipopt::RegisteredOption::SetName | ( | const std::string & | name | ) | [inline] |
Set the option's name (tag in the input file).
Definition at line 90 of file IpRegOptions.hpp.
References name_.
const std::string& Ipopt::RegisteredOption::ShortDescription | ( | ) | const [inline] |
Get the short description.
Definition at line 95 of file IpRegOptions.hpp.
References short_description_.
const std::string& Ipopt::RegisteredOption::LongDescription | ( | ) | const [inline] |
Get the long description.
Definition at line 100 of file IpRegOptions.hpp.
References long_description_.
void Ipopt::RegisteredOption::SetShortDescription | ( | const std::string & | short_description | ) | [inline] |
Set the short description.
Definition at line 105 of file IpRegOptions.hpp.
References short_description_.
void Ipopt::RegisteredOption::SetLongDescription | ( | const std::string & | long_description | ) | [inline] |
Set the long description.
Definition at line 110 of file IpRegOptions.hpp.
References long_description_.
const std::string& Ipopt::RegisteredOption::RegisteringCategory | ( | ) | const [inline] |
Get the registering class.
Definition at line 115 of file IpRegOptions.hpp.
References registering_category_.
void Ipopt::RegisteredOption::SetRegisteringCategory | ( | const std::string & | registering_category | ) | [inline] |
Set the registering class.
Definition at line 120 of file IpRegOptions.hpp.
References registering_category_.
const RegisteredOptionType& Ipopt::RegisteredOption::Type | ( | ) | const [inline] |
void Ipopt::RegisteredOption::SetType | ( | const RegisteredOptionType & | type | ) | [inline] |
Index Ipopt::RegisteredOption::Counter | ( | ) | const [inline] |
const bool& Ipopt::RegisteredOption::HasLower | ( | ) | const [inline] |
check if the option has a lower bound - can be called for OT_Number & OT_Integer
Definition at line 147 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, Ipopt::OT_Integer, Ipopt::OT_Number, and type_.
const bool& Ipopt::RegisteredOption::LowerStrict | ( | ) | const [inline] |
check if the lower bound is strict - can be called for OT_Number
Definition at line 154 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, lower_strict_, Ipopt::OT_Number, and type_.
Number Ipopt::RegisteredOption::LowerNumber | ( | ) | const [inline] |
get the Number version of the lower bound - can be called for OT_Number
Definition at line 161 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, lower_, Ipopt::OT_Number, and type_.
void Ipopt::RegisteredOption::SetLowerNumber | ( | const Number & | lower, | |
const bool & | strict | |||
) | [inline] |
set the Number version of the lower bound - can be called for OT_Number
Definition at line 168 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, lower_, lower_strict_, Ipopt::OT_Number, and type_.
Index Ipopt::RegisteredOption::LowerInteger | ( | ) | const [inline] |
get the Integer version of the lower bound can be called for OT_Integer
Definition at line 176 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, lower_, Ipopt::OT_Integer, and type_.
void Ipopt::RegisteredOption::SetLowerInteger | ( | const Index & | lower | ) | [inline] |
set the Integer version of the lower bound - can be called for OT_Integer
Definition at line 183 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, lower_, Ipopt::OT_Integer, and type_.
const bool& Ipopt::RegisteredOption::HasUpper | ( | ) | const [inline] |
check if the option has an upper bound - can be called for OT_Number & OT_Integer
Definition at line 191 of file IpRegOptions.hpp.
References DBG_ASSERT, has_upper_, Ipopt::OT_Integer, Ipopt::OT_Number, and type_.
const bool& Ipopt::RegisteredOption::UpperStrict | ( | ) | const [inline] |
check if the upper bound is strict - can be called for OT_Number
Definition at line 198 of file IpRegOptions.hpp.
References DBG_ASSERT, has_upper_, Ipopt::OT_Number, type_, and upper_strict_.
Number Ipopt::RegisteredOption::UpperNumber | ( | ) | const [inline] |
get the Number version of the upper bound - can be called for OT_Number
Definition at line 205 of file IpRegOptions.hpp.
References DBG_ASSERT, has_upper_, Ipopt::OT_Number, type_, and upper_.
void Ipopt::RegisteredOption::SetUpperNumber | ( | const Number & | upper, | |
const bool & | strict | |||
) | [inline] |
set the Number version of the upper bound - can be called for OT_Number
Definition at line 212 of file IpRegOptions.hpp.
References DBG_ASSERT, has_upper_, Ipopt::OT_Number, type_, upper_, and upper_strict_.
Index Ipopt::RegisteredOption::UpperInteger | ( | ) | const [inline] |
get the Integer version of the upper bound - can be called for OT_Integer
Definition at line 221 of file IpRegOptions.hpp.
References DBG_ASSERT, has_upper_, Ipopt::OT_Integer, type_, and upper_.
void Ipopt::RegisteredOption::SetUpperInteger | ( | const Index & | upper | ) | [inline] |
set the Integer version of the upper bound - can be called for OT_Integer
Definition at line 228 of file IpRegOptions.hpp.
References DBG_ASSERT, has_upper_, Ipopt::OT_Integer, type_, and upper_.
void Ipopt::RegisteredOption::AddValidStringSetting | ( | const std::string | value, | |
const std::string | description | |||
) | [inline] |
method to add valid string entries - can be called for OT_String
Definition at line 236 of file IpRegOptions.hpp.
References DBG_ASSERT, Ipopt::OT_String, type_, and valid_strings_.
Number Ipopt::RegisteredOption::DefaultNumber | ( | ) | const [inline] |
get the default as a Number - can be called for OT_Number
Definition at line 243 of file IpRegOptions.hpp.
References DBG_ASSERT, default_number_, Ipopt::OT_Number, and type_.
void Ipopt::RegisteredOption::SetDefaultNumber | ( | const Number & | default_value | ) | [inline] |
Set the default as a Number - can be called for OT_Number.
Definition at line 249 of file IpRegOptions.hpp.
References DBG_ASSERT, default_number_, Ipopt::OT_Number, and type_.
Index Ipopt::RegisteredOption::DefaultInteger | ( | ) | const [inline] |
get the default as an Integer - can be called for OT_Integer
Definition at line 255 of file IpRegOptions.hpp.
References DBG_ASSERT, default_number_, Ipopt::OT_Integer, and type_.
void Ipopt::RegisteredOption::SetDefaultInteger | ( | const Index & | default_value | ) | [inline] |
Set the default as an Integer - can be called for OT_Integer.
Definition at line 262 of file IpRegOptions.hpp.
References DBG_ASSERT, default_number_, Ipopt::OT_Integer, and type_.
std::string Ipopt::RegisteredOption::DefaultString | ( | ) | const [inline] |
get the default as a string - can be called for OT_String
Definition at line 268 of file IpRegOptions.hpp.
References DBG_ASSERT, default_string_, Ipopt::OT_String, and type_.
Index Ipopt::RegisteredOption::DefaultStringAsEnum | ( | ) | const [inline] |
get the default as a string, but as the index of the string in the list - helps map from a string to an enum- can be called for OT_String
Definition at line 276 of file IpRegOptions.hpp.
References DBG_ASSERT, default_string_, MapStringSettingToEnum(), Ipopt::OT_String, and type_.
void Ipopt::RegisteredOption::SetDefaultString | ( | const std::string & | default_value | ) | [inline] |
Set the default as a string - can be called for OT_String.
Definition at line 282 of file IpRegOptions.hpp.
References DBG_ASSERT, default_string_, Ipopt::OT_String, and type_.
bool Ipopt::RegisteredOption::IsValidNumberSetting | ( | const Number & | value | ) | const [inline] |
Check if the Number value is a valid setting - can be called for OT_Number.
Definition at line 289 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, has_upper_, lower_, lower_strict_, Ipopt::OT_Number, type_, upper_, and upper_strict_.
bool Ipopt::RegisteredOption::IsValidIntegerSetting | ( | const Index & | value | ) | const [inline] |
Check if the Integer value is a valid setting - can be called for OT_Integer.
Definition at line 304 of file IpRegOptions.hpp.
References DBG_ASSERT, has_lower_, has_upper_, lower_, Ipopt::OT_Integer, type_, and upper_.
bool Ipopt::RegisteredOption::IsValidStringSetting | ( | const std::string & | value | ) | const |
Check if the String value is a valid setting - can be called for OT_String.
std::string Ipopt::RegisteredOption::MapStringSetting | ( | const std::string & | value | ) | const |
Map a user setting (allowing any case) to the case used when the setting was registered.
Index Ipopt::RegisteredOption::MapStringSettingToEnum | ( | const std::string & | value | ) | const |
Map a user setting (allowing any case) to the index of the matched setting in the list of string settings.
Helps map a string setting to an enumeration.
Referenced by DefaultStringAsEnum().
void Ipopt::RegisteredOption::OutputDescription | ( | const Journalist & | jnlst | ) | const |
output a description of the option
void Ipopt::RegisteredOption::OutputShortDescription | ( | const Journalist & | jnlst | ) | const |
output a more concise version
void Ipopt::RegisteredOption::OutputLatexDescription | ( | const Journalist & | jnlst | ) | const |
output a latex version
void Ipopt::RegisteredOption::MakeValidLatexString | ( | std::string | source, | |
std::string & | dest | |||
) | const [private] |
std::string Ipopt::RegisteredOption::MakeValidLatexNumber | ( | Number | value | ) | const [private] |
bool Ipopt::RegisteredOption::string_equal_insensitive | ( | const std::string & | s1, | |
const std::string & | s2 | |||
) | const [private] |
Compare two strings and return true if they are equal (case insensitive comparison).
std::string Ipopt::RegisteredOption::name_ [private] |
std::string Ipopt::RegisteredOption::short_description_ [private] |
Definition at line 340 of file IpRegOptions.hpp.
Referenced by SetShortDescription(), and ShortDescription().
std::string Ipopt::RegisteredOption::long_description_ [private] |
Definition at line 341 of file IpRegOptions.hpp.
Referenced by LongDescription(), and SetLongDescription().
std::string Ipopt::RegisteredOption::registering_category_ [private] |
Definition at line 342 of file IpRegOptions.hpp.
Referenced by RegisteringCategory(), and SetRegisteringCategory().
Definition at line 343 of file IpRegOptions.hpp.
Referenced by AddValidStringSetting(), DefaultInteger(), DefaultNumber(), DefaultString(), DefaultStringAsEnum(), HasLower(), HasUpper(), IsValidIntegerSetting(), IsValidNumberSetting(), LowerInteger(), LowerNumber(), LowerStrict(), SetDefaultInteger(), SetDefaultNumber(), SetDefaultString(), SetLowerInteger(), SetLowerNumber(), SetType(), SetUpperInteger(), SetUpperNumber(), Type(), UpperInteger(), UpperNumber(), and UpperStrict().
bool Ipopt::RegisteredOption::has_lower_ [private] |
Definition at line 345 of file IpRegOptions.hpp.
Referenced by HasLower(), IsValidIntegerSetting(), IsValidNumberSetting(), LowerInteger(), LowerNumber(), LowerStrict(), SetLowerInteger(), and SetLowerNumber().
bool Ipopt::RegisteredOption::lower_strict_ [private] |
Definition at line 346 of file IpRegOptions.hpp.
Referenced by IsValidNumberSetting(), LowerStrict(), and SetLowerNumber().
Number Ipopt::RegisteredOption::lower_ [private] |
Definition at line 347 of file IpRegOptions.hpp.
Referenced by IsValidIntegerSetting(), IsValidNumberSetting(), LowerInteger(), LowerNumber(), SetLowerInteger(), and SetLowerNumber().
bool Ipopt::RegisteredOption::has_upper_ [private] |
Definition at line 348 of file IpRegOptions.hpp.
Referenced by HasUpper(), IsValidIntegerSetting(), IsValidNumberSetting(), SetUpperInteger(), SetUpperNumber(), UpperInteger(), UpperNumber(), and UpperStrict().
bool Ipopt::RegisteredOption::upper_strict_ [private] |
Definition at line 349 of file IpRegOptions.hpp.
Referenced by IsValidNumberSetting(), SetUpperNumber(), and UpperStrict().
Number Ipopt::RegisteredOption::upper_ [private] |
Definition at line 350 of file IpRegOptions.hpp.
Referenced by IsValidIntegerSetting(), IsValidNumberSetting(), SetUpperInteger(), SetUpperNumber(), UpperInteger(), and UpperNumber().
Definition at line 351 of file IpRegOptions.hpp.
Referenced by DefaultInteger(), DefaultNumber(), SetDefaultInteger(), and SetDefaultNumber().
std::vector<string_entry> Ipopt::RegisteredOption::valid_strings_ [private] |
std::string Ipopt::RegisteredOption::default_string_ [private] |
Definition at line 373 of file IpRegOptions.hpp.
Referenced by DefaultString(), DefaultStringAsEnum(), and SetDefaultString().
const Index Ipopt::RegisteredOption::counter_ [private] |
Has the information as how many-th option this one was registered.
Definition at line 377 of file IpRegOptions.hpp.
Referenced by Counter().
Index Ipopt::RegisteredOption::next_counter_ [static, private] |
Definition at line 379 of file IpRegOptions.hpp.