mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Fix some messy formatting in catch_stats
This commit is contained in:
parent
05d4ec62c8
commit
f206162b2d
@ -119,11 +119,15 @@ using Catch::Benchmark::Detail::sample;
|
||||
|
||||
double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
|
||||
auto m = Catch::Benchmark::Detail::mean(first, last);
|
||||
double variance = std::accumulate(first, last, 0., [m](double a, double b) {
|
||||
double variance = std::accumulate( first,
|
||||
last,
|
||||
0.,
|
||||
[m]( double a, double b ) {
|
||||
double diff = b - m;
|
||||
return a + diff * diff;
|
||||
}) / (last - first);
|
||||
return std::sqrt(variance);
|
||||
} ) /
|
||||
( last - first );
|
||||
return std::sqrt( variance );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -108,8 +108,9 @@ namespace Catch {
|
||||
double bias = normal_quantile(prob_n);
|
||||
double z1 = normal_quantile((1. - confidence_level) / 2.);
|
||||
|
||||
auto cumn = [n](double x) -> int {
|
||||
return std::lround(normal_cdf(x) * n); };
|
||||
auto cumn = [n]( double x ) -> int {
|
||||
return std::lround( normal_cdf( x ) * n );
|
||||
};
|
||||
auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
|
||||
double b1 = bias + z1;
|
||||
double b2 = bias - z1;
|
||||
|
Loading…
Reference in New Issue
Block a user