This class is an adaptor type that performs value updates of an expression's adjoint graph.
More...
#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/autodiff/adjoint_expression_graph.hpp>
This class is an adaptor type that performs value updates of an expression's adjoint graph.
◆ AdjointExpressionGraph()
slp::detail::AdjointExpressionGraph::AdjointExpressionGraph |
( |
const Variable & | root | ) |
|
|
inlineexplicit |
Generates the adjoint graph for the given expression.
- Parameters
-
root | The root node of the expression. |
◆ append_adjoint_triplets()
void slp::detail::AdjointExpressionGraph::append_adjoint_triplets |
( |
gch::small_vector< Eigen::Triplet< double > > & | triplets, |
|
|
int | row, |
|
|
const VariableMatrix & | wrt ) const |
|
inline |
Updates the adjoints in the expression graph (computes the gradient) then appends the adjoints of wrt to the sparse matrix triplets.
- Parameters
-
triplets | The sparse matrix triplets. |
row | The row of wrt. |
wrt | Vector of variables with respect to which to compute the Jacobian. |
◆ generate_gradient_tree()
Returns the variable's gradient tree.
This function lazily allocates variables, so elements of the returned VariableMatrix will be empty if the corresponding element of wrt had no adjoint. Ensure Variable::expr isn't nullptr before calling member functions.
- Parameters
-
wrt | Variables with respect to which to compute the gradient. |
- Returns
- The variable's gradient tree.
◆ update_values()
void slp::detail::AdjointExpressionGraph::update_values |
( |
| ) |
|
|
inline |
Update the values of all nodes in this adjoint graph based on the values of their dependent nodes.
The documentation for this class was generated from the following file: