7#include <proxsuite-nlp/manifold-base.hpp>
19template <
typename _Scalar>
20struct ExplicitDynamicsModelTpl : DynamicsModelTpl<_Scalar> {
37 void virtual forward(
const ConstVectorRef &x,
const ConstVectorRef &u,
38 Data &data)
const = 0;
41 void virtual dForward(
const ConstVectorRef &x,
const ConstVectorRef &u,
42 Data &data)
const = 0;
44 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
45 const ConstVectorRef &y,
BaseData &data)
const;
48 const ConstVectorRef &y,
BaseData &data)
const;
55template <
typename _Scalar>
57 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
87 oss <<
"ExplicitDynamicsData { ";
88 oss << fmt::format(
"ndx: {:d}, ", self.
ndx1);
89 oss << fmt::format(
"nu: {:d}", self.
nu);
96#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
97#include "aligator/core/explicit-dynamics.txx"
std::ostream & operator<<(std::ostream &oss, const ExplicitDynamicsDataTpl< S > &self)
MatrixRef Jx_
Jacobian with respect to .
MatrixRef Jy_
Jacobian with respect to .
VectorXs value_
Function value.
MatrixRef Ju_
Jacobian with respect to .
Dynamics model: describes system dynamics through an implicit relation .
const Manifold & space() const
Specific data struct for explicit dynamics ExplicitDynamicsModelTpl.
MatrixXs Jtmp_xnext
Jacobian.
ExplicitDynamicsDataTpl(const int ndx1, const int nu, const int nx2, const int ndx2)
virtual ~ExplicitDynamicsDataTpl()=default
friend std::ostream & operator<<(std::ostream &oss, const ExplicitDynamicsDataTpl< S > &self)
VectorXs xnext_
Model next state.
VectorXs dx_
Difference vector between current state x and xnext_.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
virtual shared_ptr< BaseData > createData() const
bool isExplicit() const
Check if this dynamics model is implicit or explicit.
ManifoldAbstractTpl< Scalar > Manifold
virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const =0
Evaluate the forward discrete dynamics.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, BaseData &data) const
virtual ~ExplicitDynamicsModelTpl()=default
ExplicitDynamicsModelTpl(const ManifoldPtr &space, const int nu)
Constructor requires providing the next state's manifold.
virtual void dForward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const =0
Compute the Jacobians of the forward dynamics.
xyz::polymorphic< Manifold > ManifoldPtr
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, BaseData &data) const