line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Statistics::Basic::_OneVectorBase; |
2
|
|
|
|
|
|
|
|
3
|
33
|
|
|
33
|
|
1282
|
use strict; |
|
33
|
|
|
|
|
49
|
|
|
33
|
|
|
|
|
1170
|
|
4
|
33
|
|
|
33
|
|
145
|
use warnings; |
|
33
|
|
|
|
|
41
|
|
|
33
|
|
|
|
|
764
|
|
5
|
33
|
|
|
33
|
|
148
|
use Carp; |
|
33
|
|
|
|
|
45
|
|
|
33
|
|
|
|
|
1739
|
|
6
|
|
|
|
|
|
|
|
7
|
33
|
|
|
33
|
|
478
|
use Statistics::Basic; # make sure all the basic classes are loaded |
|
33
|
|
|
|
|
57
|
|
|
33
|
|
|
|
|
302
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use overload |
10
|
84
|
50
|
|
84
|
|
3678
|
'""' => sub { defined( my $v = $_[0]->query ) or return "n/a"; $Statistics::Basic::fmt->format_number("$v", $Statistics::Basic::IPRES) }, |
|
84
|
|
|
|
|
663
|
|
11
|
68
|
|
|
68
|
|
147
|
'0+' => sub { $_[0]->query }, |
12
|
0
|
|
|
0
|
|
0
|
( defined($Statistics::Basic::TOLER) ? ('==' => sub { abs($_[0]-$_[1])<=$Statistics::Basic::TOLER }) : () ), |
13
|
34
|
|
|
34
|
|
2559
|
'eq' => sub { "$_[0]" eq "$_[1]" }, |
14
|
400
|
|
|
400
|
|
865
|
'bool' => sub { 1 }, |
15
|
33
|
100
|
|
33
|
|
313
|
fallback => 1; # tries to do what it would have done if this wasn't present. |
|
33
|
|
|
|
|
53
|
|
|
33
|
|
|
|
|
677
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# _recalc_needed {{{ |
18
|
|
|
|
|
|
|
sub _recalc_needed { |
19
|
335
|
|
|
335
|
|
352
|
my $this = shift; |
20
|
335
|
|
|
|
|
462
|
$this->{recalc_needed} = 1; |
21
|
|
|
|
|
|
|
|
22
|
335
|
100
|
|
|
|
564
|
warn "[recalc_needed " . ref($this) . "]\n" if $Statistics::Basic::DEBUG; |
23
|
|
|
|
|
|
|
|
24
|
335
|
|
|
|
|
1191
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
# }}} |
27
|
|
|
|
|
|
|
# query {{{ |
28
|
|
|
|
|
|
|
sub query { |
29
|
402
|
|
|
402
|
1
|
1090
|
my $this = shift; |
30
|
|
|
|
|
|
|
|
31
|
402
|
100
|
|
|
|
1168
|
$this->_recalc if $this->{recalc_needed}; |
32
|
|
|
|
|
|
|
|
33
|
402
|
50
|
|
|
|
634
|
warn "[query " . ref($this) . " $this->{_value}]\n" if $Statistics::Basic::DEBUG; |
34
|
|
|
|
|
|
|
|
35
|
402
|
|
|
|
|
964
|
return $this->{_value}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
# }}} |
38
|
|
|
|
|
|
|
# query_vector {{{ |
39
|
|
|
|
|
|
|
sub query_vector { |
40
|
43
|
|
|
43
|
1
|
219
|
my $this = shift; |
41
|
|
|
|
|
|
|
|
42
|
43
|
|
|
|
|
119
|
return $this->{v}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
# }}} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# query_size {{{ |
47
|
|
|
|
|
|
|
sub query_size { |
48
|
4
|
|
|
4
|
1
|
16
|
my $this = shift; |
49
|
|
|
|
|
|
|
|
50
|
4
|
|
|
|
|
17
|
return $this->{v}->query_size; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# maybe deprecate this later |
54
|
|
|
|
|
|
|
*size = \&query_size unless $ENV{TEST_AUTHOR}; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# }}} |
57
|
|
|
|
|
|
|
# set_size {{{ |
58
|
|
|
|
|
|
|
sub set_size { |
59
|
5
|
|
|
5
|
1
|
12
|
my $this = shift; |
60
|
5
|
|
|
|
|
9
|
my $size = shift; |
61
|
5
|
|
|
|
|
8
|
my $nofl = shift; |
62
|
|
|
|
|
|
|
|
63
|
5
|
50
|
|
|
|
10
|
eval { $this->{v}->set_size($size, $nofl) } or croak $@; |
|
5
|
|
|
|
|
28
|
|
64
|
|
|
|
|
|
|
|
65
|
5
|
|
|
|
|
12
|
return $this; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
# }}} |
68
|
|
|
|
|
|
|
# set_vector {{{ |
69
|
|
|
|
|
|
|
sub set_vector { |
70
|
10
|
|
|
10
|
1
|
44
|
my $this = shift; |
71
|
|
|
|
|
|
|
|
72
|
10
|
50
|
|
|
|
32
|
warn "[set_vector " . ref($this) . "]\n" if $Statistics::Basic::DEBUG; |
73
|
|
|
|
|
|
|
|
74
|
10
|
|
|
|
|
37
|
$this->{v}->set_vector(@_); |
75
|
|
|
|
|
|
|
|
76
|
10
|
|
|
|
|
13
|
return $this; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
# }}} |
79
|
|
|
|
|
|
|
# insert {{{ |
80
|
|
|
|
|
|
|
sub insert { |
81
|
10
|
|
|
10
|
1
|
20
|
my $this = shift; |
82
|
|
|
|
|
|
|
|
83
|
10
|
50
|
|
|
|
43
|
warn "[insert " . ref($this) . "]\n" if $Statistics::Basic::DEBUG; |
84
|
|
|
|
|
|
|
|
85
|
10
|
|
|
|
|
66
|
$this->{v}->insert(@_); |
86
|
|
|
|
|
|
|
|
87
|
10
|
|
|
|
|
18
|
return $this; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
# }}} |
90
|
|
|
|
|
|
|
# ginsert {{{ |
91
|
|
|
|
|
|
|
sub ginsert { |
92
|
7
|
|
|
7
|
1
|
18
|
my $this = shift; |
93
|
|
|
|
|
|
|
|
94
|
7
|
50
|
|
|
|
25
|
warn "[ginsert " . ref($this) . "]\n" if $Statistics::Basic::DEBUG; |
95
|
|
|
|
|
|
|
|
96
|
7
|
|
|
|
|
40
|
$this->{v}->ginsert(@_); |
97
|
|
|
|
|
|
|
|
98
|
7
|
|
|
|
|
11
|
return $this; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
*append = \&ginsert; |
102
|
|
|
|
|
|
|
# }}} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |