17template <
typename _Scalar>
32 xyz::polymorphic<StageFunction> function,
33 const ConstMatrixRef &weights);
35 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
45 return std::make_shared<Data>(this->
ndx(), this->
nu,
46 residual_->createData());
52 return dynamic_cast<Derived *
>(&*
residual_);
56 template <
typename Derived>
const Derived *
getResidual()
const {
57 return dynamic_cast<const Derived *
>(&*
residual_);
61extern template struct QuadraticResidualCostTpl<context::Scalar>;
65#include "./quad-residual-cost.hxx"
Data struct for composite costs.
Stage costs for control problems.
xyz::polymorphic< Manifold > space
Data struct for CostAbstractTpl.
Quadratic composite of an underlying function.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
ManifoldAbstractTpl< Scalar > Manifold
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
shared_ptr< CostData > createData() const
Derived * getResidual()
Get a pointer to the underlying type of the residual, by attempting to cast.
void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
xyz::polymorphic< StageFunction > residual_
const Derived * getResidual() const
Get a pointer to the underlying type of the residual, by attempting to cast.
QuadraticResidualCostTpl(xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const ConstMatrixRef &weights)
Class representing ternary functions .