BlockedRangeWDPReducer (WDPin &in) : wd (in), result (in.identity ()) {}
inline void operator () (tbb::blocked_range<int>& rng) const { for (int i = rng.begin (); i != rng.end (); ++i) { wd->execute (i); } }
void operator()(tbb::blocked_range<int> &rng) { for(int i=rng.begin(); i<rng.end(); ++i) { wd.result = wd.reduce(wd.result, wd.generate(i)); } }
inline void join( const BlockedRangeWDPReducer<WDPin> &other ) { wd.result = wd.reduce( wd.result, other.wd.result ); }
BlockedRangeWDPReducer(BlockedRangeWDPReducer &in, tbb::split) : wd(in.wd) { wd.result = wd.identity(); }