22 xyz::polymorphic<StageFunction> function,
23 const ConstVectorRef &scale);
26 xyz::polymorphic<StageFunction> function,
29 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
39 return std::make_shared<Data>(this->
ndx(), this->
nu,
40 residual_->createData());
46 return dynamic_cast<Derived *
>(&*
residual_);
50 template <
typename Derived>
const Derived *
getResidual()
const {
51 return dynamic_cast<const Derived *
>(&*
residual_);
55extern template struct LogResidualCostTpl<context::Scalar>;
59#include "./log-residual-cost.hxx"
Data struct for composite costs.
Stage costs for control problems.
xyz::polymorphic< Manifold > space
State dimension.
Data struct for CostAbstractTpl.
Log-barrier of an underlying cost function.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
xyz::polymorphic< StageFunction > residual_
shared_ptr< CostDataAbstract > createData() const
LogResidualCostTpl(xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const Scalar scale)
Derived * getResidual()
Get a pointer to the underlying type of the residual, by attempting to cast.
VectorXs barrier_weights_
LogResidualCostTpl(xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const ConstVectorRef &scale)
const Derived * getResidual() const
Get a pointer to the underlying type of the residual, by attempting to cast.
ManifoldAbstractTpl< Scalar > Manifold
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostDataAbstract &data) const
Evaluate the cost function.
void computeHessians(const ConstVectorRef &, const ConstVectorRef &, CostDataAbstract &data) const
Compute the cost Hessians .
void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u, CostDataAbstract &data) const
Compute the cost gradients .
Class representing ternary functions .