| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Statistics::R::REXP::Double; | 
| 2 |  |  |  |  |  |  | # ABSTRACT: an R numeric vector | 
| 3 |  |  |  |  |  |  | $Statistics::R::REXP::Double::VERSION = '1.0002'; | 
| 4 | 19 |  |  | 19 |  | 52581 | use 5.010; | 
|  | 19 |  |  |  |  | 62 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 19 |  |  | 19 |  | 91 | use Scalar::Util qw(looks_like_number); | 
|  | 19 |  |  |  |  | 31 |  | 
|  | 19 |  |  |  |  | 849 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 19 |  |  | 19 |  | 391 | use Class::Tiny::Antlers; | 
|  | 19 |  |  |  |  | 3177 |  | 
|  | 19 |  |  |  |  | 109 |  | 
| 9 | 19 |  |  | 19 |  | 2524 | use namespace::clean; | 
|  | 19 |  |  |  |  | 9354 |  | 
|  | 19 |  |  |  |  | 101 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | extends 'Statistics::R::REXP::Vector'; | 
| 12 | 19 |  |  | 19 |  | 4952 | use overload; | 
|  | 19 |  |  |  |  | 766 |  | 
|  | 19 |  |  |  |  | 91 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 | 19 |  |  | 19 |  | 778 | use constant sexptype => 'REALSXP'; | 
|  | 19 |  |  |  |  | 34 |  | 
|  | 19 |  |  |  |  | 4065 |  | 
| 16 |  |  |  |  |  |  |  | 
| 17 | 19 |  |  | 19 |  | 50 | sub _type { 'double'; } | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | sub BUILDARGS { | 
| 21 | 1671 |  |  | 1671 | 0 | 104772 | my $class = shift; | 
| 22 | 1671 |  |  |  |  | 7365 | my $attributes = $class->SUPER::BUILDARGS(@_); | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 1670 | 100 |  |  |  | 6037 | if (ref($attributes->{elements}) eq 'ARRAY') { | 
| 25 |  |  |  |  |  |  | $attributes->{elements} = [ | 
| 26 | 7083 | 100 |  |  |  | 18821 | map { looks_like_number($_) ? $_ : undef } | 
| 27 | 1656 |  |  |  |  | 3090 | Statistics::R::REXP::Vector::_flatten(@{$attributes->{elements}}) | 
|  | 1656 |  |  |  |  | 6133 |  | 
| 28 |  |  |  |  |  |  | ] | 
| 29 |  |  |  |  |  |  | } | 
| 30 |  |  |  |  |  |  | $attributes | 
| 31 | 1670 |  |  |  |  | 4333 | } | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | sub BUILD { | 
| 35 | 1667 |  |  | 1667 | 0 | 45905 | my ($self, $args) = @_; | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | # Required attribute type | 
| 38 |  |  |  |  |  |  | die "Elements of the 'elements' attribute must be numbers or undef" if defined($self->elements) && | 
| 39 | 1667 | 100 | 33 |  |  | 26010 | grep { defined($_) && !looks_like_number($_) } @{$self->elements} | 
|  | 7083 | 50 |  |  |  | 33134 |  | 
|  | 1667 |  |  |  |  | 31669 |  | 
| 40 |  |  |  |  |  |  | } | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | 1; # End of Statistics::R::REXP::Double | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | __END__ |