File indexing completed on 2025-10-28 08:38:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef CATCH_STATS_HPP_INCLUDED
0011 #define CATCH_STATS_HPP_INCLUDED
0012
0013 #include <catch2/benchmark/catch_estimate.hpp>
0014 #include <catch2/benchmark/catch_outlier_classification.hpp>
0015
0016 #include <vector>
0017
0018 namespace Catch {
0019 namespace Benchmark {
0020 namespace Detail {
0021 using sample = std::vector<double>;
0022
0023 double weighted_average_quantile( int k,
0024 int q,
0025 double* first,
0026 double* last );
0027
0028 OutlierClassification
0029 classify_outliers( double const* first, double const* last );
0030
0031 double mean( double const* first, double const* last );
0032
0033 double normal_cdf( double x );
0034
0035 double erfc_inv(double x);
0036
0037 double normal_quantile(double p);
0038
0039 Estimate<double>
0040 bootstrap( double confidence_level,
0041 double* first,
0042 double* last,
0043 sample const& resample,
0044 double ( *estimator )( double const*, double const* ) );
0045
0046 struct bootstrap_analysis {
0047 Estimate<double> mean;
0048 Estimate<double> standard_deviation;
0049 double outlier_variance;
0050 };
0051
0052 bootstrap_analysis analyse_samples(double confidence_level,
0053 unsigned int n_resamples,
0054 double* first,
0055 double* last);
0056 }
0057 }
0058 }
0059
0060 #endif