Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ operator()()

template<typename ReduceFunction , typename ReturnType , typename Vec , typename... Args>
void stan::math::internal::reduce_sum_impl< ReduceFunction, require_var_t< ReturnType >, ReturnType, Vec, Args... >::recursive_reducer::operator() ( const tbb::blocked_range< size_t > &  r)
inline

Compute, using nested autodiff, the value and Jacobian of ReduceFunction called over the range defined by r and accumulate those in member variable sum_ (for the value) and args_adjoints_ (for the Jacobian).

The nested autodiff uses deep copies of the involved operands ensuring that no side effects are implied to the adjoints of the input operands which reside potentially on a autodiff tape stored in a different thread other than the current thread of execution. This function may be called multiple times per object instantiation (so the sum_ and args_adjoints_ must be accumulated, not just assigned).

Parameters
rRange over which to compute reduce_sum

Definition at line 97 of file reduce_sum.hpp.