Ipopt  3.12.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Ipopt::RegisteredOption Class Reference

Base class for registered options. More...

#include <IpRegOptions.hpp>

+ Inheritance diagram for Ipopt::RegisteredOption:

Classes

class  string_entry
 class to hold the valid string settings for a string option More...
 

Public Member Functions

 DECLARE_STD_EXCEPTION (ERROR_CONVERTING_STRING_TO_ENUM)
 
virtual void OutputDescription (const Journalist &jnlst) const
 output a description of the option More...
 
virtual void OutputShortDescription (const Journalist &jnlst) const
 output a more concise version More...
 
virtual void OutputLatexDescription (const Journalist &jnlst) const
 output a latex version More...
 
 RegisteredOption (Index counter)
 Constructors / Destructors. More...
 
 RegisteredOption (const std::string &name, const std::string &short_description, const std::string &long_description, const std::string &registering_category, Index counter)
 
 RegisteredOption (const RegisteredOption &copy)
 
virtual ~RegisteredOption ()
 
virtual const std::string & Name () const
 Standard Get / Set Methods. More...
 
virtual void SetName (const std::string &name)
 Set the option's name (tag in the input file) More...
 
virtual const std::string & ShortDescription () const
 Get the short description. More...
 
virtual const std::string & LongDescription () const
 Get the long description. More...
 
virtual void SetShortDescription (const std::string &short_description)
 Set the short description. More...
 
virtual void SetLongDescription (const std::string &long_description)
 Set the long description. More...
 
virtual const std::string & RegisteringCategory () const
 Get the registering class. More...
 
virtual void SetRegisteringCategory (const std::string &registering_category)
 Set the registering class. More...
 
virtual const
RegisteredOptionType
Type () const
 Get the Option's type. More...
 
virtual void SetType (const RegisteredOptionType &type)
 Get the Option's type. More...
 
virtual Index Counter () const
 Counter. More...
 
Get / Set methods valid for specific types - NOTE: the Type

must be set before calling these methods.

virtual const bool & HasLower () const
 check if the option has a lower bound - can be called for OT_Number & OT_Integer More...
 
virtual const bool & LowerStrict () const
 
check if the lower bound is strict - can be called for

OT_Number More...

 
virtual Number LowerNumber () const
 get the Number version of the lower bound - can be called for OT_Number More...
 
virtual void SetLowerNumber (const Number &lower, const bool &strict)
 set the Number version of the lower bound - can be called for OT_Number More...
 
virtual Index LowerInteger () const
 get the Integer version of the lower bound can be called for OT_Integer More...
 
virtual void SetLowerInteger (const Index &lower)
 set the Integer version of the lower bound - can be called for OT_Integer More...
 
virtual const bool & HasUpper () const
 check if the option has an upper bound - can be called for OT_Number & OT_Integer More...
 
virtual const bool & UpperStrict () const
 check if the upper bound is strict - can be called for OT_Number More...
 
virtual Number UpperNumber () const
 get the Number version of the upper bound - can be called for OT_Number More...
 
virtual void SetUpperNumber (const Number &upper, const bool &strict)
 set the Number version of the upper bound - can be called for OT_Number More...
 
virtual Index UpperInteger () const
 get the Integer version of the upper bound - can be called for OT_Integer More...
 
virtual void SetUpperInteger (const Index &upper)
 set the Integer version of the upper bound - can be called for OT_Integer More...
 
virtual void AddValidStringSetting (const std::string value, const std::string description)
 method to add valid string entries - can be called for OT_String More...
 
virtual Number DefaultNumber () const
 get the default as a Number - can be called for OT_Number More...
 
virtual void SetDefaultNumber (const Number &default_value)
 Set the default as a Number - can be called for OT_Number. More...
 
virtual Index DefaultInteger () const
 get the default as an Integer - can be called for OT_Integer More...
 
virtual void SetDefaultInteger (const Index &default_value)
 
Set the default as an Integer - can be called for

OT_Integer More...

 
virtual std::string DefaultString () const
 get the default as a string - can be called for OT_String More...
 
virtual 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 More...
 
virtual void SetDefaultString (const std::string &default_value)
 Set the default as a string - can be called for OT_String. More...
 
virtual std::vector< string_entryGetValidStrings () const
 get the valid string settings - can be called for OT_String More...
 
virtual bool IsValidNumberSetting (const Number &value) const
 Check if the Number value is a valid setting - can be called for OT_Number. More...
 
virtual bool IsValidIntegerSetting (const Index &value) const
 Check if the Integer value is a valid setting - can be called for OT_Integer. More...
 
virtual bool IsValidStringSetting (const std::string &value) const
 Check if the String value is a valid setting - can be called for OT_String. More...
 
virtual std::string MapStringSetting (const std::string &value) const
 Map a user setting (allowing any case) to the case used when the setting was registered. More...
 
virtual 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. More...
 
- Public Member Functions inherited from Ipopt::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
Index ReferenceCount () const
 
void AddRef (const Referencer *referencer) const
 
void ReleaseRef (const Referencer *referencer) const
 

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) More...

 

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_entryvalid_strings_
 
std::string default_string_
 
const Index counter_
 Has the information as how many-th option this one was registered. More...
 

Detailed Description

Base class for registered options.

The derived types are more specific to a string option or a Number (real) option, etc.

Definition at line 33 of file IpRegOptions.hpp.

Constructor & Destructor Documentation

Ipopt::RegisteredOption::RegisteredOption ( Index  counter)
inline

Constructors / Destructors.

Definition at line 49 of file IpRegOptions.hpp.

Ipopt::RegisteredOption::RegisteredOption ( const std::string &  name,
const std::string &  short_description,
const std::string &  long_description,
const std::string &  registering_category,
Index  counter 
)
inline

Definition at line 57 of file IpRegOptions.hpp.

Ipopt::RegisteredOption::RegisteredOption ( const RegisteredOption copy)
inline

Definition at line 73 of file IpRegOptions.hpp.

virtual Ipopt::RegisteredOption::~RegisteredOption ( )
inlinevirtual

Definition at line 88 of file IpRegOptions.hpp.

Member Function Documentation

Ipopt::RegisteredOption::DECLARE_STD_EXCEPTION ( ERROR_CONVERTING_STRING_TO_ENUM  )
virtual const std::string& Ipopt::RegisteredOption::Name ( ) const
inlinevirtual

Standard Get / Set Methods.

Get the option's name (tag in the input file)

Definition at line 97 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetName ( const std::string &  name)
inlinevirtual

Set the option's name (tag in the input file)

Definition at line 102 of file IpRegOptions.hpp.

virtual const std::string& Ipopt::RegisteredOption::ShortDescription ( ) const
inlinevirtual

Get the short description.

Definition at line 107 of file IpRegOptions.hpp.

virtual const std::string& Ipopt::RegisteredOption::LongDescription ( ) const
inlinevirtual

Get the long description.

Definition at line 112 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetShortDescription ( const std::string &  short_description)
inlinevirtual

Set the short description.

Definition at line 117 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetLongDescription ( const std::string &  long_description)
inlinevirtual

Set the long description.

Definition at line 122 of file IpRegOptions.hpp.

virtual const std::string& Ipopt::RegisteredOption::RegisteringCategory ( ) const
inlinevirtual

Get the registering class.

Definition at line 127 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetRegisteringCategory ( const std::string &  registering_category)
inlinevirtual

Set the registering class.

Definition at line 132 of file IpRegOptions.hpp.

virtual const RegisteredOptionType& Ipopt::RegisteredOption::Type ( ) const
inlinevirtual

Get the Option's type.

Definition at line 137 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetType ( const RegisteredOptionType type)
inlinevirtual

Get the Option's type.

Definition at line 142 of file IpRegOptions.hpp.

virtual Index Ipopt::RegisteredOption::Counter ( ) const
inlinevirtual

Counter.

Definition at line 147 of file IpRegOptions.hpp.

virtual const bool& Ipopt::RegisteredOption::HasLower ( ) const
inlinevirtual

check if the option has a lower bound - can be called for OT_Number & OT_Integer

Definition at line 159 of file IpRegOptions.hpp.

virtual const bool& Ipopt::RegisteredOption::LowerStrict ( ) const
inlinevirtual

check if the lower bound is strict - can be called for

OT_Number

Definition at line 166 of file IpRegOptions.hpp.

virtual Number Ipopt::RegisteredOption::LowerNumber ( ) const
inlinevirtual

get the Number version of the lower bound - can be called for OT_Number

Definition at line 173 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetLowerNumber ( const Number lower,
const bool &  strict 
)
inlinevirtual

set the Number version of the lower bound - can be called for OT_Number

Definition at line 180 of file IpRegOptions.hpp.

virtual Index Ipopt::RegisteredOption::LowerInteger ( ) const
inlinevirtual

get the Integer version of the lower bound can be called for OT_Integer

Definition at line 188 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetLowerInteger ( const Index lower)
inlinevirtual

set the Integer version of the lower bound - can be called for OT_Integer

Definition at line 195 of file IpRegOptions.hpp.

virtual const bool& Ipopt::RegisteredOption::HasUpper ( ) const
inlinevirtual

check if the option has an upper bound - can be called for OT_Number & OT_Integer

Definition at line 203 of file IpRegOptions.hpp.

virtual const bool& Ipopt::RegisteredOption::UpperStrict ( ) const
inlinevirtual

check if the upper bound is strict - can be called for OT_Number

Definition at line 210 of file IpRegOptions.hpp.

virtual Number Ipopt::RegisteredOption::UpperNumber ( ) const
inlinevirtual

get the Number version of the upper bound - can be called for OT_Number

Definition at line 217 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetUpperNumber ( const Number upper,
const bool &  strict 
)
inlinevirtual

set the Number version of the upper bound - can be called for OT_Number

Definition at line 224 of file IpRegOptions.hpp.

virtual Index Ipopt::RegisteredOption::UpperInteger ( ) const
inlinevirtual

get the Integer version of the upper bound - can be called for OT_Integer

Definition at line 233 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetUpperInteger ( const Index upper)
inlinevirtual

set the Integer version of the upper bound - can be called for OT_Integer

Definition at line 240 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::AddValidStringSetting ( const std::string  value,
const std::string  description 
)
inlinevirtual

method to add valid string entries - can be called for OT_String

Definition at line 248 of file IpRegOptions.hpp.

virtual Number Ipopt::RegisteredOption::DefaultNumber ( ) const
inlinevirtual

get the default as a Number - can be called for OT_Number

Definition at line 255 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetDefaultNumber ( const Number default_value)
inlinevirtual

Set the default as a Number - can be called for OT_Number.

Definition at line 261 of file IpRegOptions.hpp.

virtual Index Ipopt::RegisteredOption::DefaultInteger ( ) const
inlinevirtual

get the default as an Integer - can be called for OT_Integer

Definition at line 267 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetDefaultInteger ( const Index default_value)
inlinevirtual

Set the default as an Integer - can be called for

OT_Integer

Definition at line 274 of file IpRegOptions.hpp.

virtual std::string Ipopt::RegisteredOption::DefaultString ( ) const
inlinevirtual

get the default as a string - can be called for OT_String

Definition at line 280 of file IpRegOptions.hpp.

virtual Index Ipopt::RegisteredOption::DefaultStringAsEnum ( ) const
inlinevirtual

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 288 of file IpRegOptions.hpp.

virtual void Ipopt::RegisteredOption::SetDefaultString ( const std::string &  default_value)
inlinevirtual

Set the default as a string - can be called for OT_String.

Definition at line 294 of file IpRegOptions.hpp.

virtual std::vector<string_entry> Ipopt::RegisteredOption::GetValidStrings ( ) const
inlinevirtual

get the valid string settings - can be called for OT_String

Definition at line 300 of file IpRegOptions.hpp.

virtual bool Ipopt::RegisteredOption::IsValidNumberSetting ( const Number value) const
inlinevirtual

Check if the Number value is a valid setting - can be called for OT_Number.

Definition at line 307 of file IpRegOptions.hpp.

virtual bool Ipopt::RegisteredOption::IsValidIntegerSetting ( const Index value) const
inlinevirtual

Check if the Integer value is a valid setting - can be called for OT_Integer.

Definition at line 322 of file IpRegOptions.hpp.

virtual bool Ipopt::RegisteredOption::IsValidStringSetting ( const std::string &  value) const
virtual

Check if the String value is a valid setting - can be called for OT_String.

virtual std::string Ipopt::RegisteredOption::MapStringSetting ( const std::string &  value) const
virtual

Map a user setting (allowing any case) to the case used when the setting was registered.

virtual Index Ipopt::RegisteredOption::MapStringSettingToEnum ( const std::string &  value) const
virtual

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.

virtual void Ipopt::RegisteredOption::OutputDescription ( const Journalist jnlst) const
virtual

output a description of the option

virtual void Ipopt::RegisteredOption::OutputShortDescription ( const Journalist jnlst) const
virtual

output a more concise version

virtual void Ipopt::RegisteredOption::OutputLatexDescription ( const Journalist jnlst) const
virtual

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)

Member Data Documentation

std::string Ipopt::RegisteredOption::name_
private

Definition at line 357 of file IpRegOptions.hpp.

std::string Ipopt::RegisteredOption::short_description_
private

Definition at line 358 of file IpRegOptions.hpp.

std::string Ipopt::RegisteredOption::long_description_
private

Definition at line 359 of file IpRegOptions.hpp.

std::string Ipopt::RegisteredOption::registering_category_
private

Definition at line 360 of file IpRegOptions.hpp.

RegisteredOptionType Ipopt::RegisteredOption::type_
private

Definition at line 361 of file IpRegOptions.hpp.

bool Ipopt::RegisteredOption::has_lower_
private

Definition at line 363 of file IpRegOptions.hpp.

bool Ipopt::RegisteredOption::lower_strict_
private

Definition at line 364 of file IpRegOptions.hpp.

Number Ipopt::RegisteredOption::lower_
private

Definition at line 365 of file IpRegOptions.hpp.

bool Ipopt::RegisteredOption::has_upper_
private

Definition at line 366 of file IpRegOptions.hpp.

bool Ipopt::RegisteredOption::upper_strict_
private

Definition at line 367 of file IpRegOptions.hpp.

Number Ipopt::RegisteredOption::upper_
private

Definition at line 368 of file IpRegOptions.hpp.

Number Ipopt::RegisteredOption::default_number_
private

Definition at line 369 of file IpRegOptions.hpp.

std::vector<string_entry> Ipopt::RegisteredOption::valid_strings_
private

Definition at line 379 of file IpRegOptions.hpp.

std::string Ipopt::RegisteredOption::default_string_
private

Definition at line 380 of file IpRegOptions.hpp.

const Index Ipopt::RegisteredOption::counter_
private

Has the information as how many-th option this one was registered.

Definition at line 384 of file IpRegOptions.hpp.


The documentation for this class was generated from the following file: