blib/lib/Statistics/CaseResampling.pm

filter: Statementstmt 72.5% 29 / 40 Branchbran 25.0% 2 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 54.5% 6 / 11 Podpod n/a totaltotal 62.7% 37 / 59 CC 5 SCAR 7.6
CC
5
Cov
65%
_fallback_seed
3.0
_fallback_seed
3.0
_new_default_rng
2.7
CRAP 2.1
↑ Summary _stats.c »
1 package Statistics::CaseResampling;
2 5 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 require Exporter;
7  
8 5 our $VERSION = '0.19';
9  
10 5 our @ISA = qw(Exporter);
11 5 our @EXPORT_OK = qw(
12 resample
13 resample_medians
14 resample_means
15 select_kth
16 quantile
17 median
18 median_absolute_deviation
19 first_quartile
20 third_quartile
21 mean
22 simple_confidence_limits_from_samples
23 median_simple_confidence_limits
24 basic_confidence_limits_from_samples
25 percentile_confidence_limits_from_samples
26 bca_confidence_limits_from_samples
27 median_percentile_confidence_limits
28 median_exact_confidence_limits
29 approx_erf
30 approx_erf_inv
31 nsigma_to_alpha
32 alpha_to_nsigma
33 sample_standard_deviation
34 population_standard_deviation
35 );
36 5 our @EXPORT = qw();
37 5 our %EXPORT_TAGS = ('all' => \@EXPORT_OK);
38  
39 5 require XSLoader;
40 5 XSLoader::load('Statistics::CaseResampling', $VERSION);
41  
42 5 our $Rnd;
43 5 my $_Seed_Counter = 0;
44  
45 4 ▶sub _fallback_seed {
Subroutine _fallback_seed: called CC=2 SCAR=10.9
46 0 ▶ my $tid = defined(&threads::tid) ? threads->tid() : 0;
Subroutine _fallback_seed: not called CC=2 SCAR=10.9
Branch: 2 branches
BranchTrueFalseTotal
defined &threads::tid ? : 0 4 4
defined &threads::tid ? : 0 0 0
47 return (
48 0 int(rand(4294967296)),
49 int(rand(4294967296)),
50 $$ & 0xffffffff,
51 time() & 0xffffffff,
52 $tid & 0xffffffff,
53 (++$_Seed_Counter) & 0xffffffff,
54 );
55 }
56  
57 8 ▶sub _new_default_rng {
Subroutine _new_default_rng: called CC=2 SCAR=10.0
58 0 ▶ local $!;
Subroutine _new_default_rng: not called CC=2 SCAR=10.0
59 0 my @seed = Statistics::CaseResampling::RdGen::_os_entropy(4);
60 0 ▶ @seed = _fallback_seed() if @seed != 4;
Branch: 2 branches
BranchTrueFalseTotal
if @seed != 4 0 8 8
if @seed != 4 0 0 0
61 0 my $rng = Statistics::CaseResampling::RdGen::setup_array(@seed);
62 0 $rng->_mark_auto_seeded($$);
63 0 return $rng;
64 }
65  
66 1 ▶sub _reseed_default_rng {
Subroutine _reseed_default_rng: called CC=1 SCAR=1.2
67 0 ▶ $Rnd = _new_default_rng();
Subroutine _reseed_default_rng: not called CC=1 SCAR=1.2
68 }
69  
70 5 $Rnd = _new_default_rng();
71  
72 0 ▶sub CLONE {
Subroutine CLONE: not called CC=1 SCAR=6.9
73 0 ▶ $Rnd = _new_default_rng();
Subroutine CLONE: not called CC=1 SCAR=6.9
74 }
75  
76 sub Statistics::CaseResampling::RdGen::CLONE_SKIP { 1 }
77  
78  
79 5 1;
80 __END__
↑ Summary _stats.c »