8#ifndef COMMON_STATISTICS_HPP_
9#define COMMON_STATISTICS_HPP_
23 for (
size_t i = 0 ; i < measures.
size() ; i++)
24 mean += measures.get(i);
25 mean /= measures.
size();
28 for (
size_t i = 0 ; i < measures.
size() ; i++)
29 dev += (measures.get(i) - mean)*(measures.get(i) - mean);
31 dev = sqrt(dev / (measures.
size() - 1));
42static inline void standard_deviation(std::vector<double> measures,
double & mean,
double & dev)
45 for (
size_t i = 0 ; i < measures.size() ; i++)
50 mean /= measures.size();
53 for (
size_t i = 0 ; i < measures.size() ; i++)
54 dev += (measures[i] - mean)*(measures[i] - mean);
56 dev = sqrt(dev / (measures.size() - 1));
Implementation of 1-D std::vector like structure.