aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
aligator::QuadraticResidualCostTpl< _Scalar > Struct Template Reference

Quadratic composite of an underlying function. More...

#include <aligator/modelling/costs/quad-residual-cost.hpp>

Inheritance diagram for aligator::QuadraticResidualCostTpl< _Scalar >:
[legend]
Collaboration diagram for aligator::QuadraticResidualCostTpl< _Scalar >:
[legend]

Public Types

using Scalar = _Scalar
using Base = CostAbstractTpl<Scalar>
using CostData = CostDataAbstractTpl<Scalar>
using Data = CompositeCostDataTpl<Scalar>
using StageFunction = StageFunctionTpl<Scalar>
using Manifold = ManifoldAbstractTpl<Scalar>
Public Types inherited from aligator::CostAbstractTpl< _Scalar >
using Scalar = _Scalar
using CostData = CostDataAbstractTpl<Scalar>
using Manifold = ManifoldAbstractTpl<Scalar>

Public Member Functions

 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 QuadraticResidualCostTpl (xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > function, const ConstMatrixRef &weights)
void evaluate (const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
 Evaluate the cost function.
void computeGradients (const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
 Compute the cost gradients \((\ell_x, \ell_u)\).
void computeHessians (const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const
 Compute the cost Hessians \((\ell_{ij})_{i,j \in \{x,u\}}\).
shared_ptr< CostDatacreateData () const
template<typename Derived>
Derived * getResidual ()
 Get a pointer to the underlying type of the residual, by attempting to cast.
template<typename Derived>
const Derived * getResidual () const
 Get a pointer to the underlying type of the residual, by attempting to cast.
Public Member Functions inherited from aligator::CostAbstractTpl< _Scalar >
 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
int nx () const
int ndx () const
template<class U>
 CostAbstractTpl (U &&space, const int nu)
virtual ~CostAbstractTpl ()=default

Public Attributes

MatrixXs weights_
xyz::polymorphic< StageFunctionresidual_
bool gauss_newton = true
Public Attributes inherited from aligator::CostAbstractTpl< _Scalar >
xyz::polymorphic< Manifoldspace
 State dimension.
int nu
 Control dimension.

Detailed Description

template<typename _Scalar>
struct aligator::QuadraticResidualCostTpl< _Scalar >

Quadratic composite of an underlying function.

This is defined as

\[ c(x, u) \overset{\triangle}{=} \frac{1}{2} \|r(x, u)\|_W^2. \]

Definition at line 18 of file quad-residual-cost.hpp.

Member Typedef Documentation

◆ Scalar

template<typename _Scalar>
using aligator::QuadraticResidualCostTpl< _Scalar >::Scalar = _Scalar

Definition at line 19 of file quad-residual-cost.hpp.

◆ Base

template<typename _Scalar>
using aligator::QuadraticResidualCostTpl< _Scalar >::Base = CostAbstractTpl<Scalar>

Definition at line 21 of file quad-residual-cost.hpp.

◆ CostData

template<typename _Scalar>
using aligator::QuadraticResidualCostTpl< _Scalar >::CostData = CostDataAbstractTpl<Scalar>

Definition at line 22 of file quad-residual-cost.hpp.

◆ Data

template<typename _Scalar>
using aligator::QuadraticResidualCostTpl< _Scalar >::Data = CompositeCostDataTpl<Scalar>

Definition at line 23 of file quad-residual-cost.hpp.

◆ StageFunction

template<typename _Scalar>
using aligator::QuadraticResidualCostTpl< _Scalar >::StageFunction = StageFunctionTpl<Scalar>

Definition at line 24 of file quad-residual-cost.hpp.

◆ Manifold

template<typename _Scalar>
using aligator::QuadraticResidualCostTpl< _Scalar >::Manifold = ManifoldAbstractTpl<Scalar>

Definition at line 25 of file quad-residual-cost.hpp.

Constructor & Destructor Documentation

◆ QuadraticResidualCostTpl()

template<typename _Scalar>
aligator::QuadraticResidualCostTpl< _Scalar >::QuadraticResidualCostTpl(xyz::polymorphic< Manifold >space,
xyz::polymorphic< StageFunction >function,
const ConstMatrixRef &weights )

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<typename _Scalar>
aligator::QuadraticResidualCostTpl< _Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)

◆ evaluate()

template<typename _Scalar>
void aligator::QuadraticResidualCostTpl< _Scalar >::evaluate(const ConstVectorRef &x,
const ConstVectorRef &u,
CostData &data ) const
virtual

Evaluate the cost function.

Reimplemented from aligator::CostAbstractTpl< _Scalar >.

◆ computeGradients()

template<typename _Scalar>
void aligator::QuadraticResidualCostTpl< _Scalar >::computeGradients(const ConstVectorRef &x,
const ConstVectorRef &u,
CostData &data ) const
virtual

Compute the cost gradients \((\ell_x, \ell_u)\).

Reimplemented from aligator::CostAbstractTpl< _Scalar >.

◆ computeHessians()

template<typename _Scalar>
void aligator::QuadraticResidualCostTpl< _Scalar >::computeHessians(const ConstVectorRef &x,
const ConstVectorRef &u,
CostData &data ) const
virtual

Compute the cost Hessians \((\ell_{ij})_{i,j \in \{x,u\}}\).

Reimplemented from aligator::CostAbstractTpl< _Scalar >.

◆ createData()

template<typename _Scalar>
shared_ptr< CostData > aligator::QuadraticResidualCostTpl< _Scalar >::createData()const
inlinevirtual

Reimplemented from aligator::CostAbstractTpl< _Scalar >.

Definition at line 44 of file quad-residual-cost.hpp.

◆ getResidual() [1/2]

template<typename _Scalar>
template<typename Derived>
Derived * aligator::QuadraticResidualCostTpl< _Scalar >::getResidual()
inline

Get a pointer to the underlying type of the residual, by attempting to cast.

Definition at line 51 of file quad-residual-cost.hpp.

◆ getResidual() [2/2]

template<typename _Scalar>
template<typename Derived>
const Derived * aligator::QuadraticResidualCostTpl< _Scalar >::getResidual()const
inline

Get a pointer to the underlying type of the residual, by attempting to cast.

Definition at line 56 of file quad-residual-cost.hpp.

Member Data Documentation

◆ weights_

template<typename _Scalar>
MatrixXs aligator::QuadraticResidualCostTpl< _Scalar >::weights_

Definition at line 27 of file quad-residual-cost.hpp.

◆ residual_

template<typename _Scalar>
xyz::polymorphic<StageFunction> aligator::QuadraticResidualCostTpl< _Scalar >::residual_

Definition at line 28 of file quad-residual-cost.hpp.

◆ gauss_newton

template<typename _Scalar>
bool aligator::QuadraticResidualCostTpl< _Scalar >::gauss_newton = true

Definition at line 29 of file quad-residual-cost.hpp.


The documentation for this struct was generated from the following file: