1 #ifndef _theplu_yat_statistics_averager_ 2 #define _theplu_yat_statistics_averager_ 28 #include "averager_base.h" 30 #include "yat/utility/iterator_traits.h" 32 #include <boost/concept_check.hpp> 33 #include <boost/iterator/iterator_concepts.hpp> 76 template<
class Derived>
81 void add_impl(
double,
long int);
82 void rescale_impl(
double);
96 template <
typename InputIterator>
97 void add(
Averager& a, InputIterator first, InputIterator last)
99 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<InputIterator>));
100 BOOST_CONCEPT_ASSERT((boost_concepts::SinglePassIterator<InputIterator>));
101 typedef typename boost::iterator_value<InputIterator>::type T;
102 BOOST_CONCEPT_ASSERT((boost::Convertible<T, double>));
104 for ( ; first != last; ++first)
109 template<
class Derived>
Class to calculate simple (first and second moments) averages.
Definition: Averager.h:46
The Department of Theoretical Physics namespace as we define it.
const Averager & operator=(const Averager &)
The assignment operator.
Base class for averager classes.
Definition: averager_base.h:69
double sum_xx_centered(void) const
Definition: averager_base.h:225
void add2(double mean, double cm2, long int n)
Definition: averager_base.h:469
void add(Averager &a, InputIterator first, InputIterator last)
adding a range of values to Averager a
Definition: Averager.h:97
const Averager & operator+=(const averager_base2< Derived > &other)
plus assignment operator
Definition: Averager.h:110
long n(void) const
number of data points
Definition: averager_base.h:105
Base class for averagers calculating mean and variance.
Definition: averager_base.h:170
void check_iterator_is_unweighted(Iter iter)
check (at compile time) that iterator is unweighted.
Definition: iterator_traits.h:200
double mean(void) const
mean
Definition: averager_base.h:97