19template <
typename Scalar,
typename Base = StageFunctionTpl<Scalar>>
24 using Data = FunctionSliceDataTpl<Scalar>;
33 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
34 const ConstVectorRef &y,
BaseData &data)
const override {
40 const ConstVectorRef &y,
46 const ConstVectorRef &u,
47 const ConstVectorRef &y,
48 const ConstVectorRef &lbda,
54 return std::make_shared<Data>(*
this);
58template <
typename Scalar>
64 using Data = FunctionSliceDataTpl<Scalar>;
86 const ConstVectorRef &lbda,
92 return std::make_shared<Data>(*
this);
96template <
typename Scalar>
104 template <
typename Base>
117 using Data = FunctionSliceDataTpl<Scalar>;
127 template <
typename... Args>
130 template <
typename... Args>
133 template <
typename... Args>
135 const ConstVectorRef &lbda,
136 Args &&...args)
const;
142#include "aligator/modelling/function-xpr-slice.hxx"
144#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
145#include "aligator/modelling/function-xpr-slice.txx"
Base definitions for ternary functions.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
shared_ptr< BaseData > sub_data
FunctionSliceDataTpl(FunctionSliceXprTpl< Scalar, Base > const &obj)
ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar)
void computeJacobians(const ConstVectorRef &x, BaseData &data) const override
FunctionSliceXprTpl(shared_ptr< Base > func, const int idx)
FunctionSliceXprTpl(shared_ptr< Base > func, std::vector< int > const &indices)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void evaluate(const ConstVectorRef &x, BaseData &data) const override
FunctionSliceDataTpl< Scalar > Data
void computeVectorHessianProducts(const ConstVectorRef &x, const ConstVectorRef &lbda, BaseData &data) const override
shared_ptr< BaseData > createData() const override
Instantiate a Data object.
Represents a function of which the output is a subset of another function, for instance where is gi...
shared_ptr< BaseData > createData() const override
Instantiate a Data object.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void computeVectorHessianProducts(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, const ConstVectorRef &lbda, BaseData &data) const override
Compute the vector-hessian products of this function.
FunctionSliceXprTpl(shared_ptr< Base > func, std::vector< int > const &indices)
FunctionSliceDataTpl< Scalar > Data
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, BaseData &data) const override
Evaluate the function.
FunctionSliceXprTpl(shared_ptr< Base > func, const int idx)
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, BaseData &data) const override
Compute Jacobians of this function.
const int ndx2
Next state dimension.
const int nu
Control dimension.
const int ndx1
Current state dimension.
Represents unary functions of the form , with no control (or next-state) arguments.
Slicing and indexing of a function's output.
void computeJacobians_impl(BaseData &data, Args &&...args) const
FunctionSliceDataTpl< Scalar > Data
typename Base::Scalar Scalar
slice_impl_tpl(shared_ptr< Base > func, int idx)
void evaluate_impl(BaseData &data, Args &&...args) const
void computeVectorHessianProducts_impl(BaseData &data, const ConstVectorRef &lbda, Args &&...args) const
slice_impl_tpl(shared_ptr< Base > func, std::vector< int > const &indices)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
std::vector< int > indices