aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
aligator::python::PyStageFunction< FunctionBase > Struct Template Referencefinal

#include </home/runner/work/aligator/aligator/bindings/python/include/aligator/python/functions.hpp>

Inheritance diagram for aligator::python::PyStageFunction< FunctionBase >:
[legend]
Collaboration diagram for aligator::python::PyStageFunction< FunctionBase >:
[legend]

Public Types

using Scalar = typename FunctionBase::Scalar
 
using Data = StageFunctionDataTpl<Scalar>
 
- Public Types inherited from aligator::StageFunctionTpl< Scalar >
using Scalar = _Scalar
 
using Data = StageFunctionDataTpl<Scalar>
 

Public Member Functions

 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 
void evaluate (const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const override
 Evaluate the function.
 
void computeJacobians (const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const override
 Compute Jacobians of this function.
 
void computeVectorHessianProducts (const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &lbda, Data &data) const override
 Compute the vector-hessian products of this function.
 
shared_ptr< DatacreateData () const override
 Instantiate a Data object.
 
shared_ptr< Datadefault_createData () const
 
- Public Member Functions inherited from aligator::StageFunctionTpl< Scalar >
 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 
 StageFunctionTpl (const int ndx, const int nu, const int nr)
 
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<class FunctionBase = context::StageFunction>
struct aligator::python::PyStageFunction< FunctionBase >

Wrapper for the StageFunction class and any virtual children that avoids having to redeclare Python overrides for these children.

This implements the "trampoline" technique from Pybind11's docs: https://pybind11.readthedocs.io/en/stable/advanced/classes.html#combining-virtual-functions-and-inheritance

Template Parameters
FunctionBaseThe virtual class to expose.

Definition at line 27 of file functions.hpp.

Member Typedef Documentation

◆ Scalar

template<class FunctionBase = context::StageFunction>
using aligator::python::PyStageFunction< FunctionBase >::Scalar = typename FunctionBase::Scalar

Definition at line 31 of file functions.hpp.

◆ Data

template<class FunctionBase = context::StageFunction>
using aligator::python::PyStageFunction< FunctionBase >::Data = StageFunctionDataTpl<Scalar>

Definition at line 32 of file functions.hpp.

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<class FunctionBase = context::StageFunction>
aligator::python::PyStageFunction< FunctionBase >::ALIGATOR_DYNAMIC_TYPEDEFS ( Scalar )

◆ evaluate()

template<class FunctionBase = context::StageFunction>
void aligator::python::PyStageFunction< FunctionBase >::evaluate ( const ConstVectorRef & x,
const ConstVectorRef & u,
Data & data ) const
inlineoverridevirtual

Evaluate the function.

Parameters
xCurrent state.
uControls.
dataData holding struct.

Implements aligator::StageFunctionTpl< Scalar >.

Definition at line 36 of file functions.hpp.

◆ computeJacobians()

template<class FunctionBase = context::StageFunction>
void aligator::python::PyStageFunction< FunctionBase >::computeJacobians ( const ConstVectorRef & x,
const ConstVectorRef & u,
Data & data ) const
inlineoverridevirtual

Compute Jacobians of this function.

This computes the Jacobians \( (\frac{\partial f}{\partial x}, \frac{\partial f}{\partial u}, \frac{\partial f}{\partial x'}) \)

Parameters
xCurrent state.
uControls.
yNext state.
dataData holding struct.

Implements aligator::StageFunctionTpl< Scalar >.

Definition at line 41 of file functions.hpp.

◆ computeVectorHessianProducts()

template<class FunctionBase = context::StageFunction>
void aligator::python::PyStageFunction< FunctionBase >::computeVectorHessianProducts ( const ConstVectorRef & x,
const ConstVectorRef & u,
const ConstVectorRef & lbda,
Data & data ) const
inlineoverridevirtual

Compute the vector-hessian products of this function.

Parameters
xCurrent state.
uControls.
yNext state.
lbdaMultiplier estimate.
dataData holding struct.

Reimplemented from aligator::StageFunctionTpl< Scalar >.

Definition at line 47 of file functions.hpp.

◆ createData()

template<class FunctionBase = context::StageFunction>
shared_ptr< Data > aligator::python::PyStageFunction< FunctionBase >::createData ( ) const
inlineoverridevirtual

Instantiate a Data object.

Reimplemented from aligator::StageFunctionTpl< Scalar >.

Definition at line 55 of file functions.hpp.

◆ default_createData()

template<class FunctionBase = context::StageFunction>
shared_ptr< Data > aligator::python::PyStageFunction< FunctionBase >::default_createData ( ) const
inline

Definition at line 59 of file functions.hpp.


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