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

Approximate the derivatives of a given function using finite differences, to downcast the function to a StageFunctionTpl. More...

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

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

Public Types

using Scalar = _Scalar
 
using Impl = internal::finite_difference_impl<Scalar, StageFunctionTpl>
 
using StageFunction = StageFunctionTpl<Scalar>
 
using Manifold = ManifoldAbstractTpl<Scalar>
 
using Data = typename Impl::Data
 
using BaseData = StageFunctionDataTpl<Scalar>
 
- Public Types inherited from aligator::StageFunctionTpl< _Scalar >
using Scalar
 
using Data
 

Public Member Functions

 ALIGATOR_DYNAMIC_TYPEDEFS (_Scalar)
 
 FiniteDifferenceHelper (xyz::polymorphic< Manifold > space, xyz::polymorphic< StageFunction > func, const Scalar fd_eps)
 
void evaluate (const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const
 
void computeJacobians (const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const
 
shared_ptr< BaseDatacreateData () const
 Instantiate a Data object.
 
- Public Member Functions inherited from aligator::StageFunctionTpl< _Scalar >
 ALIGATOR_DYNAMIC_TYPEDEFS (_Scalar)
 
 StageFunctionTpl (const int ndx, const int nu, const int nr)
 
virtual void evaluate (const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const=0
 Evaluate the function.
 
virtual void computeJacobians (const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const=0
 Compute Jacobians of this function.
 
virtual void computeVectorHessianProducts (const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &lbda, Data &data) const
 Compute the vector-hessian products of this function.
 
virtual ~StageFunctionTpl ()=default
 

Additional Inherited Members

- Public Attributes inherited from aligator::StageFunctionTpl< _Scalar >
const int ndx1
 Current state dimension.
 
const int nu
 Control dimension.
 
const int nr
 Function codimension.
 

Detailed Description

template<typename _Scalar>
struct aligator::autodiff::FiniteDifferenceHelper< _Scalar >

Approximate the derivatives of a given function using finite differences, to downcast the function to a StageFunctionTpl.

Definition at line 189 of file finite-difference.hpp.

Member Typedef Documentation

◆ Scalar

template<typename _Scalar >
using aligator::autodiff::FiniteDifferenceHelper< _Scalar >::Scalar = _Scalar

Definition at line 190 of file finite-difference.hpp.

◆ Impl

template<typename _Scalar >
using aligator::autodiff::FiniteDifferenceHelper< _Scalar >::Impl = internal::finite_difference_impl<Scalar, StageFunctionTpl>

Definition at line 191 of file finite-difference.hpp.

◆ StageFunction

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

Definition at line 193 of file finite-difference.hpp.

◆ Manifold

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

Definition at line 194 of file finite-difference.hpp.

◆ Data

template<typename _Scalar >
using aligator::autodiff::FiniteDifferenceHelper< _Scalar >::Data = typename Impl::Data

Definition at line 195 of file finite-difference.hpp.

◆ BaseData

template<typename _Scalar >
using aligator::autodiff::FiniteDifferenceHelper< _Scalar >::BaseData = StageFunctionDataTpl<Scalar>

Definition at line 196 of file finite-difference.hpp.

Constructor & Destructor Documentation

◆ FiniteDifferenceHelper()

template<typename _Scalar >
aligator::autodiff::FiniteDifferenceHelper< _Scalar >::FiniteDifferenceHelper ( xyz::polymorphic< Manifold > space,
xyz::polymorphic< StageFunction > func,
const Scalar fd_eps )
inline

Definition at line 200 of file finite-difference.hpp.

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<typename _Scalar >
aligator::autodiff::FiniteDifferenceHelper< _Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS ( _Scalar )

◆ evaluate()

template<typename _Scalar >
void aligator::autodiff::FiniteDifferenceHelper< _Scalar >::evaluate ( const ConstVectorRef & x,
const ConstVectorRef & u,
BaseData & data ) const
inline

Definition at line 206 of file finite-difference.hpp.

◆ computeJacobians()

template<typename _Scalar >
void aligator::autodiff::FiniteDifferenceHelper< _Scalar >::computeJacobians ( const ConstVectorRef & x,
const ConstVectorRef & u,
BaseData & data ) const
inline

Definition at line 211 of file finite-difference.hpp.

◆ createData()

template<typename _Scalar >
shared_ptr< BaseData > aligator::autodiff::FiniteDifferenceHelper< _Scalar >::createData ( ) const
inlinevirtual

Instantiate a Data object.

Reimplemented from aligator::StageFunctionTpl< _Scalar >.

Definition at line 216 of file finite-difference.hpp.


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