Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-28 08:38:42

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 // Adapted from donated nonius code.
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         } // namespace Detail
0057     } // namespace Benchmark
0058 } // namespace Catch
0059 
0060 #endif // CATCH_STATS_HPP_INCLUDED