This file defines mappings from Python dicts (kwargs) to simple parameter structs.
Definition in file kwargs-to-struct.hpp.
#include <functional>
#include <map>
#include <variant>
#include <pybind11/detail/typeid.h>
#include <pybind11/pybind11.h>
#include <alpaqa/inner/decl/panoc.hpp>
#include <alpaqa/inner/pga.hpp>
#include <alpaqa/inner/guarded-aa-pga.hpp>
#include <alpaqa/inner/decl/structured-panoc-lbfgs.hpp>
#include <alpaqa/inner/directions/decl/lbfgs.hpp>
#include <alpaqa/decl/alm.hpp>
Go to the source code of this file.
Classes | |
struct | cast_error_with_types |
class | attr_setter_fun_t< T > |
Typedefs | |
template<class T > | |
using | kwargs_to_struct_table_t = std::map< std::string, attr_setter_fun_t< T > > |
Functions | |
template<class T , class A > | |
auto | attr_setter (A T::*attr) |
template<class T , class A > | |
auto | attr_getter (A T::*attr) |
template<class T > | |
void | kwargs_to_struct_helper (T &t, const py::kwargs &kwargs) |
template<class T > | |
py::dict | struct_to_dict_helper (const T &t) |
template<class T > | |
T | kwargs_to_struct (const py::kwargs &kwargs) |
template<class T > | |
py::dict | struct_to_dict (const T &t) |
template<class T > | |
T | var_kwargs_to_struct (const std::variant< T, py::dict > &p) |
Variables | |
template<class T > | |
kwargs_to_struct_table_t< T > | kwargs_to_struct_table |
using kwargs_to_struct_table_t = std::map<std::string, attr_setter_fun_t<T> > |
Definition at line 53 of file kwargs-to-struct.hpp.
auto attr_setter | ( | A T::* | attr | ) |
Definition at line 26 of file kwargs-to-struct.hpp.
auto attr_getter | ( | A T::* | attr | ) |
Definition at line 37 of file kwargs-to-struct.hpp.
void kwargs_to_struct_helper | ( | T & | t, |
const py::kwargs & | kwargs | ||
) |
py::dict struct_to_dict_helper | ( | const T & | t | ) |
Definition at line 80 of file kwargs-to-struct.hpp.
T kwargs_to_struct | ( | const py::kwargs & | kwargs | ) |
py::dict struct_to_dict | ( | const T & | t | ) |
Definition at line 100 of file kwargs-to-struct.hpp.
T var_kwargs_to_struct | ( | const std::variant< T, py::dict > & | p | ) |
kwargs_to_struct_table_t<T> kwargs_to_struct_table |
Definition at line 56 of file kwargs-to-struct.hpp.