Class Hessian
java.lang.Object
org.wpilib.math.autodiff.Hessian
- All Implemented Interfaces:
AutoCloseable
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 Summary
ConstructorsConstructorDescriptionConstructs a Hessian object.Hessian(Variable variable, VariableBlock wrt) Constructs a Hessian object.Hessian(Variable variable, VariableMatrix wrt) Constructs a Hessian object. -
Method Summary
-
Constructor Details
-
Hessian
-
Hessian
Constructs a Hessian object.- Parameters:
variable- Variable of which to compute the Hessian.wrt- Vector of variables with respect to which to compute the Hessian.
-
Hessian
Constructs a Hessian object.- Parameters:
variable- Variable of which to compute the Hessian.wrt- Vector of variables with respect to which to compute the Hessian.
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable
-
get
Returns the Hessian as a VariableMatrix.This is useful when constructing optimization problems with derivatives in them.
- Returns:
- The Hessian as a VariableMatrix.
-
value
Evaluates the Hessian at wrt's value.- Returns:
- The Hessian at wrt's value.
-