8#include <Eigen/SparseCore>
41 for (
auto& elem : wrt) {
50 for (
int row = 0; row < ret.Rows(); ++row) {
51 ret(row) =
Variable{std::move(grad[row])};
68 const Eigen::SparseMatrix<double>&
Value() {
return m_jacobian.Value(); }
This file defines the SmallVector class.
#define SLEIPNIR_DLLEXPORT
Definition SymbolExports.hpp:34
This class calculates the Hessian of a variable with respect to a vector of variables.
Definition Hessian.hpp:27
Profiler & GetProfiler()
Returns the profiler.
Definition Hessian.hpp:73
Hessian(Variable variable, const VariableMatrix &wrt) noexcept
Constructs a Hessian object.
Definition Hessian.hpp:36
VariableMatrix Get() const
Returns the Hessian as a VariableMatrix.
Definition Hessian.hpp:63
const Eigen::SparseMatrix< double > & Value()
Evaluates the Hessian at wrt's value.
Definition Hessian.hpp:68
This class calculates the Jacobian of a vector of variables with respect to a vector of variables.
Definition Jacobian.hpp:25
Records the number of profiler measurements (start/stop pairs) and the average duration between each ...
Definition Profiler.hpp:15
An autodiff variable pointing to an expression node.
Definition Variable.hpp:31
A matrix of autodiff variables.
Definition VariableMatrix.hpp:28
This class is an adaptor type that performs value updates of an expression's computational graph in a...
Definition ExpressionGraph.hpp:19
wpi::SmallVector< ExpressionPtr > GenerateGradientTree(std::span< const ExpressionPtr > wrt) const
Returns the variable's gradient tree.
Definition ExpressionGraph.hpp:123
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition SmallVector.h:1212
reference emplace_back(ArgTypes &&... Args)
Definition SmallVector.h:953
void reserve(size_type N)
Definition SmallVector.h:679
Definition Hessian.hpp:18