16template <
typename _Scalar>
20 using Base = CostAbstractTpl<Scalar>;
22 using Data = CompositeCostDataTpl<Scalar>;
31 shared_ptr<StageFunction> function,
32 const ConstMatrixRef &weights);
34 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
44 return std::make_shared<Data>(this->
ndx(), this->
nu,
45 residual_->createData());
49extern template struct QuadraticResidualCostTpl<context::Scalar>;
53#include "./quad-residual-cost.hxx"
Stage costs for control problems.
shared_ptr< Manifold > space
State dimension.
Quadratic composite of an underlying function.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
Evaluate the cost function.
ManifoldAbstractTpl< Scalar > Manifold
QuadraticResidualCostTpl(shared_ptr< Manifold > space, shared_ptr< StageFunction > function, const ConstMatrixRef &weights)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
Compute the cost gradients .
shared_ptr< CostData > createData() const
shared_ptr< StageFunction > residual_
void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
Compute the cost Hessians .
CompositeCostDataTpl< Scalar > Data