| 213 | } |
| 214 | |
| 215 | double stddev(const std::vector<double> &x) { |
| 216 | double m = mean(x); |
| 217 | double sum = 0; |
| 218 | for (const double &xi : x) { |
| 219 | sum += pow(xi - m, 2); |
| 220 | } |
| 221 | return sqrt(sum / static_cast<double>(x.size() - 1)); |
| 222 | } |
| 223 | |
| 224 | // windows.h library defines a function-like macro with the name of max() |
| 225 | #ifdef max |
no test coverage detected