line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Statistics::Basic::StdDev; |
3
|
|
|
|
|
|
|
|
4
|
33
|
|
|
33
|
|
148
|
use strict; |
|
33
|
|
|
|
|
83
|
|
|
33
|
|
|
|
|
1399
|
|
5
|
33
|
|
|
33
|
|
166
|
use warnings; |
|
33
|
|
|
|
|
45
|
|
|
33
|
|
|
|
|
836
|
|
6
|
33
|
|
|
33
|
|
173
|
use Carp; |
|
33
|
|
|
|
|
49
|
|
|
33
|
|
|
|
|
2060
|
|
7
|
|
|
|
|
|
|
|
8
|
33
|
|
|
33
|
|
234
|
use base 'Statistics::Basic::_OneVectorBase'; |
|
33
|
|
|
|
|
56
|
|
|
33
|
|
|
|
|
11402
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
36
|
|
|
36
|
1
|
1977
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
36
|
50
|
|
|
|
101
|
warn "[new $class]\n" if $Statistics::Basic::DEBUG >= 2; |
14
|
|
|
|
|
|
|
|
15
|
36
|
|
|
|
|
104
|
my $this = bless {}, $class; |
16
|
36
|
50
|
|
|
|
47
|
my $variance = $this->{V} = eval { Statistics::Basic::Variance->new(@_) } or croak $@; |
|
36
|
|
|
|
|
290
|
|
17
|
36
|
|
|
|
|
162
|
my $vector = $this->{v} = $variance->query_vector; |
18
|
36
|
50
|
|
|
|
89
|
my $c = $vector->_get_computer( 'stddev' ); return $c if defined $c; |
|
36
|
|
|
|
|
86
|
|
19
|
|
|
|
|
|
|
|
20
|
36
|
|
|
|
|
96
|
$vector->_set_computer( stddev => $this ); |
21
|
|
|
|
|
|
|
|
22
|
36
|
|
|
|
|
564
|
return $this; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _recalc { |
26
|
53
|
|
|
53
|
|
66
|
my $this = shift; |
27
|
53
|
|
|
|
|
71
|
my $first = shift; |
28
|
|
|
|
|
|
|
|
29
|
53
|
|
|
|
|
101
|
delete $this->{recalc_needed}; |
30
|
|
|
|
|
|
|
|
31
|
53
|
|
|
|
|
220
|
my $var = $this->{V}->query; |
32
|
53
|
50
|
|
|
|
114
|
return unless defined $var; |
33
|
|
|
|
|
|
|
# no need to query filled here, variance does it for us |
34
|
|
|
|
|
|
|
|
35
|
53
|
50
|
|
|
|
120
|
warn "[recalc " . ref($this) . "] sqrt( $var )\n" if $Statistics::Basic::DEBUG; |
36
|
|
|
|
|
|
|
|
37
|
53
|
|
|
|
|
130
|
$this->{_value} = sqrt( $var ); |
38
|
|
|
|
|
|
|
|
39
|
53
|
|
|
|
|
7053
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub query_mean { |
43
|
1
|
|
|
1
|
1
|
5
|
my $this = shift; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
5
|
return $this->{V}->query_mean; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |