Boost logo

Boost Users :

Subject: Re: [Boost-users] [accumulators] Help with accumulator-based typedef
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-09-08 23:12:16


Perhaps I should preface this somewhat, I am pretty much a
Boost.Accumulators virgin. Vaguely aware of them, they are there.

Definitely a notice at wiring them up for practical use. Although it
seems compelling that I might be able to use them for this
application.

Thank ye...

On Sun, Sep 8, 2013 at 9:51 PM, Michael Powell <mwpowellhtx_at_[hidden]> wrote:
> Hello,
>
> I am trying to setup a "simple" weighted_mean accumulator for a struct
> I want to accumulate. It goes something like this. Let's call it a
> float for sake of example. It's actually a struct with mathematical
> comprehension: addable, subtractable, multipliable, dividable, and so
> on.
>
> typedef accumulator_set<float,
> stats<tag::rolling_mean>, features<tag::count,
> tag::weighted_mean> > my_float_accumulator_set;

Changing my tact a bit, would someone tell me what it means for
BOOST_ACCUMULATORS_DOXYGEN_INVOKED to be defined?

For instance, if I instead define my accumulator to look something like this:

typedef accumulator_set<dchem::drivers::accel::accelerometer_data_t,
        stats<tag::rolling_mean> > accelerometer_data_accumulator_set;

However, when I initialize its ctor, I would like to specify the
tag::rolling_window::window_size, but this appears to be enabled with
the DOXYGEN #ifdef?

I'm sure there's a reason why, but why not just have the declaration
there, no #ifdef?

> However, I am getting obscenely long errors complaining about
> AccumulatorSet, etc, etc. Can someone direct me to a (somewhat)
> complete example of a weighted_sum accumulator in action? Am I even on
> the right track type-defining my accumulator ahead of time?
>
> Regards,
>
> Michael Powell


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