Hello!
I'm new to Accumulators.
I've tried to compile the "Hello, World!" example (found in the User
Guide) but it fails:
--- [error] ---
$ g++ -ansi -Wall -o accumulators_test1 accumulators_test1.cpp
/usr/include//boost/accumulators/statistics_fwd.hpp: In function ‘int main()’:
/usr/include//boost/accumulators/statistics_fwd.hpp:87: error:
‘template<int N> struct boost::accumulators::tag::moment’ is not a
function,
/usr/include//boost/accumulators/statistics/moment.hpp:104: error:
conflict with ‘template typename
boost::accumulators::detail::extractor_result::type
boost::accumulators::extract::moment(const Arg1&, const A0&, const
A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&,
const A8&, const A9&, const A10&, const A11&, const A12&, const A13&,
const A14&)’
accumulators_test1.cpp:22: error: in call to ‘moment’
--- [/error] ---
My system is: Fedora 12 x86_64 -- GCC 4.4.2 20091222 (Red Hat
4.4.2-20) -- Boost 1.39
(also tried with the latest Boost trunk)
Just for the sake of completeness, here below is the code stored in
the "accumulators_test1.cpp" file
--- [code] ---
#include <iostream>
#include
#include
#include
#include
using namespace boost::accumulators;
int main()
{
// Define an accumulator set for calculating the mean and the
// 2nd moment ...
accumulator_set > > acc;
// push in some data ...
acc(1.2);
acc(2.3);
acc(3.4);
acc(4.5);
// Display the results ...
std::cout << "Mean: " << mean(acc) << std::endl;
std::cout << "Moment: " << moment<2>(acc) << std::endl;
return 0;
}
--- [/code] ---
Where I am wrong?
Thank you very much for any help!!
Best,
-- Marco