aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1
3#pragma once
4
5#include <eigenpy/registration.hpp>
6#include <proxsuite-nlp/python/utils/namespace.hpp>
7
8namespace aligator {
9namespace python {
10
11using proxsuite::nlp::python::get_namespace;
12using proxsuite::nlp::python::get_scope_name;
13
14template <typename T> bool register_enum_symlink(bool export_values) {
15 namespace bp = boost::python;
16 namespace converter = bp::converter;
17 if (eigenpy::register_symbolic_link_to_registered_type<T>()) {
18 const bp::type_info info = bp::type_id<T>();
19 const converter::registration *reg = converter::registry::query(info);
20 bp::object class_obj(bp::handle<>(reg->get_class_object()));
21 bp::enum_<T> &as_enum = static_cast<bp::enum_<T> &>(class_obj);
22 if (export_values)
23 as_enum.export_values();
24 return true;
25 }
26 return false;
27}
28
29} // namespace python
30} // namespace aligator
bool register_enum_symlink(bool export_values)
Definition utils.hpp:14
Main package namespace.