: accumulator_base
{
// for boost::result_of
- typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type;
+ typedef typename numeric::functional::fdiv<Sample, std::size_t>::result_type result_type;
weighted_median_impl(dont_care) {}
struct with_density_weighted_median_impl
: accumulator_base
{
- typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
+ typedef typename numeric::functional::fdiv<Sample, std::size_t>::result_type float_type;
typedef std::vector<std::pair<float_type, float_type> > histogram_type;
typedef iterator_range<typename histogram_type::iterator> range_type;
// for boost::result_of
template<typename Args>
with_density_weighted_median_impl(Args const &args)
- : sum(numeric::average(args[sample | Sample()], (std::size_t)1))
+ : sum(numeric::fdiv(args[sample | Sample()], (std::size_t)1))
, is_dirty(true)
{
}
++it;
}
--it;
- float_type over = numeric::average(this->sum - 0.5 * cnt, it->second * cnt);
+ float_type over = numeric::fdiv(this->sum - 0.5 * cnt, it->second * cnt);
this->median = it->first * over + (it + 1)->first * ( 1. - over );
}
: accumulator_base
{
typedef typename numeric::functional::multiplies<Sample, Weight>::result_type weighted_sample;
- typedef typename numeric::functional::average<weighted_sample, std::size_t>::result_type float_type;
+ typedef typename numeric::functional::fdiv<weighted_sample, std::size_t>::result_type float_type;
typedef std::vector<std::pair<float_type, float_type> > histogram_type;
typedef iterator_range<typename histogram_type::iterator> range_type;
// for boost::result_of
{
++it;
}
- float_type over = numeric::average(it->second - 0.5, it->second - (it - 1)->second);
+ float_type over = numeric::fdiv(it->second - 0.5, it->second - (it - 1)->second);
this->median = it->first * over + (it + 1)->first * ( 1. - over );
}