Boost logo

Boost Users :

Subject: Re: [Boost-users] [accumulators] density: empty values
From: Robert Kubrick (robertkubrick_at_[hidden])
Date: 2009-05-15 14:31:25


Eric Niebler <eric <at> boostpro.com> writes:

>
> Eric Niebler wrote:
> > Robert Kubrick wrote:
> >> I have the following program:
> >>
> > <snip>
> >>
> >> Bin values and indexes don't seem to be initialized:
> >>
> >> $ acc_dist Bin lower bound: 0, Value: 0
> >> Bin lower bound: 0, Value: 0
> >> Bin lower bound: 0, Value: 0
> >> Bin lower bound: 0, Value: 0
> >> Bin lower bound: 0, Value: 0
> >> Bin lower bound: 0, Value: 0
> >
> > I'm afraid I don't have time to investigate this right now. Please file
> > a bug at https://svn.boost.org/trac/boost/ and be sure to state what you
> > think the expected results should be. Thanks.
>
> Addendum: if the number of samples is at least as great as the cache
> size, then it seems to work. I didn't actually write the density
> accumulator, so I'll need to check with the author to see if that's a
> precondition, or if there's some way we can return meaningful results
> with fewer samples. Matthias?
>
> Still, a bug report would be good.
>

I changed the number of samples to 10, matching the original cache_size
parameter. It works better:

Bin lower bound: -0.445, Value: 0
Bin lower bound: 0.1, Value: 0.1
Bin lower bound: 0.645, Value: 0
Bin lower bound: 1.19, Value: 0.1
Bin lower bound: 1.735, Value: 0
Bin lower bound: 2.28, Value: 0.1
Bin lower bound: 2.825, Value: 0
Bin lower bound: 3.37, Value: 0.1
Bin lower bound: 3.915, Value: 0
Bin lower bound: 4.46, Value: 0.1
Bin lower bound: 5.005, Value: 0.3
Bin lower bound: 5.55, Value: 0
Bin lower bound: 6.095, Value: 0
Bin lower bound: 6.64, Value: 0
Bin lower bound: 7.185, Value: 0
Bin lower bound: 7.73, Value: 0
Bin lower bound: 8.275, Value: 0
Bin lower bound: 8.82, Value: 0
Bin lower bound: 9.365, Value: 0
Bin lower bound: 9.91, Value: 0.1
Bin lower bound: 10.455, Value: 0
Bin lower bound: 11, Value: 0.1

A couple of questions:

1) I have a real-time application that keeps track of some statistics
based on the events received so the values can not be
pre-determined. Statistics are reset by the application at regular
time intervals. What happens if I leave the cache_size parameter to
1 and then keep adding samples? Is there a serious performance
penalty?

2) Is there a way to reset the acc object in the example? Or do I
have to deallocate the object and instantiate a new one to
generate a new sampling?


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