Boost logo

Boost :

From: Ben FrantzDale (benfrantzdale_at_[hidden])
Date: 2007-02-08 14:15:45


On 2/8/07, Matthias Troyer <troyer_at_[hidden]> wrote:
>
> ...
> A possible solution would indeed be to have a simple combine method
> for those accumulators where this is possible, and to work on a
> general solution later. This would immediately give the combine
> functionality to a part of the user community, while for the more
> demanding applications we have to wait.
>
> Matthias

That sounds reasonable. Two things:
1. It might be a good idea to decide now on a concept for Combinable
Accumulator so people don't run off and make ad-hoc ones. The syntax
acc1(acc2) seems nice and has the most obvious semantics of the options I
can think of. On the other hand,
  acc1 = combine(acc1, acc2);
might be more generic.

2. Since some accumulators would have to be implemented differently to be
combinable, would it make sense to use the dependency mechanism to request a
combinable accumulator? That is, a syntax like
  accumulator_set<double, stats<tag::mean, tag::moment<2>, tag::combinable>
> acc;
If possible, this would be a nice syntax to request that every accumulator
be combinable.

—Ben


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk