summaryrefslogtreecommitdiff
path: root/boost/accumulators/statistics/weighted_median.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/statistics/weighted_median.hpp')
-rw-r--r--boost/accumulators/statistics/weighted_median.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/boost/accumulators/statistics/weighted_median.hpp b/boost/accumulators/statistics/weighted_median.hpp
index b8b94f9f9f..ed7cadb331 100644
--- a/boost/accumulators/statistics/weighted_median.hpp
+++ b/boost/accumulators/statistics/weighted_median.hpp
@@ -40,7 +40,7 @@ namespace impl
: 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) {}
@@ -65,7 +65,7 @@ namespace impl
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
@@ -73,7 +73,7 @@ namespace impl
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)
{
}
@@ -99,7 +99,7 @@ namespace impl
++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 );
}
@@ -127,7 +127,7 @@ namespace impl
: 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
@@ -156,7 +156,7 @@ namespace impl
{
++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 );
}