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,10 +119,14 @@ 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,
|
||||||
|
last,
|
||||||
|
0.,
|
||||||
|
[m]( double a, double b ) {
|
||||||
double diff = b - m;
|
double diff = b - m;
|
||||||
return a + diff * diff;
|
return a + diff * diff;
|
||||||
}) / (last - first);
|
} ) /
|
||||||
|
( last - first );
|
||||||
return std::sqrt( variance );
|
return std::sqrt( variance );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,8 @@ namespace Catch {
|
|||||||
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