aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
fwd.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "aligator/fwd.hpp"
5
6namespace boost {
7template <typename T, typename A>
9 const T *r = x.operator->();
10 return const_cast<T *>(r);
11}
12} // namespace boost
13
14#include <eigenpy/eigenpy.hpp>
15#include <eigenpy/std-vector.hpp>
16
18
20namespace aligator::python {
21namespace bp = boost::python;
22using eigenpy::StdVectorPythonVisitor;
23
25inline bp::arg operator""_a(const char *argname, std::size_t) {
26 return bp::arg(argname);
27}
28
29namespace internal {
30
31template <typename ret_type>
32ret_type suppress_if_void(bp::detail::method_result &&o) {
33 if constexpr (!std::is_void_v<ret_type>)
34 return o.operator ret_type();
35}
36
37} // namespace internal
38
40void exposeGAR();
42void exposeFunctions();
44void exposeCosts();
46void exposeConstraint();
48void exposeStage();
50void exposeProblem();
51
53void exposeDynamics();
58
60void exposeSolvers();
62void exposeCallbacks();
64void exposeAutodiff();
66void exposeUtils();
68void exposeFilter();
69
70#ifdef ALIGATOR_WITH_PINOCCHIO
72void exposePinocchioFeatures();
73#endif
74
75} // namespace aligator::python
76
77#define ALIGATOR_PYTHON_OVERRIDE_IMPL(ret_type, pyname, ...) \
78 do { \
79 if (bp::override fo = this->get_override(pyname)) { \
80 decltype(auto) o = fo(__VA_ARGS__); \
81 return ::aligator::python::internal::suppress_if_void<ret_type>( \
82 std::move(o)); \
83 } \
84 } while (false)
85
91#define ALIGATOR_PYTHON_OVERRIDE_PURE(ret_type, pyname, ...) \
92 ALIGATOR_PYTHON_OVERRIDE_IMPL(ret_type, pyname, __VA_ARGS__); \
93 ALIGATOR_RUNTIME_ERROR("Tried to call pure virtual function {:s}.", pyname)
94
99#define ALIGATOR_PYTHON_OVERRIDE(ret_type, cname, fname, ...) \
100 ALIGATOR_PYTHON_OVERRIDE_IMPL(ret_type, #fname, __VA_ARGS__); \
101 return cname::fname(__VA_ARGS__)
Forward declarations.
The Python bindings.
Definition blk-matrix.hpp:5
void exposeGAR()
Expose GAR module.
void exposeConstraint()
Expose constraints.
void exposeStage()
Expose StageModel and StageData.
void exposeUtils()
Expose utils.
void exposeCosts()
Expose cost functions.
void exposeSolvers()
Expose solvers.
void exposeDynamics()
Expose discrete dynamics.
void exposeIntegrators()
Expose numerical integrators.
void exposeCallbacks()
Expose solver callbacks.
void exposeFilter()
Expose filter strategy.
void exposeProblem()
Expose TrajOptProblem.
void exposeContinuousDynamics()
Expose continuous dynamics.
void exposeAutodiff()
Expose autodiff helpers.
void exposeFunctions()
Expose stagewise function classes.
Definition data.hpp:14
T * get_pointer(::xyz::polymorphic< T, A > const &x)
Definition fwd.hpp:8