22 #ifndef mia_core_meanvar_hh 23 #define mia_core_meanvar_hh 41 template <
typename ForwardIterator>
42 std::pair<double, double>
mean_var(ForwardIterator begin, ForwardIterator end)
44 std::pair<double, double> result;
49 while (begin != end) {
50 const double help = *begin;
52 result.second += help * help;
61 result.second = sqrt((result.second - n * result.first * result.first) / (n - 1));
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
std::pair< double, double > mean_var(ForwardIterator begin, ForwardIterator end)
#define NS_MIA_END
conveniance define to end the mia namespace