5#include <proxsuite-nlp/modelling/spaces/vector-space.hpp>
6#include <proxsuite-nlp/third-party/polymorphic_cxx14.hpp>
16template <
typename _Scalar,
unsigned int arg>
17struct StateOrControlErrorResidual;
20template <
typename _Scalar>
27 using VectorSpace = proxsuite::nlp::VectorSpaceTpl<Scalar, Eigen::Dynamic>;
33 const int nu,
const ConstVectorRef &target)
34 :
Base(xspace->ndx(),
nu, xspace->ndx()),
space_(xspace),
36 if (!xspace->isNormalized(target)) {
38 "Target parameter invalid (not a viable element of state manifold.)");
42 void evaluate(
const ConstVectorRef &x,
Data &data)
const override {
51template <
typename _Scalar,
unsigned int arg>
53 static_assert(arg == 1,
"arg value must be 1");
59 using VectorSpace = proxsuite::nlp::VectorSpaceTpl<Scalar, Eigen::Dynamic>;
66 template <
unsigned int N = arg,
typename = std::enable_if_t<N == 1>>
68 const xyz::polymorphic<Manifold> &uspace,
69 const ConstVectorRef &target)
70 :
Base(ndx, uspace->nx(), uspace->ndx()),
space_(uspace),
72 check_target_viable();
79 return xyz::polymorphic<Manifold>(
VectorSpace(size));
81 template <
unsigned int N = arg,
typename = std::enable_if_t<N == 1>>
86 template <
unsigned int N = arg,
typename = std::enable_if_t<N == 1>>
89 check_target_viable();
92 void evaluate(
const ConstVectorRef &,
const ConstVectorRef &u,
93 Data &data)
const override {
104 Data &data)
const override {
115 inline void check_target_viable()
const {
118 "Target parameter invalid (not a viable element of state manifold.)");
125template <
typename Scalar>
131template <
typename Scalar>
140#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
141#include "aligator/modelling/state-error.txx"
#define ALIGATOR_RUNTIME_ERROR(...)
Base definitions for ternary functions.
Base struct for function data.
Represents unary functions of the form , with no control (or next-state) arguments.
StateOrControlErrorResidual(const xyz::polymorphic< Manifold > &xspace, const int nu, const ConstVectorRef &target)
void computeJacobians(const ConstVectorRef &x, Data &data) const override
xyz::polymorphic< Manifold > space_
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
ManifoldAbstractTpl< Scalar > Manifold
void evaluate(const ConstVectorRef &x, Data &data) const override
ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar)
proxsuite::nlp::VectorSpaceTpl< Scalar, Eigen::Dynamic > VectorSpace
ManifoldAbstractTpl< Scalar > Manifold
StateOrControlErrorResidual(const int ndx, const int nu)
StateOrControlErrorResidual(const int ndx, const xyz::polymorphic< Manifold > &uspace, const ConstVectorRef &target)
Constructor using the state space dimension, control manifold and control target.
StateOrControlErrorResidual(const int ndx, const ConstVectorRef &target)
proxsuite::nlp::VectorSpaceTpl< Scalar, Eigen::Dynamic > VectorSpace
void computeJacobians(const ConstVectorRef &, const ConstVectorRef &u, Data &data) const override
void evaluate(const ConstVectorRef &, const ConstVectorRef &u, Data &data) const override
auto get_polymorphic(const int &size) const
Constructor using state space and control space dimensions, the control space is assumed to be Euclid...
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
xyz::polymorphic< Manifold > space_