#include "tbb/tbb.h"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <iterator>
#include <numeric>
Go to the source code of this file.
Definition at line 55 of file tbb_preduce_01_t.cc.
58 size_t const n = 500000;
59 double const val = 27.125;
60 std::vector<double> v(n, val);
63 tbb::parallel_reduce(
br_t(v.cbegin(), v.cend()), m);
67 std::vector<double>::difference_type
const loc = 47856;
68 double const minval = 22.3;
72 tbb::parallel_reduce(
br_t(v.cbegin(), v.cend()), mincalc);
73 assert(mincalc.
valid() && std::distance(v.cbegin(), mincalc.
min()) == loc);
74 assert(*mincalc.
min() == minval);
tbb::blocked_range< typename std::vector< double >::const_iterator > br_t
br_t::const_iterator min() const