WPILibC++ 2025.1.1
|
This class calculates the gradient of a a variable with respect to a vector of variables. More...
Public Member Functions | |
Gradient (Variable variable, Variable wrt) noexcept | |
Constructs a Gradient object. | |
Gradient (Variable variable, const VariableMatrix &wrt) noexcept | |
Constructs a Gradient object. | |
VariableMatrix | Get () const |
Returns the gradient as a VariableMatrix. | |
const Eigen::SparseVector< double > & | Value () |
Evaluates the gradient at wrt's value. | |
Profiler & | GetProfiler () |
Returns the profiler. | |
This class calculates the gradient of a a variable with respect to a vector of variables.
The gradient is only recomputed if the variable expression is quadratic or higher order.
|
inlinenoexcept |
|
inline |
Returns the gradient as a VariableMatrix.
This is useful when constructing optimization problems with derivatives in them.
|
inline |
Returns the profiler.
|
inline |
Evaluates the gradient at wrt's value.