1 #ifndef _theplu_yat_statistics_averagerweighted_
2 #define _theplu_yat_statistics_averagerweighted_
28 #include "yat/utility/iterator_traits.h"
30 #include <boost/concept_check.hpp>
82 void add(
const double d,
const double w=1);
89 double mean(
void)
const;
102 double n(
void)
const;
122 double std(
void)
const;
142 double sum_w(
void)
const;
147 double sum_ww(
void)
const;
154 double sum_wx(
void)
const;
172 double variance(
const double m)
const;
196 double sum_wwx(
void)
const;
201 double sum_wwxx(
void)
const;
221 template <
typename InputIterator>
224 BOOST_CONCEPT_ASSERT((boost::InputIterator<InputIterator>));
226 for ( ; first != last; ++first)
241 template <
typename InputIterator1,
typename InputIterator2>
243 InputIterator2 first2)
245 BOOST_CONCEPT_ASSERT((boost::InputIterator<InputIterator1>));
246 BOOST_CONCEPT_ASSERT((boost::InputIterator<InputIterator2>));
249 for ( ; first1 != last1; ++first1, ++first2)
250 a.
add(*first1, *first2);