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

Namespaces

namespace  detail
 

Classes

struct  attribute_accessor
 Function wrapper to set attributes of a struct, type-erasing the type of the attribute. More...
 
struct  attribute_accessor< T, json >
 
struct  attribute_accessor< T, 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  invalid_json_param
 Custom parameter parsing exception. More...
 
struct  invalid_param
 Custom parameter parsing exception. More...
 
struct  ParamString
 Represents a parameter value encoded as a string in the format abc.def.key=value. More...
 
struct  vec_from_file
 

Typedefs

using config_t = DefaultConfig
 
template<class T , class S >
using attribute_table_t = std::map< std::string_view, attribute_accessor< T, S > >
 Dictionary that maps struct attribute names to type-erased functions that set those attributes.
 
template<class T , 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.
 

Functions

template<class T >
requires requires { attribute_table<T, json>::table; }
void set_param (T &t, const json &j)
 Update/overwrite the first argument based on the JSON object j.
 
template<class T >
requires requires { attribute_table<T, json>::table; }
void get_param (const T &t, json &s)
 Get the first argument as a JSON object j.
 
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 (T &t, ParamString s)
 Use s to index into the struct type T and overwrite the attribute given by s.key.
 
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 Duration >
requires is_duration<Duration>
void set_param (Duration &t, const json &j)
 
template<class Duration >
requires is_duration<Duration>
void get_param (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 (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 (T &t, const nlohmann::json &j)
 
template<std::floating_point T>
void set_param (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 (const T &t, nlohmann::json &j)
 
template<std::floating_point T>
void get_param (const T &t, nlohmann::json &j)
 
template<>
void set_param (LBFGSStepSize &t, const json &j)
 
template<>
void get_param (const LBFGSStepSize &t, json &s)
 
template<>
void set_param (PANOCStopCrit &t, const json &j)
 
template<>
void get_param (const PANOCStopCrit &t, json &s)
 
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< 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< 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 (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 (T &f, ParamString s)
 Update/overwrite the first argument based on the option in 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 (Duration &t, ParamString s)
 
template<>
void set_param (LBFGSStepSize &t, ParamString s)
 
template<>
void set_param (PANOCStopCrit &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< 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< 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 &, const json &)
 
template void get_param (const lbfgsb::LBFGSBSolver::Params &, json &)
 
template void set_param (lbfgsb::LBFGSBSolver::Params &, ParamString)
 
template void set_param (qpalm::Settings &, const json &)
 
template void get_param (const qpalm::Settings &, json &)
 
template void set_param (qpalm::Settings &, ParamString)
 

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< T, 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::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::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 11 of file json.tpp.

◆ attribute_table_t

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

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

Definition at line 14 of file structs.hpp.

◆ attribute_alias_table_t

template<class T , 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 37 of file structs.hpp.

Function Documentation

◆ set_param() [1/116]

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

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

Definition at line 24 of file json.tpp.

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

◆ get_param() [1/57]

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

Get the first argument as a JSON object j.

Definition at line 85 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() [2/116]

template<class T >
requires requires { attribute_table<T, ParamString>::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.

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

Definition at line 47 of file params.tpp.

+ Here is the call graph for this function:

◆ set_param() [3/116]

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 24 of file json.tpp.

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

◆ get_param() [2/57]

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

Get the first argument as a JSON object j.

Definition at line 85 of file json.tpp.

◆ 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() [4/116]

template<class T >
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 47 of file params.tpp.

+ 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:

◆ set_param() [5/116]

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

Definition at line 39 of file json.cpp.

+ Here is the call graph for this function:

◆ get_param() [3/57]

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

Definition at line 61 of file json.cpp.

◆ set_param() [6/116]

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

Definition at line 97 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [7/116]

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

Definition at line 117 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [8/116]

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

Definition at line 154 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [9/116]

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

Definition at line 164 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [10/116]

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

Definition at line 175 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [11/116]

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

Definition at line 190 of file json.cpp.

+ Here is the call graph for this function:

◆ get_param() [4/57]

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

Definition at line 218 of file json.cpp.

◆ get_param() [5/57]

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

Definition at line 223 of file json.cpp.

◆ set_param() [12/116]

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

Definition at line 235 of file json.cpp.

◆ get_param() [6/57]

template<>
void get_param ( const LBFGSStepSize t,
json &  s 
)

Definition at line 246 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [13/116]

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

Definition at line 251 of file json.cpp.

◆ get_param() [7/57]

template<>
void get_param ( const PANOCStopCrit t,
json &  s 
)

Definition at line 278 of file json.cpp.

+ Here is the call graph for this function:

◆ set_param() [14/116]

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

Definition at line 285 of file json.cpp.

◆ get_param() [8/57]

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

Definition at line 287 of file json.cpp.

◆ get_param() [9/57]

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

◆ get_param() [10/57]

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

◆ set_param() [15/116]

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

◆ get_param() [11/57]

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

◆ set_param() [16/116]

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

◆ get_param() [12/57]

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

◆ set_param() [17/116]

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

◆ get_param() [13/57]

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

◆ set_param() [18/116]

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

◆ get_param() [14/57]

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

◆ set_param() [19/116]

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

◆ get_param() [15/57]

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

◆ set_param() [20/116]

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

◆ get_param() [16/57]

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

◆ set_param() [21/116]

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

◆ get_param() [17/57]

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

◆ set_param() [22/116]

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

◆ get_param() [18/57]

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

◆ set_param() [23/116]

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

◆ get_param() [19/57]

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

◆ set_param() [24/116]

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

◆ get_param() [20/57]

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

◆ set_param() [25/116]

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

◆ get_param() [21/57]

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

◆ set_param() [26/116]

◆ get_param() [22/57]

◆ set_param() [27/116]

◆ get_param() [23/57]

◆ set_param() [28/116]

◆ get_param() [24/57]

◆ set_param() [29/116]

◆ get_param() [25/57]

◆ set_param() [30/116]

◆ get_param() [26/57]

◆ set_param() [31/116]

◆ get_param() [27/57]

◆ set_param() [32/116]

◆ get_param() [28/57]

◆ set_param() [33/116]

◆ get_param() [29/57]

◆ set_param() [34/116]

◆ get_param() [30/57]

◆ set_param() [35/116]

◆ get_param() [31/57]

◆ set_param() [36/116]

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

◆ get_param() [32/57]

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

◆ set_param() [37/116]

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

◆ get_param() [33/57]

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

◆ set_param() [38/116]

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

◆ get_param() [34/57]

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

◆ set_param() [39/116]

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

◆ get_param() [35/57]

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

◆ set_param() [40/116]

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

◆ get_param() [36/57]

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

◆ set_param() [41/116]

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

◆ get_param() [37/57]

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

◆ set_param() [42/116]

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

◆ get_param() [38/57]

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

◆ set_param() [43/116]

◆ get_param() [39/57]

◆ set_param() [44/116]

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

◆ get_param() [40/57]

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

◆ set_param() [45/116]

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

◆ get_param() [41/57]

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

◆ set_param() [46/116]

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

◆ get_param() [42/57]

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

◆ set_param() [47/116]

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

◆ get_param() [43/57]

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

◆ set_param() [48/116]

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

◆ get_param() [44/57]

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

◆ set_param() [49/116]

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

◆ get_param() [45/57]

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

◆ set_param() [50/116]

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

◆ get_param() [46/57]

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

◆ set_param() [51/116]

◆ get_param() [47/57]

◆ set_param() [52/116]

◆ get_param() [48/57]

◆ set_param() [53/116]

◆ get_param() [49/57]

◆ set_param() [54/116]

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

◆ get_param() [50/57]

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

◆ set_param() [55/116]

◆ get_param() [51/57]

◆ set_param() [56/116]

◆ get_param() [52/57]

◆ set_param() [57/116]

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

◆ get_param() [53/57]

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

◆ set_param() [58/116]

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

◆ get_param() [54/57]

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

◆ set_param() [59/116]

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

Definition at line 30 of file params.cpp.

◆ set_param() [60/116]

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

Definition at line 45 of file params.cpp.

◆ set_param() [61/116]

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

Definition at line 51 of file params.cpp.

◆ set_param() [62/116]

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 ( T f,
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 59 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [63/116]

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

Definition at line 85 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [64/116]

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

Definition at line 95 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [65/116]

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

Definition at line 136 of file params.cpp.

+ Here is the call graph for this function:

◆ set_param() [66/116]

template<>
void set_param ( LBFGSStepSize t,
ParamString  s 
)

Definition at line 154 of file params.cpp.

◆ set_param() [67/116]

template<>
void set_param ( PANOCStopCrit t,
ParamString  s 
)

Definition at line 166 of file params.cpp.

◆ set_param() [68/116]

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

Definition at line 196 of file params.cpp.

◆ set_param() [69/116]

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

◆ set_param() [70/116]

◆ set_param() [71/116]

◆ set_param() [72/116]

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

◆ set_param() [73/116]

◆ set_param() [74/116]

◆ set_param() [75/116]

◆ set_param() [76/116]

◆ set_param() [77/116]

◆ set_param() [78/116]

◆ set_param() [79/116]

◆ set_param() [80/116]

◆ set_param() [81/116]

◆ set_param() [82/116]

◆ set_param() [83/116]

◆ set_param() [84/116]

◆ set_param() [85/116]

◆ set_param() [86/116]

◆ set_param() [87/116]

◆ set_param() [88/116]

◆ set_param() [89/116]

◆ set_param() [90/116]

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

◆ set_param() [91/116]

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

◆ set_param() [92/116]

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

◆ set_param() [93/116]

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

◆ set_param() [94/116]

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

◆ set_param() [95/116]

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

◆ set_param() [96/116]

◆ set_param() [97/116]

◆ set_param() [98/116]

◆ set_param() [99/116]

◆ set_param() [100/116]

◆ set_param() [101/116]

◆ set_param() [102/116]

◆ set_param() [103/116]

◆ set_param() [104/116]

◆ set_param() [105/116]

◆ set_param() [106/116]

◆ set_param() [107/116]

◆ set_param() [108/116]

◆ set_param() [109/116]

◆ set_param() [110/116]

◆ set_param() [111/116]

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

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

◆ get_param() [55/57]

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() [112/116]

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() [113/116]

template void set_param ( lbfgsb::LBFGSBSolver::Params ,
const json &   
)

◆ get_param() [56/57]

template void get_param ( const lbfgsb::LBFGSBSolver::Params ,
json &   
)

◆ set_param() [114/116]

◆ set_param() [115/116]

template void set_param ( qpalm::Settings &  ,
const json &   
)

◆ get_param() [57/57]

template void get_param ( const qpalm::Settings &  ,
json &   
)

◆ set_param() [116/116]

template void set_param ( qpalm::Settings &  ,
ParamString   
)

Variable Documentation

◆ is_duration

template<class T >
constexpr bool is_duration = false
inlineconstexpr

Definition at line 33 of file json.cpp.