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