alpaqa 0.0.1
Nonconvex constrained optimization
Classes | Typedefs | Functions | Variables
kwargs-to-struct.hpp File Reference

Detailed Description

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>
+ Include dependency graph for kwargs-to-struct.hpp:
+ This graph shows which files directly or indirectly include this file:

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 >
kwargs_to_struct (const py::kwargs &kwargs)
 
template<class T >
py::dict struct_to_dict (const T &t)
 
template<class 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
 

Typedef Documentation

◆ kwargs_to_struct_table_t

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.

Function Documentation

◆ attr_setter()

auto attr_setter ( A T::*  attr)

Definition at line 26 of file kwargs-to-struct.hpp.

◆ attr_getter()

auto attr_getter ( A T::*  attr)

Definition at line 37 of file kwargs-to-struct.hpp.

◆ kwargs_to_struct_helper()

void kwargs_to_struct_helper ( T &  t,
const py::kwargs &  kwargs 
)

Definition at line 59 of file kwargs-to-struct.hpp.

+ Here is the caller graph for this function:

◆ struct_to_dict_helper()

py::dict struct_to_dict_helper ( const T &  t)

Definition at line 80 of file kwargs-to-struct.hpp.

◆ kwargs_to_struct()

T kwargs_to_struct ( const py::kwargs &  kwargs)

Definition at line 93 of file kwargs-to-struct.hpp.

+ Here is the call graph for this function:

◆ struct_to_dict()

py::dict struct_to_dict ( const T &  t)

Definition at line 100 of file kwargs-to-struct.hpp.

◆ var_kwargs_to_struct()

T var_kwargs_to_struct ( const std::variant< T, py::dict > &  p)

Definition at line 105 of file kwargs-to-struct.hpp.

+ Here is the caller graph for this function:

Variable Documentation

◆ kwargs_to_struct_table

kwargs_to_struct_table_t<T> kwargs_to_struct_table

Definition at line 56 of file kwargs-to-struct.hpp.