Public Member Functions | |
| template<typename Reductor > | |
| ReductionOnSubranges (const Function &f, const Reductor &reductor, const ResultType neutral_element=ResultType()) | |
| ReductionOnSubranges (const ReductionOnSubranges &r, tbb::split) | |
| void | join (const ReductionOnSubranges &r) |
| template<typename RangeType > | |
| void | operator() (const tbb::blocked_range< RangeType > &range) |
Public Attributes | |
| ResultType | result |
Private Attributes | |
| const Function | f |
| const ResultType | neutral_element |
| const std_cxx1x::function < ResultType(ResultType, ResultType)> | reductor |
A class that conforms to the Body requirements of the TBB parallel_reduce function. The first template argument denotes the type on which the reduction is to be done. The second denotes the type of the function object that shall be called for each subrange.
Definition at line 497 of file parallel.h.
| parallel::internal::ReductionOnSubranges< ResultType, Function >::ReductionOnSubranges | ( | const Function & | f, |
| const Reductor & | reductor, | ||
| const ResultType | neutral_element = ResultType() |
||
| ) | [inline] |
Constructor. Take the function object to call on each sub-range as well as the neutral element with respect to the reduction operation.
The second argument denotes a function object that will be use to reduce the result of two computations into one number. An example if we want to simply accumulate integer results would be std::plus<int>().
Definition at line 521 of file parallel.h.
| parallel::internal::ReductionOnSubranges< ResultType, Function >::ReductionOnSubranges | ( | const ReductionOnSubranges< ResultType, Function > & | r, |
| tbb::split | |||
| ) | [inline] |
Splitting constructor. See the TBB book for more details about this.
Definition at line 535 of file parallel.h.
| void parallel::internal::ReductionOnSubranges< ResultType, Function >::join | ( | const ReductionOnSubranges< ResultType, Function > & | r ) | [inline] |
Join operation: merge the results from computations on different sub-intervals.
Definition at line 549 of file parallel.h.
References parallel::internal::ReductionOnSubranges< ResultType, Function >::reductor, and parallel::internal::ReductionOnSubranges< ResultType, Function >::result.
| void parallel::internal::ReductionOnSubranges< ResultType, Function >::operator() | ( | const tbb::blocked_range< RangeType > & | range ) | [inline] |
Execute the given function on the specified range.
Definition at line 559 of file parallel.h.
References parallel::internal::ReductionOnSubranges< ResultType, Function >::reductor, and parallel::internal::ReductionOnSubranges< ResultType, Function >::result.
| ResultType parallel::internal::ReductionOnSubranges< ResultType, Function >::result |
A variable that will hold the result of the reduction.
Definition at line 503 of file parallel.h.
Referenced by parallel::accumulate_from_subranges(), parallel::internal::ReductionOnSubranges< ResultType, Function >::join(), and parallel::internal::ReductionOnSubranges< ResultType, Function >::operator()().
const Function parallel::internal::ReductionOnSubranges< ResultType, Function >::f [private] |
The function object to call on every sub-range.
Definition at line 570 of file parallel.h.
const ResultType parallel::internal::ReductionOnSubranges< ResultType, Function >::neutral_element [private] |
The neutral element with respect to the reduction operation. This is needed when calling the splitting constructor since we have to re-set the result variable in this case.
Definition at line 580 of file parallel.h.
const std_cxx1x::function<ResultType (ResultType, ResultType)> parallel::internal::ReductionOnSubranges< ResultType, Function >::reductor [private] |
The function object to be used to reduce the result of two calls into one number.
Definition at line 587 of file parallel.h.
Referenced by parallel::internal::ReductionOnSubranges< ResultType, Function >::join(), and parallel::internal::ReductionOnSubranges< ResultType, Function >::operator()().
documentation generated on Fri Feb 3 2012 06:04:15 by
doxygen
1.7.2