7#include <Eigen/SparseCore>
33 : m_jacobian{
std::move(variable),
std::move(wrt)} {}
60 const Eigen::SparseVector<double>&
value() {
61 m_g = m_jacobian.value().transpose();
67 Eigen::SparseVector<double> m_g;
This class calculates the gradient of a variable with respect to a vector of variables.
Definition gradient.hpp:24
Gradient(Variable variable, Variable wrt)
Constructs a Gradient object.
Definition gradient.hpp:32
Gradient(Variable variable, SleipnirMatrixLike auto wrt)
Constructs a Gradient object.
Definition gradient.hpp:42
const Eigen::SparseVector< double > & value()
Evaluates the gradient at wrt's value.
Definition gradient.hpp:60
VariableMatrix get() const
Returns the gradient as a VariableMatrix.
Definition gradient.hpp:53
This class calculates the Jacobian of a vector of variables with respect to a vector of variables.
Definition jacobian.hpp:26
An autodiff variable pointing to an expression node.
Definition variable.hpp:40
A matrix of autodiff variables.
Definition variable_matrix.hpp:29
VariableMatrix T() const
Returns the transpose of the variable matrix.
Definition variable_matrix.hpp:897
Definition concepts.hpp:30
Definition expression_graph.hpp:11
Definition PointerIntPair.h:280
#define SLEIPNIR_DLLEXPORT
Definition symbol_exports.hpp:34