aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
constant-cost.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace aligator {
6
8template <typename _Scalar> struct ConstantCostTpl : CostAbstractTpl<_Scalar> {
9 using Scalar = _Scalar;
13 using Manifold = ManifoldAbstractTpl<Scalar>;
14
16 ConstantCostTpl(xyz::polymorphic<Manifold> space, const int nu,
17 const Scalar value)
18 : Base(space, nu), value_(value) {}
19 void evaluate(const ConstVectorRef &, const ConstVectorRef &,
20 CostData &data) const override {
21 data.value_ = value_;
22 }
23
24 void computeGradients(const ConstVectorRef &, const ConstVectorRef &,
25 CostData &) const override {}
26
27 void computeHessians(const ConstVectorRef &, const ConstVectorRef &,
28 CostData &) const override {}
29
30 shared_ptr<CostData> createData() const override {
31 auto d = Base::createData();
32 d->value_ = value_;
33 return d;
34 }
35};
36
37} // namespace aligator
Main package namespace.
shared_ptr< CostData > createData() const override
void computeGradients(const ConstVectorRef &, const ConstVectorRef &, CostData &) const override
ManifoldAbstractTpl< Scalar > Manifold
void evaluate(const ConstVectorRef &, const ConstVectorRef &, CostData &data) const override
void computeHessians(const ConstVectorRef &, const ConstVectorRef &, CostData &) const override
ConstantCostTpl(xyz::polymorphic< Manifold > space, const int nu, const Scalar value)
Stage costs for control problems.
Definition fwd.hpp:65
virtual shared_ptr< CostData > createData() const
xyz::polymorphic< Manifold > space
Data struct for CostAbstractTpl.
Definition fwd.hpp:68