aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
continuous-dynamics-abstract.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include "aligator/fwd.hpp"
8#include <proxsuite-nlp/manifold-base.hpp>
9#include <proxsuite-nlp/third-party/polymorphic_cxx14.hpp>
10
11namespace aligator {
12namespace dynamics {
13
19template <typename _Scalar> struct ContinuousDynamicsAbstractTpl {
20 using Scalar = _Scalar;
22 using Manifold = proxsuite::nlp::ManifoldAbstractTpl<Scalar>;
23 using ManifoldPtr = xyz::polymorphic<Manifold>;
25
29 const int nu_;
30
31 inline int ndx() const { return space_->ndx(); }
32 inline int nu() const { return nu_; }
33
35 inline const Manifold &space() const { return *space_; }
36
38
39 virtual ~ContinuousDynamicsAbstractTpl() = default;
40
46 virtual void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
47 const ConstVectorRef &xdot, Data &data) const = 0;
48
54 virtual void computeJacobians(const ConstVectorRef &x,
55 const ConstVectorRef &u,
56 const ConstVectorRef &xdot,
57 Data &data) const = 0;
58
60 virtual shared_ptr<Data> createData() const;
61};
62
64template <typename _Scalar> struct ContinuousDynamicsDataTpl {
65 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
66 using Scalar = _Scalar;
68
70 VectorXs value_;
72 MatrixXs Jx_;
74 MatrixXs Ju_;
76 MatrixXs Jxdot_;
78 VectorXs xdot_;
79
80 ContinuousDynamicsDataTpl(const int ndx, const int nu);
81
82 // marks this type as polymorphic; required for Boost.Python
83 virtual ~ContinuousDynamicsDataTpl() = default;
84};
85
86} // namespace dynamics
87} // namespace aligator
88
89#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
90#include "aligator/modelling/dynamics/continuous-dynamics-abstract.txx"
91#endif
Forward declarations.
Main package namespace.
virtual shared_ptr< Data > createData() const
Create a data holder instance.
ContinuousDynamicsAbstractTpl(ManifoldPtr space, const int nu)
const Manifold & space() const
Return a reference to the state space.
virtual void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &xdot, Data &data) const =0
Differentiate the vector field.
virtual void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &xdot, Data &data) const =0
Evaluate the vector field at a point .
proxsuite::nlp::ManifoldAbstractTpl< Scalar > Manifold
Data struct for ContinuousDynamicsAbstractTpl.
Definition fwd.hpp:15
VectorXs xdot_
Time derivative , output of ODE model.
ContinuousDynamicsDataTpl(const int ndx, const int nu)