Boost logo

Boost Users :

Subject: Re: [Boost-users] [Accumulators] How to define the initial value ?
From: Eric Niebler (eric_at_[hidden])
Date: 2010-10-08 15:23:18


On 10/8/2010 8:58 AM, Adrien Todeschini wrote:
> How can I define this tagged argument when initializing the
> accumulator_set ?
> ( Indeed, weighted_sum_impl constructor is called at this point )
>
> Thanks in advance for your help.

It should be as simple as using the "sample" keyword in the
boost::accumulators namespace, like:

using namespace boost::accumulators;
accumulator_set< int, features<tag::weighted_sum> > acc( sample = 42 )

HTH,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net