WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
sleipnir::Hessian Class Reference

This class calculates the Hessian of a variable with respect to a vector of variables. More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/autodiff/Hessian.hpp>

Public Member Functions

 Hessian (Variable variable, const VariableMatrix &wrt) noexcept
 Constructs a Hessian object.
 
VariableMatrix Get () const
 Returns the Hessian as a VariableMatrix.
 
const Eigen::SparseMatrix< double > & Value ()
 Evaluates the Hessian at wrt's value.
 
ProfilerGetProfiler ()
 Returns the profiler.
 

Detailed Description

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

The gradient tree is cached so subsequent Hessian calculations are faster, and the Hessian is only recomputed if the variable expression is nonlinear.

Constructor & Destructor Documentation

◆ Hessian()

sleipnir::Hessian::Hessian ( Variable variable,
const VariableMatrix & wrt )
inlinenoexcept

Constructs a Hessian object.

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

Member Function Documentation

◆ Get()

VariableMatrix sleipnir::Hessian::Get ( ) const
inline

Returns the Hessian as a VariableMatrix.

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

◆ GetProfiler()

Profiler & sleipnir::Hessian::GetProfiler ( )
inline

Returns the profiler.

◆ Value()

const Eigen::SparseMatrix< double > & sleipnir::Hessian::Value ( )
inline

Evaluates the Hessian at wrt's value.


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