aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
aligator::autodiff::CostFiniteDifferenceHelper< Scalar > Struct Template Reference

#include <aligator/modelling/autodiff/cost-finite-difference.hpp>

Inheritance diagram for aligator::autodiff::CostFiniteDifferenceHelper< Scalar >:
[legend]
Collaboration diagram for aligator::autodiff::CostFiniteDifferenceHelper< Scalar >:
[legend]

Classes

struct  Data
 

Public Types

using Manifold = ManifoldAbstractTpl<Scalar>
 
using CostBase = CostAbstractTpl<Scalar>
 
using CostData = CostDataAbstractTpl<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)
 
 CostFiniteDifferenceHelper (xyz::polymorphic< CostBase > cost, const Scalar fd_eps)
 
void evaluate (const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const override
 Evaluate the cost function.
 
void computeGradients (const ConstVectorRef &x, const ConstVectorRef &u, CostData &data_) const override
 Compute the cost gradients \((\ell_x, \ell_u)\).
 
void computeHessians (const ConstVectorRef &, const ConstVectorRef &, CostData &) const override
 Compute the cost Hessians \((\ell_{ij})_{i,j \in \{x,u\}}\).
 
auto createData () const -> shared_ptr< CostData > override
 
- 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

xyz::polymorphic< CostBasecost_
 
Scalar fd_eps
 
xyz::polymorphic< Manifoldspace
 State dimension.
 
- Public Attributes inherited from aligator::CostAbstractTpl< Scalar >
xyz::polymorphic< Manifoldspace
 State dimension.
 
int nu
 Control dimension.
 

Detailed Description

template<typename Scalar>
struct aligator::autodiff::CostFiniteDifferenceHelper< Scalar >

Definition at line 9 of file cost-finite-difference.hpp.

Member Typedef Documentation

◆ Manifold

template<typename Scalar >
using aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::Manifold = ManifoldAbstractTpl<Scalar>

Definition at line 10 of file cost-finite-difference.hpp.

◆ CostBase

Definition at line 11 of file cost-finite-difference.hpp.

◆ CostData

Definition at line 12 of file cost-finite-difference.hpp.

Constructor & Destructor Documentation

◆ CostFiniteDifferenceHelper()

template<typename Scalar >
aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::CostFiniteDifferenceHelper ( xyz::polymorphic< CostBase > cost,
const Scalar fd_eps )

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<typename Scalar >
aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS ( Scalar )

◆ evaluate()

template<typename Scalar >
void aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::evaluate ( const ConstVectorRef & x,
const ConstVectorRef & u,
CostData & data ) const
overridevirtual

Evaluate the cost function.

Reimplemented from aligator::CostAbstractTpl< Scalar >.

◆ computeGradients()

template<typename Scalar >
void aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::computeGradients ( const ConstVectorRef & x,
const ConstVectorRef & u,
CostData & data ) const
overridevirtual

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

Reimplemented from aligator::CostAbstractTpl< Scalar >.

◆ computeHessians()

template<typename Scalar >
void aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::computeHessians ( const ConstVectorRef & ,
const ConstVectorRef & ,
CostData &  ) const
inlineoverridevirtual

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

Reimplemented from aligator::CostAbstractTpl< Scalar >.

Definition at line 30 of file cost-finite-difference.hpp.

◆ createData()

template<typename Scalar >
auto aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::createData ( ) const -> shared_ptr< CostData >
overridevirtual

Member Data Documentation

◆ cost_

template<typename Scalar >
xyz::polymorphic<CostBase> aligator::autodiff::CostFiniteDifferenceHelper< Scalar >::cost_

Definition at line 35 of file cost-finite-difference.hpp.

◆ fd_eps

Definition at line 36 of file cost-finite-difference.hpp.

◆ space

template<typename Scalar >
xyz::polymorphic<Manifold> aligator::CostAbstractTpl< Scalar >::space

State dimension.

Definition at line 20 of file cost-abstract.hpp.


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