line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Statistics::R::REXP::Logical; |
2
|
|
|
|
|
|
|
# ABSTRACT: an R logical vector |
3
|
|
|
|
|
|
|
$Statistics::R::REXP::Logical::VERSION = '1.0001'; |
4
|
14
|
|
|
14
|
|
16170
|
use 5.010; |
|
14
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
510
|
use Class::Tiny::Antlers; |
|
14
|
|
|
|
|
4198
|
|
|
14
|
|
|
|
|
82
|
|
7
|
14
|
|
|
14
|
|
1497
|
use namespace::clean; |
|
14
|
|
|
|
|
9843
|
|
|
14
|
|
|
|
|
57
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'Statistics::R::REXP::Vector'; |
10
|
14
|
|
|
14
|
|
2441
|
use overload; |
|
14
|
|
|
|
|
725
|
|
|
14
|
|
|
|
|
69
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
14
|
|
|
14
|
|
468
|
use constant sexptype => 'LGLSXP'; |
|
14
|
|
|
|
|
12
|
|
|
14
|
|
|
|
|
2587
|
|
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
9
|
sub _type { 'logical'; } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub BUILDARGS { |
19
|
270
|
|
|
270
|
0
|
84290
|
my $class = shift; |
20
|
270
|
|
|
|
|
687
|
my $attributes = $class->SUPER::BUILDARGS(@_); |
21
|
|
|
|
|
|
|
|
22
|
269
|
100
|
|
|
|
605
|
if (ref($attributes->{elements}) eq 'ARRAY') { |
23
|
|
|
|
|
|
|
$attributes->{elements} = [ |
24
|
480
|
100
|
|
|
|
1067
|
map { defined $_ ? ($_ ? 1 : 0) : undef } |
|
|
100
|
|
|
|
|
|
25
|
255
|
|
|
|
|
213
|
Statistics::R::REXP::Vector::_flatten(@{$attributes->{elements}}) |
|
255
|
|
|
|
|
612
|
|
26
|
|
|
|
|
|
|
] |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
$attributes |
29
|
269
|
|
|
|
|
439
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub BUILD { |
33
|
266
|
|
|
266
|
0
|
5894
|
my ($self, $args) = @_; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Required attribute type |
36
|
|
|
|
|
|
|
die "Elements of the 'elements' attribute must be 0, 1, or undef" if defined $self->elements && |
37
|
266
|
100
|
66
|
|
|
3662
|
grep { defined($_) && ($_ != 1 && $_ != 0) } @{$self->elements} |
|
480
|
50
|
33
|
|
|
2617
|
|
|
266
|
|
|
|
|
4377
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; # End of Statistics::R::REXP::Logical |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |