Ticket #7409: mean-test-trac.cpp
| File mean-test-trac.cpp, 475 bytes (added by , 10 years ago) |
|---|
| Line | |
|---|---|
| 1 | #include <iostream> |
| 2 | #include <boost/mpl/print.hpp> |
| 3 | #include <boost/accumulators/accumulators.hpp> |
| 4 | #include <boost/accumulators/statistics.hpp> |
| 5 | |
| 6 | using namespace boost::accumulators; |
| 7 | |
| 8 | int main() |
| 9 | { |
| 10 | accumulator_set<float, stats<tag::immediate_mean, tag::alt_count> > acc; |
| 11 | |
| 12 | for (uint i = 1; i < 3 ; i++) |
| 13 | { |
| 14 | std::cout << "inserting " << i << " into acc" << std::endl; |
| 15 | acc((float)i); |
| 16 | std::cout << "mean(acc) = " << mean(acc) << std::endl; |
| 17 | } |
| 18 | } |
