7#include <proxsuite-nlp/third-party/polymorphic_cxx14.hpp>
20template <
typename Scalar,
typename Base = StageFunctionTpl<Scalar>>
23template <
typename Scalar>
34 std::vector<int>
const &indices)
35 :
Base(func->ndx1, func->nu, (int)indices.size()),
41 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
44 this->evaluate_impl(data, x, u);
49 this->computeJacobians_impl(data, x, u);
53 const ConstVectorRef &u,
54 const ConstVectorRef &lbda,
56 this->computeVectorHessianProducts_impl(data, lbda, x, u);
60 return std::make_shared<Data>(*
this);
64template <
typename Scalar>
75 std::vector<int>
const &indices)
76 :
Base(func->ndx1, func->nu, (int)indices.size()),
84 this->evaluate_impl(data, x);
89 this->computeJacobians_impl(data, x);
93 const ConstVectorRef &lbda,
95 this->computeVectorHessianProducts_impl(data, lbda, x);
99 return std::make_shared<Data>(*
this);
103template <
typename Scalar>
111 template <
typename Base>
134 template <
typename... Args>
137 template <
typename... Args>
140 template <
typename... Args>
142 const ConstVectorRef &lbda,
143 Args &&...args)
const;
149#include "aligator/modelling/function-xpr-slice.hxx"
151#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
152#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)
FunctionSliceXprTpl(xyz::polymorphic< Base > func, const int idx)
void computeVectorHessianProducts(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &lbda, BaseData &data) const override
Compute the vector-hessian products of this function.
shared_ptr< BaseData > createData() const override
Instantiate a Data object.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const override
Evaluate the function.
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const override
Compute Jacobians of this function.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
FunctionSliceXprTpl(xyz::polymorphic< Base > func, std::vector< int > const &indices)
ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar)
void computeJacobians(const ConstVectorRef &x, BaseData &data) const override
FunctionSliceXprTpl(xyz::polymorphic< Base > func, const int idx)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void evaluate(const ConstVectorRef &x, BaseData &data) const override
void computeVectorHessianProducts(const ConstVectorRef &x, const ConstVectorRef &lbda, BaseData &data) const override
FunctionSliceXprTpl(xyz::polymorphic< Base > func, std::vector< int > const &indices)
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...
Base struct for function data.
Class representing ternary functions .
Represents unary functions of the form , with no control (or next-state) arguments.
Slicing and indexing of a function's output.
slice_impl_tpl(xyz::polymorphic< Base > func, std::vector< int > const &indices)
void computeJacobians_impl(BaseData &data, Args &&...args) const
typename Base::Scalar Scalar
xyz::polymorphic< Base > func
void evaluate_impl(BaseData &data, Args &&...args) const
void computeVectorHessianProducts_impl(BaseData &data, const ConstVectorRef &lbda, Args &&...args) const
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
slice_impl_tpl(xyz::polymorphic< Base > func, int idx)
std::vector< int > indices