PIPS-IPM++ Solver and Tools
a parallel interior-point method for doubly bordered block diagonal linear programs
pipsipmpp::options::Option< T > Class Template Reference

an option of template type T More...

#include <PIPSIPMppOptions.h>

Public Member Functions

 Option (const std::string &name_, const std::string &description_, Category category_, const T &defaultval_, const std::vector< std::pair< T, std::string > > &possiblevals_=std::vector< std::pair< T, std::string > >())
 constructor for an enumerated option or a non-enumerated option without bounds
 Option (const std::string &name_, const std::string &description_, Category category_, const T &defaultval_, const T &minval_, const T &maxval_)
 constructor for a non-enumeration option with bounds
const std::string & get_name () const
const std::string & get_description () const
Category get_category () const
const std::vector< std::pair< T, std::string > > & get_possible_values () const
std::pair< T, T > get_allowed_range () const
const T & get_default () const
const T & get_value () const
bool has_been_set () const
void reset ()
 reset option to default value
void set_value (const T &val)
void set_default (const T &val)

Protected Attributes

std::string name
 name of option
std::string description
 description of option
Category category
 option category
defaultval
 default value of option
currentval
 current value of option
bool valueset
 has an option value be assigned
minval
 minimal value of option, if not string-valued
maxval
 maximal value of option, if not string-valued
std::vector< std::pair< T, std::string > > possiblevals
 possible values for an enumerated option, with description

Detailed Description

template<typename T>
class pipsipmpp::options::Option< T >

an option of template type T

Constructor & Destructor Documentation

◆ Option() [1/2]

template<typename T>
pipsipmpp::options::Option< T >::Option ( const std::string & name_,
const std::string & description_,
Category category_,
const T & defaultval_,
const std::vector< std::pair< T, std::string > > & possiblevals_ = std::vector<std::pair<T, std::string>>() )
inline

constructor for an enumerated option or a non-enumerated option without bounds

Parameters
name_name of option
description_description of option
category_option category
defaultval_default value for option
possiblevals_a list of possible values, each with a description; or empty if any value is possible

◆ Option() [2/2]

template<typename T>
pipsipmpp::options::Option< T >::Option ( const std::string & name_,
const std::string & description_,
Category category_,
const T & defaultval_,
const T & minval_,
const T & maxval_ )
inline

constructor for a non-enumeration option with bounds

Parameters
name_name of option
description_description of option
category_option category
defaultval_default value for option
minval_minimal value the option can be set to
maxval_maximal value the option can be set to

Member Function Documentation

◆ get_allowed_range()

template<typename T>
std::pair< T, T > pipsipmpp::options::Option< T >::get_allowed_range ( ) const
inline
Returns
bounds on option value

◆ get_category()

template<typename T>
Category pipsipmpp::options::Option< T >::get_category ( ) const
inline
Returns
category of option

◆ get_default()

template<typename T>
const T & pipsipmpp::options::Option< T >::get_default ( ) const
inline
Returns
default value of option

◆ get_description()

template<typename T>
const std::string & pipsipmpp::options::Option< T >::get_description ( ) const
inline
Returns
description of option

◆ get_name()

template<typename T>
const std::string & pipsipmpp::options::Option< T >::get_name ( ) const
inline
Returns
name of option

◆ get_possible_values()

template<typename T>
const std::vector< std::pair< T, std::string > > & pipsipmpp::options::Option< T >::get_possible_values ( ) const
inline
Returns
possible values of enumerated option, or empty vector if not enumerated

◆ get_value()

template<typename T>
const T & pipsipmpp::options::Option< T >::get_value ( ) const
inline
Returns
current value of option

◆ has_been_set()

template<typename T>
bool pipsipmpp::options::Option< T >::has_been_set ( ) const
inline
Returns
whether the option has been set (set_value() called)

◆ set_default()

template<typename T>
void pipsipmpp::options::Option< T >::set_default ( const T & val)
inline

change default value

Parameters
valnew default value of option

◆ set_value()

template<typename T>
void pipsipmpp::options::Option< T >::set_value ( const T & val)
inline

set option value

Parameters
valvalue the option should be set to