alpaqa 1.0.0a19
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions | Variables
alpaqa::params Namespace Reference

Namespaces

namespace  detail
 

Classes

class  any_ptr
 Like std::any, but storing just the pointer, without any dynamic allocation. More...
 
struct  attribute_accessor
 Function wrapper to set attributes of a struct, type-erasing the type of the attribute. More...
 
struct  attribute_accessor< json >
 
struct  attribute_accessor< MemberGetter >
 
struct  attribute_accessor< ParamString >
 Function wrapper to set attributes of a struct, type-erasing the type of the attribute. More...
 
struct  attribute_alias_table
 Specialize this type to define the alternative attribute name to attribute setters dictionaries for a struct type T. More...
 
struct  attribute_table
 Specialize this type to define the attribute name to attribute setters dictionaries for a struct type T. More...
 
struct  attribute_table< RootOpts, S >
 
struct  attribute_table< Struct, S >
 
struct  enum_accessor
 Function wrapper access the enumerators of an enum, type-erasing the type of the enum. More...
 
struct  enum_accessor< T, json >
 
struct  enum_accessor< T, MemberGetter >
 
struct  enum_accessor< T, ParamString >
 
struct  enum_table
 Specialize this type to define the enumerator name to value dictionaries for an enum type T. More...
 
struct  invalid_json_param
 Custom parameter parsing exception. More...
 
struct  invalid_param
 Custom parameter parsing exception. More...
 
struct  MemberGetter
 
struct  ParamString
 Represents a parameter value encoded as a string in the format abc.def.key=value. More...
 
struct  Result
 
struct  RootOpts
 
struct  Struct
 
struct  Value
 
struct  vec_from_file
 

Typedefs

using config_t = DefaultConfig
 
template<class S >
using attribute_table_t = std::map< std::string_view, attribute_accessor< S > >
 Dictionary that maps struct attribute names to type-erased functions that set those attributes.
 
template<class S >
using attribute_alias_table_t = std::map< std::string_view, std::string_view >
 Dictionary that maps struct attribute names to type-erased functions that set those attributes.
 
template<class T , class S >
using enum_table_t = std::map< std::string_view, enum_accessor< T, S > >
 Dictionary that maps enumerator names to their values and documentation.
 

Functions

template<class T >
requires requires { attribute_table<T, json>::table; }
void set_param_default (T &t, const json &j)
 
template<class T >
requires requires { enum_table<T, json>::table; }
void set_param_default (T &t, const json &j)
 
template<class T >
requires requires { enum_table<T, json>::table; }
void get_param_default (const T &t, json &j)
 
template<class T >
requires requires { attribute_table<T, json>::table; }
void get_param_default (const T &t, json &s)
 
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<class T >
requires requires { attribute_table<T, ParamString>::table; }
void set_param_default (T &t, ParamString s)
 Use s to index into the struct type T and overwrite the attribute given by s.key.
 
template<class T >
requires requires { enum_table<T, ParamString>::table; }
void set_param_default (T &t, ParamString s)
 Set t to the value of s.value.
 
template<class T >
void set_param (T &, const json &j)
 Update/overwrite the first argument based on the JSON object j.
 
template<class T >
void get_param (const T &, json &j)
 Get the first argument as a JSON object j.
 
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< unsigned > > used=std::nullopt)
 Overwrites t based on the options that start with prefix.
 
template<class T >
bool is_leaf ()
 
template<class T >
Result get_members (const MemberGetter &s)
 Catch-all.
 
template<class T >
requires requires { attribute_table<T, MemberGetter>::table; }
Result get_members (const MemberGetter &s)
 Struct types.
 
template<class T >
requires requires { enum_table<T, MemberGetter>::table; }
Result get_members (const MemberGetter &s)
 Enum types.
 
template<>
Result get_members< bool > (const MemberGetter &s)
 True/false.
 
template<class Duration >
requires is_duration<Duration>
void set_param_default (Duration &t, const json &j)
 
template<class Duration >
requires is_duration<Duration>
void get_param_default (const Duration &t, json &s)
 
template<>
void set_param (alpaqa::vec< config_t > &v, const json &j)
 
template<>
void set_param (vec_from_file< config_t > &v, const json &j)
 
template<>
void set_param (std::monostate &, const nlohmann::json &)
 
template<>
void set_param (bool &t, const nlohmann::json &j)
 
template<>
void set_param (std::string &t, const nlohmann::json &j)
 
template<std::integral T>
requires (!std::same_as<T, bool>)
void set_param_default (T &t, const nlohmann::json &j)
 
template<std::floating_point T>
void set_param_default (T &t, const nlohmann::json &j)
 
template<class T >
requires (std::integral<T> || std::same_as<T, bool> || std::same_as<T, std::string>)
void get_param_default (const T &t, nlohmann::json &j)
 
template<std::floating_point T>
void get_param_default (const T &t, nlohmann::json &j)
 
template<class... Ts>
void set_param (util::detail::dummy< Ts... > &, const json &)
 
template<class... Ts>
void get_param (const util::detail::dummy< Ts... > &, json &)
 
template void get_param (const util::possible_alias_t< std::string > &, json &)
 
template void get_param (const util::possible_alias_t< bool > &, json &)
 
template void set_param (util::possible_alias_t< float > &, const json &)
 
template void get_param (const util::possible_alias_t< float > &, json &)
 
template void set_param (util::possible_alias_t< double, float > &, const json &)
 
template void get_param (const util::possible_alias_t< double, float > &, json &)
 
template void set_param (util::possible_alias_t< long double, double, float > &, const json &)
 
template void get_param (const util::possible_alias_t< long double, double, float > &, json &)
 
template void set_param (util::possible_alias_t< int8_t > &, const json &)
 
template void get_param (const util::possible_alias_t< int8_t > &, json &)
 
template void set_param (util::possible_alias_t< uint8_t > &, const json &)
 
template void get_param (const util::possible_alias_t< uint8_t > &, json &)
 
template void set_param (util::possible_alias_t< int16_t > &, const json &)
 
template void get_param (const util::possible_alias_t< int16_t > &, json &)
 
template void set_param (util::possible_alias_t< uint16_t > &, const json &)
 
template void get_param (const util::possible_alias_t< uint16_t > &, json &)
 
template void set_param (util::possible_alias_t< int32_t > &, const json &)
 
template void get_param (const util::possible_alias_t< int32_t > &, json &)
 
template void set_param (util::possible_alias_t< int64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< int64_t > &, json &)
 
template void set_param (util::possible_alias_t< uint32_t > &, const json &)
 
template void get_param (const util::possible_alias_t< uint32_t > &, json &)
 
template void set_param (util::possible_alias_t< uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< uint64_t > &, json &)
 
template void set_param (util::possible_alias_t< short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, json &)
 
template void set_param (util::possible_alias_t< int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, json &)
 
template void set_param (util::possible_alias_t< long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, json &)
 
template void set_param (util::possible_alias_t< long long, long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< long long, long, int, short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, json &)
 
template void set_param (util::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 > &, const json &)
 
template void get_param (const util::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 > &, json &)
 
template void set_param (util::possible_alias_t< unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, json &)
 
template void set_param (util::possible_alias_t< unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, const json &)
 
template void get_param (const util::possible_alias_t< unsigned int, unsigned short, int8_t, uint8_t, int16_t, uint16_t, int32_t, int64_t, uint32_t, uint64_t > &, json &)
 
template void set_param (util::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 > &, const json &)
 
template void get_param (const util::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 > &, json &)
 
template void set_param (util::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 > &, const json &)
 
template void get_param (const util::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 > &, json &)
 
template void set_param (util::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 > &, const json &)
 
template void get_param (const util::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 > &, json &)
 
template void set_param (util::possible_alias_t< std::chrono::nanoseconds > &, const json &)
 
template void get_param (const util::possible_alias_t< std::chrono::nanoseconds > &, json &)
 
template void set_param (util::possible_alias_t< std::chrono::microseconds > &, const json &)
 
template void get_param (const util::possible_alias_t< std::chrono::microseconds > &, json &)
 
template void set_param (util::possible_alias_t< std::chrono::milliseconds > &, const json &)
 
template void get_param (const util::possible_alias_t< std::chrono::milliseconds > &, json &)
 
template void set_param (util::possible_alias_t< std::chrono::seconds > &, const json &)
 
template void get_param (const util::possible_alias_t< std::chrono::seconds > &, json &)
 
template void set_param (util::possible_alias_t< std::chrono::minutes > &, const json &)
 
template void get_param (const util::possible_alias_t< std::chrono::minutes > &, json &)
 
template void set_param (util::possible_alias_t< std::chrono::hours > &, const json &)
 
template void get_param (const util::possible_alias_t< std::chrono::hours > &, json &)
 
template void set_param (util::possible_alias_t< PANOCStopCrit > &, const json &)
 
template void get_param (const util::possible_alias_t< PANOCStopCrit > &, json &)
 
template void set_param (util::possible_alias_t< LBFGSStepSize > &, const json &)
 
template void get_param (const util::possible_alias_t< LBFGSStepSize > &, json &)
 
template void set_param (util::possible_alias_t< CBFGSParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< CBFGSParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< LipschitzEstimateParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< LipschitzEstimateParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< PANOCParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< PANOCParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< FISTAParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< FISTAParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< ZeroFPRParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< ZeroFPRParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< PANTRParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< PANTRParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< LBFGSParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< LBFGSParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< AndersonAccelParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< AndersonAccelParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< LBFGSDirectionParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< LBFGSDirectionParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< AndersonDirectionParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< AndersonDirectionParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< StructuredLBFGSDirectionParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< StructuredLBFGSDirectionParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< NewtonTRDirectionParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< NewtonTRDirectionParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< SteihaugCGParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< SteihaugCGParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< StructuredNewtonRegularizationParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< StructuredNewtonRegularizationParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< StructuredNewtonDirectionParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< StructuredNewtonDirectionParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< ConvexNewtonRegularizationParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< ConvexNewtonRegularizationParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< ConvexNewtonDirectionParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< ConvexNewtonDirectionParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< ALMParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< ALMParams< config_t > > &, json &)
 
template void set_param (util::possible_alias_t< PANOCOCPParams< config_t > > &, const json &)
 
template void get_param (const util::possible_alias_t< PANOCOCPParams< config_t > > &, json &)
 
template<>
void set_param (std::monostate &, ParamString)
 
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> && !std::is_same_v<T, bool>)
void set_param_default (T &f, ParamString s)
 
template<>
void set_param (alpaqa::vec< config_t > &v, ParamString s)
 
template<>
void set_param (vec_from_file< config_t > &v, ParamString s)
 
template<class Duration >
requires is_duration<Duration>
void set_param_default (Duration &t, ParamString s)
 
template<class... Ts>
void set_param (util::detail::dummy< Ts... > &, ParamString)
 
template void set_param (util::possible_alias_t< float > &, ParamString)
 
template void set_param (util::possible_alias_t< double, float > &, ParamString)
 
template void set_param (util::possible_alias_t< long double, double, float > &, ParamString)
 
template void set_param (util::possible_alias_t< int8_t > &, ParamString)
 
template void set_param (util::possible_alias_t< uint8_t > &, ParamString)
 
template void set_param (util::possible_alias_t< int16_t > &, ParamString)
 
template void set_param (util::possible_alias_t< uint16_t > &, ParamString)
 
template void set_param (util::possible_alias_t< int32_t > &, ParamString)
 
template void set_param (util::possible_alias_t< int64_t > &, ParamString)
 
template void set_param (util::possible_alias_t< uint32_t > &, ParamString)
 
template void set_param (util::possible_alias_t< uint64_t > &, ParamString)
 
template void set_param (util::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 (util::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 (util::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 (util::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 (util::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 (util::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 (util::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 (util::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 (util::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 (util::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 (util::possible_alias_t< std::chrono::nanoseconds > &, ParamString)
 
template void set_param (util::possible_alias_t< std::chrono::microseconds > &, ParamString)
 
template void set_param (util::possible_alias_t< std::chrono::milliseconds > &, ParamString)
 
template void set_param (util::possible_alias_t< std::chrono::seconds > &, ParamString)
 
template void set_param (util::possible_alias_t< std::chrono::minutes > &, ParamString)
 
template void set_param (util::possible_alias_t< std::chrono::hours > &, ParamString)
 
template void set_param (util::possible_alias_t< PANOCStopCrit > &, ParamString)
 
template void set_param (util::possible_alias_t< LBFGSStepSize > &, ParamString)
 
template void set_param (util::possible_alias_t< PANOCParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< FISTAParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< ZeroFPRParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< PANTRParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< LBFGSParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< AndersonAccelParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< LBFGSDirectionParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< AndersonDirectionParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< StructuredLBFGSDirectionParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< NewtonTRDirectionParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< SteihaugCGParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< StructuredNewtonRegularizationParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< StructuredNewtonDirectionParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< ConvexNewtonRegularizationParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< ConvexNewtonDirectionParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< ALMParams< config_t > > &, ParamString)
 
template void set_param (util::possible_alias_t< PANOCOCPParams< config_t > > &, ParamString)
 
template<>
void set_param (Ipopt::IpoptApplication &, const json &j)
 
template<>
void get_param (const Ipopt::IpoptApplication &, json &j)
 
template<class T >
static auto possible_keys (const T &tbl)
 
template<>
void set_param (Ipopt::IpoptApplication &app, ParamString s)
 
template<>
void set_param (lbfgsb::LBFGSBSolver::Params &t, const json &j)
 
template<>
void get_param (const lbfgsb::LBFGSBSolver::Params &t, json &j)
 
template<>
void set_param (lbfgsb::LBFGSBSolver::Params &t, ParamString s)
 
template<>
void set_param (qpalm::Settings &t, const json &j)
 
template<>
void get_param (const qpalm::Settings &t, json &j)
 
template<>
void set_param (qpalm::Settings &t, ParamString s)
 

Variables

template<class T >
constexpr bool is_duration = false
 

Class Documentation

◆ alpaqa::params::attribute_accessor

struct alpaqa::params::attribute_accessor
+ Collaboration diagram for attribute_accessor< S >:

◆ alpaqa::params::attribute_alias_table

struct alpaqa::params::attribute_alias_table
+ Collaboration diagram for attribute_alias_table< T, S >:

◆ alpaqa::params::attribute_table

struct alpaqa::params::attribute_table
+ Collaboration diagram for attribute_table< T, S >:

◆ alpaqa::params::enum_accessor

struct alpaqa::params::enum_accessor
+ Collaboration diagram for enum_accessor< T, S >:

◆ alpaqa::params::enum_table

struct alpaqa::params::enum_table
+ Collaboration diagram for enum_table< T, S >:

◆ alpaqa::params::MemberGetter

struct alpaqa::params::MemberGetter
+ Collaboration diagram for MemberGetter:
Class Members
string_view full_key Full key string, used for diagnostics.
string_view key The subkey to resolve next.
optional< string_view > value The value of the parameter to store.

◆ alpaqa::params::ParamString

struct alpaqa::params::ParamString
+ Collaboration diagram for ParamString:
Class Members
string_view full_key Full key string, used for diagnostics.
string_view key The subkey to resolve next.
string_view value The value of the parameter to store.

◆ alpaqa::params::Result

struct alpaqa::params::Result
+ Collaboration diagram for Result:
Class Members
bool leaf
string_view prefix
vector< Member > members

◆ alpaqa::params::RootOpts

struct alpaqa::params::RootOpts
+ Collaboration diagram for RootOpts:
Class Members
Value method
Value out
Value sol
Value x0
Value mul_g0
Value mul_x0
Value num_exp
bool extra_stats
bool show_funcs
Struct problem

◆ alpaqa::params::Struct

struct alpaqa::params::Struct
+ Collaboration diagram for Struct:

◆ alpaqa::params::Value

struct alpaqa::params::Value
+ Collaboration diagram for Value:

◆ alpaqa::params::vec_from_file

struct alpaqa::params::vec_from_file
+ Collaboration diagram for vec_from_file< Conf >:
Class Members
length_t expected_size
optional< vec > value = std::nullopt

Typedef Documentation

◆ config_t

Definition at line 13 of file json.tpp.

◆ attribute_table_t

template<class S >
using attribute_table_t = std::map<std::string_view, attribute_accessor<S> >

Dictionary that maps struct attribute names to type-erased functions that set those attributes.

Definition at line 45 of file structs.hpp.

◆ attribute_alias_table_t

template<class S >
using attribute_alias_table_t = std::map<std::string_view, std::string_view>

Dictionary that maps struct attribute names to type-erased functions that set those attributes.

Definition at line 71 of file structs.hpp.

◆ enum_table_t

template<class T , class S >
using enum_table_t = std::map<std::string_view, enum_accessor<T, S> >

Dictionary that maps enumerator names to their values and documentation.

Definition at line 98 of file structs.hpp.

Function Documentation

◆ set_param_default() [1/9]

template<class T >
requires requires { attribute_table<T, json>::table; }
void set_param_default ( T t,
const json &  j 
)

Definition at line 113 of file json.tpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_param_default() [2/9]

template<class T >
requires requires { enum_table<T, json>::table; }
void set_param_default ( T t,
const json &  j 
)

Definition at line 127 of file json.tpp.

+ Here is the call graph for this function:

◆ get_param_default() [1/5]

template<class T >
requires requires { enum_table<T, json>::table; }
void get_param_default ( const T t,
json &  j 
)

Definition at line 148 of file json.tpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_param_default() [2/5]

template<class T >
requires requires { attribute_table<T, json>::table; }
void get_param_default ( const T t,
json &  s 
)

Definition at line 154 of file json.tpp.

◆ assert_key_empty()

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.

Definition at line 15 of file params.tpp.

+ Here is the call graph for this function:

◆ unsupported_type()

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.

Definition at line 25 of file params.tpp.

+ Here is the call graph for this function:

◆ set_param_default() [3/9]

template<class T >
requires requires { attribute_table<T, ParamString>::table; }
void set_param_default ( T t,
ParamString  s 
)

Use s to index into the struct type T and overwrite the attribute given by s.key.

Definition at line 71 of file params.tpp.

+ Here is the call graph for this function:

◆ set_param_default() [4/9]

template<class T >
requires requires { enum_table<T, ParamString>::table; }
void set_param_default ( T t,
ParamString  s 
)

Set t to the value of s.value.

Definition at line 88 of file params.tpp.

+ Here is the call graph for this function:

◆ set_param() [1/115]

template<class T >
void set_param ( T t,
const json &  j 
)

Update/overwrite the first argument based on the JSON object j.

Definition at line 248 of file json.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_param() [1/55]

template<class T >
void get_param ( const T t,
json &  j 
)

Get the first argument as a JSON object j.

Definition at line 252 of file json.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ split_key()

auto split_key ( std::string_view  full,
char  tok = '.' 
)
inline

Split the string full on the first occurrence of tok.

Returns (s, "") if tok was not found.

Definition at line 32 of file params.hpp.

+ Here is the caller graph for this function:

◆ set_param() [2/115]

template<class T >
void set_param ( T t,
ParamString  s 
)

Update/overwrite the first argument based on the option in s.

Definition at line 168 of file params.cpp.

+ Here is the call graph for this function:

◆ set_params()

template<class T >
void set_params ( T t,
std::string_view  prefix,
std::span< const std::string_view >  options,
std::optional< std::span< unsigned > >  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.

Examples
problems/sparse-logistic-regression.cpp.

Definition at line 49 of file params.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_leaf()

template<class T >
bool is_leaf ( )

Definition at line 39 of file param-complete.cpp.

◆ get_members() [1/3]

template<class T >
Result get_members ( const MemberGetter s)

Catch-all.

Definition at line 45 of file param-complete.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_members() [2/3]

template<class T >
requires requires { attribute_table<T, MemberGetter>::table; }
Result get_members ( const MemberGetter s)

Struct types.

Definition at line 53 of file param-complete.cpp.

+ Here is the call graph for this function:

◆ get_members() [3/3]

template<class T >
requires requires { enum_table<T, MemberGetter>::table; }
Result get_members ( const MemberGetter s)

Enum types.

Definition at line 82 of file param-complete.cpp.

+ Here is the call graph for this function:

◆ get_members< bool >()

template<>
Result get_members< bool > ( const MemberGetter s)

True/false.

Definition at line 101 of file param-complete.cpp.

◆ set_param_default() [5/9]

template<class Duration >
requires is_duration<Duration>
void set_param_default ( Duration t,
const json &  j 
)

Definition at line 41 of file json.cpp.

+ Here is the call graph for this function:

◆ get_param_default() [3/5]

template<class Duration >
requires is_duration<Duration>
void get_param_default ( const Duration t,
json &  s 
)

Definition at line 63 of file json.cpp.

◆ set_param() [3/115]

template<>
void set_param ( alpaqa::vec< config_t > &  v,
const json &  j 
)

Definition at line 99 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [4/115]

template<>
void set_param ( vec_from_file< config_t > &  v,
const json &  j 
)

Definition at line 119 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [5/115]

template<>
void set_param ( std::monostate &  ,
const nlohmann::json &   
)

Definition at line 156 of file json.cpp.

◆ set_param() [6/115]

template<>
void set_param ( bool t,
const nlohmann::json &  j 
)

Definition at line 161 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [7/115]

template<>
void set_param ( std::string &  t,
const nlohmann::json &  j 
)

Definition at line 171 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param_default() [6/9]

template<std::integral T>
requires (!std::same_as<T, bool>)
void set_param_default ( T t,
const nlohmann::json &  j 
)

Definition at line 182 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param_default() [7/9]

template<std::floating_point T>
void set_param_default ( T t,
const nlohmann::json &  j 
)

Definition at line 197 of file json.cpp.

+ Here is the call graph for this function:

◆ get_param_default() [4/5]

template<class T >
requires (std::integral<T> || std::same_as<T, bool> || std::same_as<T, std::string>)
void get_param_default ( const T t,
nlohmann::json &  j 
)

Definition at line 225 of file json.cpp.

◆ get_param_default() [5/5]

template<std::floating_point T>
void get_param_default ( const T t,
nlohmann::json &  j 
)

Definition at line 230 of file json.cpp.

◆ set_param() [8/115]

template<class... Ts>
void set_param ( util::detail::dummy< Ts... > &  ,
const json &   
)

Definition at line 257 of file json.cpp.

◆ get_param() [2/55]

template<class... Ts>
void get_param ( const util::detail::dummy< Ts... > &  ,
json &   
)

Definition at line 259 of file json.cpp.

◆ get_param() [3/55]

template void get_param ( const util::possible_alias_t< std::string > &  ,
json &   
)

◆ get_param() [4/55]

template void get_param ( const util::possible_alias_t< bool > &  ,
json &   
)

◆ set_param() [9/115]

template void set_param ( util::possible_alias_t< float > &  ,
const json &   
)

◆ get_param() [5/55]

template void get_param ( const util::possible_alias_t< float > &  ,
json &   
)

◆ set_param() [10/115]

template void set_param ( util::possible_alias_t< double, float > &  ,
const json &   
)

◆ get_param() [6/55]

template void get_param ( const util::possible_alias_t< double, float > &  ,
json &   
)

◆ set_param() [11/115]

template void set_param ( util::possible_alias_t< long double, double, float > &  ,
const json &   
)

◆ get_param() [7/55]

template void get_param ( const util::possible_alias_t< long double, double, float > &  ,
json &   
)

◆ set_param() [12/115]

template void set_param ( util::possible_alias_t< int8_t > &  ,
const json &   
)

◆ get_param() [8/55]

template void get_param ( const util::possible_alias_t< int8_t > &  ,
json &   
)

◆ set_param() [13/115]

template void set_param ( util::possible_alias_t< uint8_t > &  ,
const json &   
)

◆ get_param() [9/55]

template void get_param ( const util::possible_alias_t< uint8_t > &  ,
json &   
)

◆ set_param() [14/115]

template void set_param ( util::possible_alias_t< int16_t > &  ,
const json &   
)

◆ get_param() [10/55]

template void get_param ( const util::possible_alias_t< int16_t > &  ,
json &   
)

◆ set_param() [15/115]

template void set_param ( util::possible_alias_t< uint16_t > &  ,
const json &   
)

◆ get_param() [11/55]

template void get_param ( const util::possible_alias_t< uint16_t > &  ,
json &   
)

◆ set_param() [16/115]

template void set_param ( util::possible_alias_t< int32_t > &  ,
const json &   
)

◆ get_param() [12/55]

template void get_param ( const util::possible_alias_t< int32_t > &  ,
json &   
)

◆ set_param() [17/115]

template void set_param ( util::possible_alias_t< int64_t > &  ,
const json &   
)

◆ get_param() [13/55]

template void get_param ( const util::possible_alias_t< int64_t > &  ,
json &   
)

◆ set_param() [18/115]

template void set_param ( util::possible_alias_t< uint32_t > &  ,
const json &   
)

◆ get_param() [14/55]

template void get_param ( const util::possible_alias_t< uint32_t > &  ,
json &   
)

◆ set_param() [19/115]

template void set_param ( util::possible_alias_t< uint64_t > &  ,
const json &   
)

◆ get_param() [15/55]

template void get_param ( const util::possible_alias_t< uint64_t > &  ,
json &   
)

◆ set_param() [20/115]

◆ get_param() [16/55]

◆ set_param() [21/115]

◆ get_param() [17/55]

◆ set_param() [22/115]

◆ get_param() [18/55]

◆ set_param() [23/115]

◆ get_param() [19/55]

◆ set_param() [24/115]

◆ get_param() [20/55]

◆ set_param() [25/115]

◆ get_param() [21/55]

◆ set_param() [26/115]

◆ get_param() [22/55]

◆ set_param() [27/115]

◆ get_param() [23/55]

◆ set_param() [28/115]

◆ get_param() [24/55]

◆ set_param() [29/115]

◆ get_param() [25/55]

◆ set_param() [30/115]

template void set_param ( util::possible_alias_t< std::chrono::nanoseconds > &  ,
const json &   
)

◆ get_param() [26/55]

template void get_param ( const util::possible_alias_t< std::chrono::nanoseconds > &  ,
json &   
)

◆ set_param() [31/115]

template void set_param ( util::possible_alias_t< std::chrono::microseconds > &  ,
const json &   
)

◆ get_param() [27/55]

template void get_param ( const util::possible_alias_t< std::chrono::microseconds > &  ,
json &   
)

◆ set_param() [32/115]

template void set_param ( util::possible_alias_t< std::chrono::milliseconds > &  ,
const json &   
)

◆ get_param() [28/55]

template void get_param ( const util::possible_alias_t< std::chrono::milliseconds > &  ,
json &   
)

◆ set_param() [33/115]

template void set_param ( util::possible_alias_t< std::chrono::seconds > &  ,
const json &   
)

◆ get_param() [29/55]

template void get_param ( const util::possible_alias_t< std::chrono::seconds > &  ,
json &   
)

◆ set_param() [34/115]

template void set_param ( util::possible_alias_t< std::chrono::minutes > &  ,
const json &   
)

◆ get_param() [30/55]

template void get_param ( const util::possible_alias_t< std::chrono::minutes > &  ,
json &   
)

◆ set_param() [35/115]

template void set_param ( util::possible_alias_t< std::chrono::hours > &  ,
const json &   
)

◆ get_param() [31/55]

template void get_param ( const util::possible_alias_t< std::chrono::hours > &  ,
json &   
)

◆ set_param() [36/115]

template void set_param ( util::possible_alias_t< PANOCStopCrit > &  ,
const json &   
)

◆ get_param() [32/55]

template void get_param ( const util::possible_alias_t< PANOCStopCrit > &  ,
json &   
)

◆ set_param() [37/115]

template void set_param ( util::possible_alias_t< LBFGSStepSize > &  ,
const json &   
)

◆ get_param() [33/55]

template void get_param ( const util::possible_alias_t< LBFGSStepSize > &  ,
json &   
)

◆ set_param() [38/115]

template void set_param ( util::possible_alias_t< CBFGSParams< config_t > > &  ,
const json &   
)

◆ get_param() [34/55]

template void get_param ( const util::possible_alias_t< CBFGSParams< config_t > > &  ,
json &   
)

◆ set_param() [39/115]

◆ get_param() [35/55]

◆ set_param() [40/115]

template void set_param ( util::possible_alias_t< PANOCParams< config_t > > &  ,
const json &   
)

◆ get_param() [36/55]

template void get_param ( const util::possible_alias_t< PANOCParams< config_t > > &  ,
json &   
)

◆ set_param() [41/115]

template void set_param ( util::possible_alias_t< FISTAParams< config_t > > &  ,
const json &   
)

◆ get_param() [37/55]

template void get_param ( const util::possible_alias_t< FISTAParams< config_t > > &  ,
json &   
)

◆ set_param() [42/115]

template void set_param ( util::possible_alias_t< ZeroFPRParams< config_t > > &  ,
const json &   
)

◆ get_param() [38/55]

template void get_param ( const util::possible_alias_t< ZeroFPRParams< config_t > > &  ,
json &   
)

◆ set_param() [43/115]

template void set_param ( util::possible_alias_t< PANTRParams< config_t > > &  ,
const json &   
)

◆ get_param() [39/55]

template void get_param ( const util::possible_alias_t< PANTRParams< config_t > > &  ,
json &   
)

◆ set_param() [44/115]

template void set_param ( util::possible_alias_t< LBFGSParams< config_t > > &  ,
const json &   
)

◆ get_param() [40/55]

template void get_param ( const util::possible_alias_t< LBFGSParams< config_t > > &  ,
json &   
)

◆ set_param() [45/115]

template void set_param ( util::possible_alias_t< AndersonAccelParams< config_t > > &  ,
const json &   
)

◆ get_param() [41/55]

template void get_param ( const util::possible_alias_t< AndersonAccelParams< config_t > > &  ,
json &   
)

◆ set_param() [46/115]

template void set_param ( util::possible_alias_t< LBFGSDirectionParams< config_t > > &  ,
const json &   
)

◆ get_param() [42/55]

template void get_param ( const util::possible_alias_t< LBFGSDirectionParams< config_t > > &  ,
json &   
)

◆ set_param() [47/115]

◆ get_param() [43/55]

◆ set_param() [48/115]

◆ get_param() [44/55]

◆ set_param() [49/115]

◆ get_param() [45/55]

◆ set_param() [50/115]

template void set_param ( util::possible_alias_t< SteihaugCGParams< config_t > > &  ,
const json &   
)

◆ get_param() [46/55]

template void get_param ( const util::possible_alias_t< SteihaugCGParams< config_t > > &  ,
json &   
)

◆ set_param() [51/115]

◆ get_param() [47/55]

◆ set_param() [52/115]

◆ get_param() [48/55]

◆ set_param() [53/115]

◆ get_param() [49/55]

◆ set_param() [54/115]

◆ get_param() [50/55]

◆ set_param() [55/115]

template void set_param ( util::possible_alias_t< ALMParams< config_t > > &  ,
const json &   
)

◆ get_param() [51/55]

template void get_param ( const util::possible_alias_t< ALMParams< config_t > > &  ,
json &   
)

◆ set_param() [56/115]

template void set_param ( util::possible_alias_t< PANOCOCPParams< config_t > > &  ,
const json &   
)

◆ get_param() [52/55]

template void get_param ( const util::possible_alias_t< PANOCOCPParams< config_t > > &  ,
json &   
)

◆ set_param() [57/115]

template<>
void set_param ( std::monostate &  ,
ParamString   
)

Definition at line 33 of file params.cpp.

◆ set_param() [58/115]

template<>
void set_param ( bool b,
ParamString  s 
)

Definition at line 38 of file params.cpp.

◆ set_param() [59/115]

template<>
void set_param ( std::string_view &  v,
ParamString  s 
)

Definition at line 53 of file params.cpp.

◆ set_param() [60/115]

template<>
void set_param ( std::string &  v,
ParamString  s 
)

Definition at line 59 of file params.cpp.

◆ set_param_default() [8/9]

template<class T >
requires ((std::floating_point<T> || std::integral<T>) && !std::is_enum_v<T> && !std::is_same_v<T, bool>)
void set_param_default ( T f,
ParamString  s 
)

Definition at line 67 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [61/115]

template<>
void set_param ( alpaqa::vec< config_t > &  v,
ParamString  s 
)

Definition at line 93 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [62/115]

template<>
void set_param ( vec_from_file< config_t > &  v,
ParamString  s 
)

Definition at line 103 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param_default() [9/9]

template<class Duration >
requires is_duration<Duration>
void set_param_default ( Duration t,
ParamString  s 
)

Definition at line 144 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [63/115]

template<class... Ts>
void set_param ( util::detail::dummy< Ts... > &  ,
ParamString   
)

Definition at line 173 of file params.cpp.

◆ set_param() [64/115]

template void set_param ( util::possible_alias_t< float > &  ,
ParamString   
)

◆ set_param() [65/115]

◆ set_param() [66/115]

◆ set_param() [67/115]

template void set_param ( util::possible_alias_t< int8_t > &  ,
ParamString   
)

◆ set_param() [68/115]

◆ set_param() [69/115]

◆ set_param() [70/115]

◆ set_param() [71/115]

◆ set_param() [72/115]

◆ set_param() [73/115]

◆ set_param() [74/115]

◆ set_param() [75/115]

◆ set_param() [76/115]

◆ set_param() [77/115]

◆ set_param() [78/115]

◆ set_param() [79/115]

◆ set_param() [80/115]

◆ set_param() [81/115]

◆ set_param() [82/115]

◆ set_param() [83/115]

◆ set_param() [84/115]

◆ set_param() [85/115]

template void set_param ( util::possible_alias_t< std::chrono::nanoseconds > &  ,
ParamString   
)

◆ set_param() [86/115]

template void set_param ( util::possible_alias_t< std::chrono::microseconds > &  ,
ParamString   
)

◆ set_param() [87/115]

template void set_param ( util::possible_alias_t< std::chrono::milliseconds > &  ,
ParamString   
)

◆ set_param() [88/115]

template void set_param ( util::possible_alias_t< std::chrono::seconds > &  ,
ParamString   
)

◆ set_param() [89/115]

template void set_param ( util::possible_alias_t< std::chrono::minutes > &  ,
ParamString   
)

◆ set_param() [90/115]

template void set_param ( util::possible_alias_t< std::chrono::hours > &  ,
ParamString   
)

◆ set_param() [91/115]

◆ set_param() [92/115]

◆ set_param() [93/115]

◆ set_param() [94/115]

◆ set_param() [95/115]

◆ set_param() [96/115]

◆ set_param() [97/115]

◆ set_param() [98/115]

◆ set_param() [99/115]

◆ set_param() [100/115]

◆ set_param() [101/115]

◆ set_param() [102/115]

◆ set_param() [103/115]

◆ set_param() [104/115]

◆ set_param() [105/115]

◆ set_param() [106/115]

◆ set_param() [107/115]

◆ set_param() [108/115]

◆ set_param() [109/115]

◆ set_param() [110/115]

template<>
void set_param ( Ipopt::IpoptApplication &  ,
const json &  j 
)

Definition at line 10 of file ipopt-json.cpp.

◆ get_param() [53/55]

template<>
void get_param ( const Ipopt::IpoptApplication &  ,
json &  j 
)

Definition at line 17 of file ipopt-json.cpp.

◆ possible_keys()

template<class T >
static auto possible_keys ( const T tbl)
static

Definition at line 9 of file ipopt-params.cpp.

+ Here is the caller graph for this function:

◆ set_param() [111/115]

template<>
void set_param ( Ipopt::IpoptApplication &  app,
ParamString  s 
)

Definition at line 21 of file ipopt-params.cpp.

+ Here is the call graph for this function:

◆ set_param() [112/115]

template<>
void set_param ( lbfgsb::LBFGSBSolver::Params t,
const json &  j 
)

Definition at line 9 of file lbfgsb-json.cpp.

+ Here is the call graph for this function:

◆ get_param() [54/55]

template<>
void get_param ( const lbfgsb::LBFGSBSolver::Params t,
json &  j 
)

Definition at line 14 of file lbfgsb-json.cpp.

+ Here is the call graph for this function:

◆ set_param() [113/115]

template<>
void set_param ( lbfgsb::LBFGSBSolver::Params t,
ParamString  s 
)

Definition at line 9 of file lbfgsb-params.cpp.

+ Here is the call graph for this function:

◆ set_param() [114/115]

template<>
void set_param ( qpalm::Settings &  t,
const json &  j 
)

Definition at line 9 of file qpalm-json.cpp.

+ Here is the call graph for this function:

◆ get_param() [55/55]

template<>
void get_param ( const qpalm::Settings &  t,
json &  j 
)

Definition at line 13 of file qpalm-json.cpp.

+ Here is the call graph for this function:

◆ set_param() [115/115]

template<>
void set_param ( qpalm::Settings &  t,
ParamString  s 
)

Definition at line 9 of file qpalm-params.cpp.

+ Here is the call graph for this function:

Variable Documentation

◆ is_duration

template<class T >
constexpr bool is_duration = false
inlineconstexpr

Definition at line 35 of file json.cpp.