Eric Niebler wrote:
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
> acc; // push some data into the accumulator acc(1.2); acc(2.3); acc(3.4);
// fetch some intermediate results std::cout << mean(acc) << std::endl;
/* push more data, etc. */
Some statistics may depend on the results of other statistics, in which case they are calculated automatically and in the correct order.
The set of statistical accumulators is extensible, of course.
I hope to have a version available online Real Soon Now.
I've now put what I have in the Boost File Vault. You can find it under the name stats.tar.gz at the following location: http://www.boost-consulting.com/vault/index.php?directory=Math%20-%20Numerics& No docs, yet -- working on that right now. But the tests might give some inkling of how to use it. Feedback welcome. -- Eric Niebler Boost Consulting www.boost-consulting.com