MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / standard_deviation

Function standard_deviation

extlibs/catch/include/catch/catch.hpp:7421–7428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7419 }
7420
7421 double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
7422 auto m = Catch::Benchmark::Detail::mean(first, last);
7423 double variance = std::accumulate(first, last, 0., [m](double a, double b) {
7424 double diff = b - m;
7425 return a + diff * diff;
7426 }) / (last - first);
7427 return std::sqrt(variance);
7428 }
7429
7430}
7431

Callers

nothing calls this directly

Calls 2

meanFunction · 0.85
accumulateClass · 0.85

Tested by

no test coverage detected