mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +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) {
|
double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
|
||||||
auto m = Catch::Benchmark::Detail::mean(first, 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,
|
||||||
double diff = b - m;
|
last,
|
||||||
return a + diff * diff;
|
0.,
|
||||||
}) / (last - first);
|
[m]( double a, double b ) {
|
||||||
return std::sqrt(variance);
|
double diff = b - m;
|
||||||
|
return a + diff * diff;
|
||||||
|
} ) /
|
||||||
|
( last - first );
|
||||||
|
return std::sqrt( variance );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,9 @@ namespace Catch {
|
|||||||
double bias = normal_quantile(prob_n);
|
double bias = normal_quantile(prob_n);
|
||||||
double z1 = normal_quantile((1. - confidence_level) / 2.);
|
double z1 = normal_quantile((1. - confidence_level) / 2.);
|
||||||
|
|
||||||
auto cumn = [n](double x) -> int {
|
auto cumn = [n]( double x ) -> int {
|
||||||
return std::lround(normal_cdf(x) * n); };
|
return std::lround( normal_cdf( x ) * n );
|
||||||
|
};
|
||||||
auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
|
auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
|
||||||
double b1 = bias + z1;
|
double b1 = bias + z1;
|
||||||
double b2 = bias - z1;
|
double b2 = bias - z1;
|
||||||
|
Loading…
Reference in New Issue
Block a user