Sleipnir C++ API
Loading...
Searching...
No Matches
slp::Jacobian< Scalar > Class Template Reference

#include <sleipnir/autodiff/jacobian.hpp>

Public Member Functions

 Jacobian (Variable< Scalar > variable, Variable< Scalar > wrt)
 
 Jacobian (Variable< Scalar > variable, SleipnirMatrixLike< Scalar > auto wrt)
 
 Jacobian (VariableMatrix< Scalar > variables, SleipnirMatrixLike< Scalar > auto wrt)
 
VariableMatrix< Scalar > get () const
 
const Eigen::SparseMatrix< Scalar > & value ()
 

Detailed Description

template<typename Scalar>
class slp::Jacobian< Scalar >

This class calculates the Jacobian of a vector of variables with respect to a vector of variables.

The Jacobian is only recomputed if the variable expression is quadratic or higher order.

Template Parameters
ScalarScalar type.

Constructor & Destructor Documentation

◆ Jacobian() [1/3]

template<typename Scalar >
slp::Jacobian< Scalar >::Jacobian ( Variable< Scalar >  variable,
Variable< Scalar >  wrt 
)
inline

Constructs a Jacobian object.

Parameters
variableVariable of which to compute the Jacobian.
wrtVariable with respect to which to compute the Jacobian.

◆ Jacobian() [2/3]

template<typename Scalar >
slp::Jacobian< Scalar >::Jacobian ( Variable< Scalar >  variable,
SleipnirMatrixLike< Scalar > auto  wrt 
)
inline

Constructs a Jacobian object.

Parameters
variableVariable of which to compute the Jacobian.
wrtVector of variables with respect to which to compute the Jacobian.

◆ Jacobian() [3/3]

template<typename Scalar >
slp::Jacobian< Scalar >::Jacobian ( VariableMatrix< Scalar >  variables,
SleipnirMatrixLike< Scalar > auto  wrt 
)
inline

Constructs a Jacobian object.

Parameters
variablesVector of variables of which to compute the Jacobian.
wrtVector of variables with respect to which to compute the Jacobian.

Member Function Documentation

◆ get()

template<typename Scalar >
VariableMatrix< Scalar > slp::Jacobian< Scalar >::get ( ) const
inline

Returns the Jacobian as a VariableMatrix.

This is useful when constructing optimization problems with derivatives in them.

Returns
The Jacobian as a VariableMatrix.

◆ value()

template<typename Scalar >
const Eigen::SparseMatrix< Scalar > & slp::Jacobian< Scalar >::value ( )
inline

Evaluates the Jacobian at wrt's value.

Returns
The Jacobian at wrt's value.

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