aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
log-residual-cost.hpp
Go to the documentation of this file.
1
3#pragma once
4
6
7namespace aligator {
8
10template <typename Scalar> struct LogResidualCostTpl : CostAbstractTpl<Scalar> {
17
20
23 const ConstVectorRef &scale);
24
27 const Scalar scale);
28
29 void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
30 CostDataAbstract &data) const;
31
32 void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u,
33 CostDataAbstract &data) const;
34
35 void computeHessians(const ConstVectorRef &, const ConstVectorRef &,
36 CostDataAbstract &data) const;
37
38 shared_ptr<CostDataAbstract> createData() const {
39 return std::make_shared<Data>(this->ndx(), this->nu,
40 residual_->createData());
41 }
42
45 template <typename Derived> Derived *getResidual() {
46 return dynamic_cast<Derived *>(&*residual_);
47 }
48
50 template <typename Derived> const Derived *getResidual() const {
51 return dynamic_cast<const Derived *>(&*residual_);
52 }
53};
54
55extern template struct LogResidualCostTpl<context::Scalar>;
56
57} // namespace aligator
58
59#include "./log-residual-cost.hxx"
Main package namespace.
Data struct for composite costs.
xyz::polymorphic< Manifold > space
CostAbstractTpl(U &&space, const int nu)
Data struct for CostAbstractTpl.
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.
LogResidualCostTpl(xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const ConstVectorRef &scale)
CompositeCostDataTpl< Scalar > Data
CostAbstractTpl< Scalar > Base
StageFunctionTpl< Scalar > StageFunction
CostDataAbstractTpl< Scalar > CostDataAbstract
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 .
Base class for manifolds, to use in cost funcs, solvers...
Class representing ternary functions .