Stan Math Library
4.8.1
Automatic Differentiation
|
This struct is used by the TBB to accumulate partial sums over consecutive ranges of the input.
To distribute the workload, the TBB can split larger partial sums into smaller ones in which case the splitting copy constructor is used. It is designed to meet the Imperative form requirements of tbb::parallel_reduce
.
Definition at line 51 of file reduce_sum.hpp.
#include <reduce_sum.hpp>
Public Member Functions | |
template<typename VecT , typename... ArgsT> | |
recursive_reducer (size_t num_vars_per_term, size_t num_vars_shared_terms, double *sliced_partials, VecT &&vmapped, ArgsT &&... args) | |
recursive_reducer (recursive_reducer &other, tbb::split) | |
void | operator() (const tbb::blocked_range< size_t > &r) |
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). | |
void | join (const recursive_reducer &rhs) |
Join reducers. | |
Public Attributes | |
const size_t | num_vars_per_term_ |
const size_t | num_vars_shared_terms_ |
double * | sliced_partials_ |
Vec | vmapped_ |
std::stringstream | msgs_ |
std::tuple< Args... > | args_tuple_ |
scoped_args_tuple | local_args_tuple_scope_ |
double | sum_ {0.0} |
Eigen::VectorXd | args_adjoints_ {0} |