Alexander Stepanov stated in talks and interviews that his realization that eventually lead him to generic programming and the Standard Template Library, was from the case of the parallel reduction algorithm.
Why isn’t there parallel_reduction(begin,end,associativeop) in the STL? Or something that could easily be turned into it with an operator overload (inner_product does only one pass and accumulate does the operations asymetrically). I could not even find such in the SGI-version, nor in the numeric section.
Examples of what I am thinking:
parallel reduction of [a,b,c,d,e,f,g,h] with binary operator ~ is
((a ~ b) ~ (c ~ d)) ~ ((e ~ f) ~ (g ~ h))
as opposed to accumulate
(((((((a+b)+c)+d)+e)+f)+g)+h)
and with inner_product you can get only
(a*e)+(b*f)+(c*g)+(d*h)
if I am not mistaken.
5