John Maddock wrote:
I have some simple stuff in the sandbox under the "stat" directory. You can view its usage here:
Otto: first off we really need something like this, in Boost and in the std as well IMO. It really galls me that my desktop calculator has more math functions than <cmath> has, and wait for it: my calculator is 25 years old !!!!!!!!
However, I'm not sure that either of us has the right interface yet: I'm particularly concerned that you're making these algorithms, it means that if you want to access more than one statistic you have to make multiple passes over the data. The advantage of the "make it an object" approach is that pretty much all stats you could want are accessible after a single pass over the data. More than that you can:
* Pause at any time and read off the stats, and then continue adding more data if you want.
I have been working on a statistical library based on an incremental
calculation model. The syntax is like this:
// define an accumulator set for calculating mean and max
// of a sequence of doubles
accumulator_set