Namespaces | |
namespace | detail |
Typedefs | |
using | config_t = DefaultConfig |
template<class T > | |
using | dict_to_struct_table_t = std::map< std::string_view, param_setter_fun_t< T > > |
Dictionary that maps struct attribute names to type-erased functions that set those attributes. | |
Functions | |
template<class T > | |
void | assert_key_empty (ParamString s) |
Throw a meaningful error when s.key is not empty, to indicate that the given type T is not of struct type and cannot be indexed into. | |
template<class T > | |
void | unsupported_type (T &, ParamString s) |
Throw a meaningful error to indicate that parameters of type T are not supported or implemented. | |
template<> | |
void | set_param (bool &b, ParamString s) |
template<> | |
void | set_param (std::string_view &v, ParamString s) |
template<> | |
void | set_param (std::string &v, ParamString s) |
template<class T > requires ((std::floating_point<T> || std::integral<T>) && !std::is_enum_v<T>) | |
void | set_param (T &f, ParamString s) |
Update/overwrite the first argument based on the option in s . | |
template<> | |
void | set_param (vec< config_t > &v, ParamString s) |
template<class Rep , class Period > | |
void | set_param (std::chrono::duration< Rep, Period > &t, ParamString s) |
template<class T , class A > | |
auto | param_setter (A T::*attr) |
Return a function that applies set_param to the given attribute of a value of type T . | |
template<class T > | |
auto | possible_keys () |
Return a string enumerating the possible attribute names for the struct type T . | |
template<class T > requires requires { dict_to_struct_table<T>::table; } | |
void | set_param (T &t, ParamString s) |
Use s to index into the struct type T and overwrite the attribute given by s.key . | |
auto | split_key (std::string_view full, char tok='.') |
Split the string full on the first occurrence of tok . | |
template<class T > | |
void | set_param (T &, ParamString) |
Update/overwrite the first argument based on the option in s . | |
template<class T > | |
void | set_params (T &t, std::string_view prefix, std::span< const std::string_view > options, std::optional< std::span< bool > > used=std::nullopt) |
Overwrites t based on the options that start with prefix . | |
template<> | |
void | set_param (FileVec &v, ParamString s) |
template<> | |
void | set_param (bool &b, ParamString s) |
template<> | |
void | set_param (std::string_view &v, ParamString s) |
template<> | |
void | set_param (std::string &v, ParamString s) |
template<> | |
void | set_param (alpaqa::vec< config_t > &v, ParamString s) |
template<> | |
void | set_param (LBFGSStepSize &t, ParamString s) |
template<> | |
void | set_param (PANOCStopCrit &t, ParamString s) |
template<class... Ts> | |
void | set_param (detail::_dummy< Ts... > &, ParamString) |
template void | set_param (detail::possible_alias_t< float > &, ParamString) |
template void | set_param (detail::possible_alias_t< double, float > &, ParamString) |
template void | set_param (detail::possible_alias_t< long double, double, float > &, ParamString) |
template void | set_param (detail::possible_alias_t< int8_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< uint8_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< int16_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< uint16_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< int32_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< int64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< uint32_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< long long, long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< ptrdiff_t, long long, long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< unsigned long, unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< unsigned long long, unsigned long, unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< size_t, unsigned long long, unsigned long, unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, ParamString) |
template void | set_param (detail::possible_alias_t< std::chrono::nanoseconds > &, ParamString) |
template void | set_param (detail::possible_alias_t< std::chrono::microseconds > &, ParamString) |
template void | set_param (detail::possible_alias_t< std::chrono::milliseconds > &, ParamString) |
template void | set_param (detail::possible_alias_t< std::chrono::seconds > &, ParamString) |
template void | set_param (detail::possible_alias_t< std::chrono::minutes > &, ParamString) |
template void | set_param (detail::possible_alias_t< std::chrono::hours > &, ParamString) |
template void | set_param (detail::possible_alias_t< PANOCParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< ZeroFPRParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< PANTRParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< LBFGSParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< AndersonAccelParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< LBFGSDirectionParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< AndersonDirectionParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< StructuredLBFGSDirectionParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< NewtonTRDirectionParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< SteihaugCGParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< StructuredNewtonRegularizationParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< StructuredNewtonDirectionParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< ALMParams< config_t > > &, ParamString) |
template void | set_param (detail::possible_alias_t< PANOCOCPParams< config_t > > &, ParamString) |
template<class T > | |
static auto | possible_keys (const T &tbl) |
template<> | |
void IPOPT_ADAPTER_EXPORT | set_param (Ipopt::IpoptApplication &app, ParamString s) |
template void LBFGSB_ADAPTER_EXPORT | set_param (lbfgsb::LBFGSBSolver::Params &, ParamString) |
struct alpaqa::params::dict_to_struct_table |
struct alpaqa::params::ParamString |
using config_t = DefaultConfig |
Definition at line 19 of file params.tpp.
using dict_to_struct_table_t = std::map<std::string_view, param_setter_fun_t<T> > |
Dictionary that maps struct attribute names to type-erased functions that set those attributes.
Definition at line 79 of file params.tpp.
void assert_key_empty | ( | ParamString | s | ) |
Throw a meaningful error when s.key
is not empty, to indicate that the given type T
is not of struct type and cannot be indexed into.
Definition at line 24 of file params.tpp.
void unsupported_type | ( | T & | , |
ParamString | s | ||
) |
Throw a meaningful error to indicate that parameters of type T
are not supported or implemented.
Definition at line 34 of file params.tpp.
void set_param | ( | bool & | b, |
ParamString | s | ||
) |
void set_param | ( | std::string_view & | v, |
ParamString | s | ||
) |
Definition at line 36 of file params.cpp.
void set_param | ( | std::string & | v, |
ParamString | s | ||
) |
Definition at line 42 of file params.cpp.
void set_param | ( | T & | f, |
ParamString | s | ||
) |
Update/overwrite the first argument based on the option in s
.
Definition at line 49 of file params.cpp.
void set_param | ( | vec< config_t > & | v, |
ParamString | s | ||
) |
void set_param | ( | std::chrono::duration< Rep, Period > & | t, |
ParamString | s | ||
) |
auto param_setter | ( | A T::* | attr | ) |
Return a function that applies set_param to the given attribute of a value of type T
.
Definition at line 62 of file params.tpp.
auto possible_keys | ( | ) |
Return a string enumerating the possible attribute names for the struct type T
.
Definition at line 90 of file params.tpp.
void set_param | ( | T & | t, |
ParamString | s | ||
) |
Use s
to index into the struct type T
and overwrite the attribute given by s.key
.
Update/overwrite the first argument based on the option in s
.
Definition at line 106 of file params.tpp.
|
inline |
Split the string full
on the first occurrence of tok
.
Returns (s, "") if tok was not found.
Definition at line 31 of file params.hpp.
void set_param | ( | T & | t, |
ParamString | s | ||
) |
Update/overwrite the first argument based on the option in s
.
Update/overwrite the first argument based on the option in s
.
Definition at line 49 of file params.cpp.
void set_params | ( | T & | t, |
std::string_view | prefix, | ||
std::span< const std::string_view > | options, | ||
std::optional< std::span< bool > > | used = std::nullopt |
||
) |
Overwrites t
based on the options
that start with prefix
.
If used
is not nullopt
, sets corresponding flag of the options that were used.
Definition at line 48 of file params.hpp.
void set_param | ( | FileVec & | v, |
ParamString | s | ||
) |
Definition at line 73 of file problem.cpp.
void set_param | ( | bool & | b, |
ParamString | s | ||
) |
void set_param | ( | std::string_view & | v, |
ParamString | s | ||
) |
Definition at line 36 of file params.cpp.
void set_param | ( | std::string & | v, |
ParamString | s | ||
) |
Definition at line 42 of file params.cpp.
void set_param | ( | alpaqa::vec< config_t > & | v, |
ParamString | s | ||
) |
void set_param | ( | LBFGSStepSize & | t, |
ParamString | s | ||
) |
Definition at line 107 of file params.cpp.
void set_param | ( | PANOCStopCrit & | t, |
ParamString | s | ||
) |
Definition at line 120 of file params.cpp.
void set_param | ( | detail::_dummy< Ts... > & | , |
ParamString | |||
) |
Definition at line 353 of file params.cpp.
template void set_param | ( | detail::possible_alias_t< float > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< double, float > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< long double, double, float > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< int8_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< uint8_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< int16_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< uint16_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< int32_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< int64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< uint32_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< long long, long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< ptrdiff_t, long long, long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< unsigned long, unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< unsigned long long, unsigned long, unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< size_t, unsigned long long, unsigned long, unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< std::chrono::nanoseconds > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< std::chrono::microseconds > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< std::chrono::milliseconds > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< std::chrono::seconds > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< std::chrono::minutes > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< std::chrono::hours > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< PANOCParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< ZeroFPRParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< PANTRParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< LBFGSParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< AndersonAccelParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< LBFGSDirectionParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< AndersonDirectionParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< StructuredLBFGSDirectionParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< NewtonTRDirectionParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< SteihaugCGParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< StructuredNewtonRegularizationParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< StructuredNewtonDirectionParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< ALMParams< config_t > > & | , |
ParamString | |||
) |
template void set_param | ( | detail::possible_alias_t< PANOCOCPParams< config_t > > & | , |
ParamString | |||
) |
|
static |
Definition at line 11 of file ipopt-params.cpp.
void IPOPT_ADAPTER_EXPORT set_param | ( | Ipopt::IpoptApplication & | app, |
ParamString | s | ||
) |
template void LBFGSB_ADAPTER_EXPORT set_param | ( | lbfgsb::LBFGSBSolver::Params & | , |
ParamString | |||
) |