line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Statistics::Basic::StdDev; |
3
|
|
|
|
|
|
|
|
4
|
33
|
|
|
33
|
|
211
|
use strict; |
|
33
|
|
|
|
|
46
|
|
|
33
|
|
|
|
|
1316
|
|
5
|
33
|
|
|
33
|
|
154
|
use warnings; |
|
33
|
|
|
|
|
38
|
|
|
33
|
|
|
|
|
761
|
|
6
|
33
|
|
|
33
|
|
281
|
use Carp; |
|
33
|
|
|
|
|
52
|
|
|
33
|
|
|
|
|
1986
|
|
7
|
|
|
|
|
|
|
|
8
|
33
|
|
|
33
|
|
197
|
use base 'Statistics::Basic::_OneVectorBase'; |
|
33
|
|
|
|
|
292
|
|
|
33
|
|
|
|
|
10955
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
36
|
|
|
36
|
1
|
1939
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
36
|
50
|
|
|
|
158
|
warn "[new $class]\n" if $Statistics::Basic::DEBUG >= 2; |
14
|
|
|
|
|
|
|
|
15
|
36
|
|
|
|
|
101
|
my $this = bless {}, $class; |
16
|
36
|
50
|
|
|
|
50
|
my $variance = $this->{V} = eval { Statistics::Basic::Variance->new(@_) } or croak $@; |
|
36
|
|
|
|
|
279
|
|
17
|
36
|
|
|
|
|
156
|
my $vector = $this->{v} = $variance->query_vector; |
18
|
36
|
50
|
|
|
|
106
|
my $c = $vector->_get_computer( 'stddev' ); return $c if defined $c; |
|
36
|
|
|
|
|
85
|
|
19
|
|
|
|
|
|
|
|
20
|
36
|
|
|
|
|
89
|
$vector->_set_computer( stddev => $this ); |
21
|
|
|
|
|
|
|
|
22
|
36
|
|
|
|
|
576
|
return $this; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _recalc { |
26
|
53
|
|
|
53
|
|
65
|
my $this = shift; |
27
|
53
|
|
|
|
|
55
|
my $first = shift; |
28
|
|
|
|
|
|
|
|
29
|
53
|
|
|
|
|
88
|
delete $this->{recalc_needed}; |
30
|
|
|
|
|
|
|
|
31
|
53
|
|
|
|
|
182
|
my $var = $this->{V}->query; |
32
|
53
|
50
|
|
|
|
121
|
return unless defined $var; |
33
|
|
|
|
|
|
|
# no need to query filled here, variance does it for us |
34
|
|
|
|
|
|
|
|
35
|
53
|
50
|
|
|
|
102
|
warn "[recalc " . ref($this) . "] sqrt( $var )\n" if $Statistics::Basic::DEBUG; |
36
|
|
|
|
|
|
|
|
37
|
53
|
|
|
|
|
126
|
$this->{_value} = sqrt( $var ); |
38
|
|
|
|
|
|
|
|
39
|
53
|
|
|
|
|
5992
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub query_mean { |
43
|
1
|
|
|
1
|
1
|
7
|
my $this = shift; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
7
|
return $this->{V}->query_mean; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |