[accumulator] compiler error with quantil

Hello, I try to create a complex accumulator. I would like to use an accumulator for a box plot with the whisker data ( http://en.wikipedia.org/wiki/Box_plot ). My typedef shows at the momen like this: typedef boost::accumulators::accumulator_set<double, boost::accumulators::stats< boost::accumulators::tag::count, boost::accumulators::tag::sum, //boost::accumulators::tag::median, boost::accumulators::tag::mean, boost::accumulators::tag::variance, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::extended_p_square
Accumulator;
I would like to create the 25% & 75% quantil and replace the median with the 50% quantil, so I have defined the ctor accumulator call like this: boost::array<double, 3> probs = {0.25, 0.5, 0.75}; m_times[p_name] = Accumulator( boost::accumulators::extended_p_square_probabilities = probs ); (the median is disabled and m_times is a std::map<std::string, Accumulator>). At this point I get a compiler errors: /Developer/opt/Boost/1.53.0/include/boost/accumulators/statistics/extended_p_square.hpp: In constructor 'boost::accumulators::impl::extended_p_square_impl<Sample>::extended_p_square_impl(const Args&) [with Args = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::count, boost::accumulators::tag::sum, boost::accumulators::tag::mean, boost::accumulators::tag::variance, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::extended_p_square, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, void> >, boost::parameter::aux::empty_arg_list>, Sample = double]': /Developer/opt/Boost/1.53.0/include/boost/accumulators/framework/depends_on.hpp:319: instantiated from 'boost::accumulators::detail::accumulator_wrapper<Accumulator, Feature>::accumulator_wrapper(const Args&) [with Args = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::count, boost::accumulators::tag::sum, boost::accumulators::tag::mean, boost::accumulators::tag::variance, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::extended_p_square, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, void> >, boost::parameter::aux::empty_arg_list>, Accumulator = boost::accumulators::impl::extended_p_square_impl<double>, Feature = boost::accumulators::tag::extended_p_square]' .... I need one accumulator for all the data. I'm using Boost 1.53. How can I create working code? Thanks for help Phil

On 2013-06-11 15:09:40 +0200, Philipp Kraus said:
This short example #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics/sum.hpp> #include <boost/accumulators/statistics/min.hpp> #include <boost/accumulators/statistics/max.hpp> #include <boost/accumulators/statistics/mean.hpp> #include <boost/accumulators/statistics/stats.hpp> #include <boost/accumulators/statistics/count.hpp> #include <boost/accumulators/statistics/median.hpp> #include <boost/accumulators/statistics/variance.hpp> #include <boost/accumulators/statistics/extended_p_square.hpp> #include <boost/array.hpp> using namespace boost::accumulators; typedef accumulator_set<double, stats< tag::count, tag::sum, tag::mean, tag::extended_p_square_quantile //*
accumulator_t;
int main() { boost::array<double,3> probs = {0.25, 0.50, 0.75}; accumulator_t acc(extended_p_square_probabilities = probs); } compiles only, if I comment the //* line, but with the quantil tag the compiler creates this errors: /Developer/opt/Boost/1.53.0/include/boost/accumulators/framework/depends_on.hpp: In instantiation of 'boost::accumulators::detail::insert_dependencies<boost::mpl::m_item<boost::accumulators::tag::extended_p_square_quantile, boost::accumulators::tag::extended_p_square_quantile, boost::mpl::m_item<boost::accumulators::tag::mean, boost::accumulators::tag::mean, boost::mpl::m_item<boost::accumulators::tag::sum, boost::accumulators::tag::sum, boost::mpl::m_item<boost::accumulators::tag::count, boost::accumulators::tag::count, boost::mpl::map0<mpl_::na> > > > >, boost::accumulators::tag::extended_p_square_quantile, void>': /Developer/opt/Boost/1.53.0/include/boost/mpl/aux_/has_type.hpp:20: instantiated from 'const bool boost::mpl::aux::has_type<boost::accumulators::detail::insert_dependencies<boost::mpl::m_item<boost::accumulators::tag::extended_p_square_quantile, boost::accumulators::tag::extended_p_square_quantile, boost::mpl::m_item<boost::accumulators::tag::mean, boost::accumulators::tag::mean, boost::mpl::m_item<boost::accumulators::tag::sum, boost::accumulators::tag::sum, boost::mpl::m_item<boost::accumulators::tag::count, boost::accumulators::tag::count, boost::mpl::map0<mpl_::na> > > > >, boost::accumulators::tag::extended_p_square_quantile, void>, mpl_::bool_<true> >::value' /Developer/opt/Boost/1.53.0/include/boost/mpl/aux_/has_type.hpp:20: instantiated from 'boost::mpl::aux::has_type<boost::accumulators::detail::insert_dependencies<boost::mpl::m_item<boost::accumulators::tag::extended_p_square_quantile, boost::accumulators::tag::extended_p_square_quantile, boost::mpl::m_item<boost::accumulators::tag::mean, boost::accumulators::tag::mean, boost::mpl::m_item<boost::accumulators::tag::sum, boost::accumulators::tag::sum, boost::mpl::m_item<boost::accumulators::tag::count, boost::accumulators::tag::count, boost::mpl::map0<mpl_::na> > > > >, boost::accumulators::tag::extended_p_square_quantile, void>, mpl_::bool_<true> >' ..... Can anybody help me? Thanks Phil

On 6/13/2013 3:56 AM, Philipp Kraus wrote:
whoops, should be: #include <boost/accumulators/statistics/extended_p_square_quantile.hpp>
<snip> The errors went away for me when I included the correct header. You might check the docs for the statistics you're using. The docs aren't great, but they at least tell you what headers to include. http://www.boost.org/doc/libs/1_53_0/doc/html/accumulators/user_s_guide.html... -- Eric Niebler Boost.org http://www.boost.org

On 2013-06-14 01:02:35 +0200, Eric Niebler said:
I can solve the problem :-P I have include these headers: #include <boost/array.hpp> #include <boost/accumulators/statistics.hpp> #include <boost/accumulators/accumulators.hpp> But my variable m_times is a std::map<std::string, accumulator> and I can not push the accumulator with m_times[<some string>] = Accumulator(...) I need the insert method of the map with a std::pair and for accessing the element does not work the m_times[<some string>](<a value>), I need the iterator of the map element and push the value to the accumulator with it->second(<a value>) Phil
participants (2)
-
Eric Niebler
-
Philipp Kraus