Stan Math Library  2.20.0
reverse mode automatic differentiation
Public Member Functions | Public Attributes | Friends | List of all members
stan::math::internal::ops_partials_edge< ViewElt, Op > Class Template Reference

An edge holds both the operands and its associated partial derivatives. More...

#include <operands_and_partials.hpp>

Public Member Functions

 ops_partials_edge ()
 
 ops_partials_edge (const Op &)
 

Public Attributes

empty_broadcast_array< ViewElt, Op > partials_
 

Friends

template<typename , typename , typename , typename , typename , typename >
class stan::math::operands_and_partials
 

Detailed Description

template<typename ViewElt, typename Op>
class stan::math::internal::ops_partials_edge< ViewElt, Op >

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.

Template Parameters
ViewEltthe type we expect to be at partials_[i]
Opthe type of the operand

Definition at line 36 of file operands_and_partials.hpp.

Constructor & Destructor Documentation

◆ ops_partials_edge() [1/2]

template<typename ViewElt, typename Op>
stan::math::internal::ops_partials_edge< ViewElt, Op >::ops_partials_edge ( )
inline

Definition at line 40 of file operands_and_partials.hpp.

◆ ops_partials_edge() [2/2]

template<typename ViewElt, typename Op>
stan::math::internal::ops_partials_edge< ViewElt, Op >::ops_partials_edge ( const Op &  )
inlineexplicit

Definition at line 41 of file operands_and_partials.hpp.

Friends And Related Function Documentation

◆ stan::math::operands_and_partials

template<typename ViewElt, typename Op>
template<typename , typename , typename , typename , typename , typename >
friend class stan::math::operands_and_partials
friend

Definition at line 45 of file operands_and_partials.hpp.

Member Data Documentation

◆ partials_

template<typename ViewElt, typename Op>
empty_broadcast_array<ViewElt, Op> stan::math::internal::ops_partials_edge< ViewElt, Op >::partials_

Definition at line 38 of file operands_and_partials.hpp.


The documentation for this class was generated from the following file:

     [ Stan Home Page ] © 2011–2018, Stan Development Team.