MCPcopy Create free account
hub / github.com/Profactor/cv-plot / standard_deviation

Function standard_deviation

CvPlot/ext/catch2/inc/catch.hpp:7644–7651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7642 }
7643
7644 double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
7645 auto m = Catch::Benchmark::Detail::mean(first, last);
7646 double variance = std::accumulate(first, last, 0., [m](double a, double b) {
7647 double diff = b - m;
7648 return a + diff * diff;
7649 }) / (last - first);
7650 return std::sqrt(variance);
7651 }
7652
7653}
7654

Callers

nothing calls this directly

Calls 1

meanFunction · 0.85

Tested by

no test coverage detected