aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
quad-residual-cost.hpp
Go to the documentation of this file.
1
3#pragma once
4
7
8namespace aligator {
9
17template <typename _Scalar>
19 using Scalar = _Scalar;
25 using Manifold = ManifoldAbstractTpl<Scalar>;
26
27 MatrixXs weights_;
28 xyz::polymorphic<StageFunction> residual_;
29 bool gauss_newton = true;
30
31 QuadraticResidualCostTpl(xyz::polymorphic<Manifold> space,
32 xyz::polymorphic<StageFunction> function,
33 const ConstMatrixRef &weights);
34
35 void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
36 CostData &data_) const;
37
38 void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u,
39 CostData &data_) const;
40
41 void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u,
42 CostData &data_) const;
43
44 shared_ptr<CostData> createData() const {
45 return std::make_shared<Data>(this->ndx(), this->nu,
46 residual_->createData());
47 }
48
51 template <typename Derived> Derived *getResidual() {
52 return dynamic_cast<Derived *>(&*residual_);
53 }
54
56 template <typename Derived> const Derived *getResidual() const {
57 return dynamic_cast<const Derived *>(&*residual_);
58 }
59};
60
61extern template struct QuadraticResidualCostTpl<context::Scalar>;
62
63} // namespace aligator
64
65#include "./quad-residual-cost.hxx"
Main package namespace.
Data struct for composite costs.
Stage costs for control problems.
Definition fwd.hpp:62
xyz::polymorphic< Manifold > space
Data struct for CostAbstractTpl.
Definition fwd.hpp:65
Quadratic composite of an underlying function.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
ManifoldAbstractTpl< Scalar > Manifold
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 .
Definition fwd.hpp:53