Stan Math Library
4.9.0
Automatic Differentiation
|
An edge holds both the operands and its associated partial derivatives.
They're held together in the same class because then we can keep the templating logic that specializes on type of operand in one place.
This is the base template class that ends up getting instantiated for arithmetic primitives (doubles and ints).
NB: since ops_partials_edge.partials_ and ops_partials_edge.partials_vec are sometimes represented internally as a broadcast_array, we need to take care with assignments to them. Indeed, we can assign any right hand side which allows for indexing to a broadcast_array. The resulting behaviour is that the entry for the first index is what gets assigned. The most common use-case should be where the rhs is some container of length 1.
ViewElt | the type we expect to be at partials_[i] |
Op | the type of the operand |
Definition at line 45 of file operands_and_partials.hpp.