7#include <Eigen/SparseCore>
24template <
typename Scalar>
32 : m_jacobian{
std::move(variable),
std::move(wrt)} {}
53 const Eigen::SparseVector<Scalar>&
value() {
54 m_g = m_jacobian.value().transpose();
60 Eigen::SparseVector<Scalar> m_g;
#define EXPORT_TEMPLATE_DECLARE(export)
Definition SymbolExports.hpp:94
const Eigen::SparseVector< Scalar > & value()
Evaluates the gradient at wrt's value.
Definition gradient.hpp:53
Gradient(Variable< Scalar > variable, SleipnirMatrixLike< Scalar > auto wrt)
Constructs a Gradient object.
Definition gradient.hpp:39
VariableMatrix< Scalar > get() const
Returns the gradient as a VariableMatrix.
Definition gradient.hpp:48
Gradient(Variable< Scalar > variable, Variable< Scalar > wrt)
Constructs a Gradient object.
Definition gradient.hpp:31
This class calculates the Jacobian of a vector of variables with respect to a vector of variables.
Definition jacobian.hpp:28
An autodiff variable pointing to an expression node.
Definition variable.hpp:47
A matrix of autodiff variables.
Definition variable_matrix.hpp:33
VariableMatrix< Scalar > T() const
Returns the transpose of the variable matrix.
Definition variable_matrix.hpp:957
Definition concepts.hpp:33
Definition expression_graph.hpp:11
Definition StringMap.hpp:773
#define SLEIPNIR_DLLEXPORT
Definition symbol_exports.hpp:34