Branch Coverage

blib/lib/PDL/Dims.pm
Criterion Covered Total %
branch 144 324 44.4


line true false branch
40 0 0 if ((my $n = $p) =~ s/^dim//u)
48 0 0 unless $d eq 'channel'
52 0 0 if $d eq ('???', '???', '???', 't')
53 0 0 if ($d eq 'channel')
59 0 0 if ($d eq 'channel' and dimsize($self, $d) == 1)
63 0 0 unless (dimsize($self, $d))
68 0 0 if (spacing($self, $d) and $d ne 't')
71 0 0 if ($d eq 't')
84 0 4 unless $p
90 0 7 unless ref $self->hdr->{$i} eq 'HASH'
101 0 73 if not $d and wantarray
102 0 73 unless $d
103 0 73 unless ref $self->hdr->{$d} eq 'HASH'
106 44 29 if (defined $v)
110 49 24 if ($self->hdr->{$d}{'num'})
122 0 134 if not $d and wantarray
123 0 134 unless $d
124 0 134 unless ref $self->hdr->{$d} eq 'HASH'
125 65 69 if (defined $v)
143 0 2 unless $self->isa('PDL')
144 0 2 unless dimname($self)
145 0 2 unless $self->ndims == 1 + $#{dimname($self);}
148 10 0 unless chomp $n
150 0 0 unless $self->dim(didx($self, $n)) == dimsize($self, $n)
151 0 0 unless idx($self, $n) < dimsize($self, $n)
152 0 0 unless idx($self, $n) >= 0
154 0 0 if (spacing($self, $n)) { }
156 0 0 unless dinc($self, $n)
159 0 0 unless approx(dmax($self, $n)), dmin($self, $n) + dinc($self, $n) * (dimsize($self, $n) - 1)
165 0 0 unless approx(dmax($self, $n), i2pos($self, $n, pos2i($self, $n, dmax($self, $n))))
168 0 0 unless dimsize($self, $n) == $#{vals($self, $n);} + 1
176 0 0 unless dimsize($self, $n) - 1 == @{pos2i($self, $n, i2pos($self, $n, dimsize($self, $n) - 1));} - [-1]
186 0 127 if not $d and wantarray
190 1 126 unless $d
193 0 126 unless ref $self->hdr->{$d} eq 'HASH'
195 32 94 if (defined $v)
196 0 32 unless ref $self->hdr->{$d} eq 'HASH'
199 7 25 if idx($self, $d) >= $v - 1
208 0 52 unless $self->isa('PDL')
210 0 52 if not defined $d and wantarray
211 23 29 unless defined $d
213 25 4 if $n
221 0 49 if not $d and wantarray
222 0 49 unless $d
223 28 21 if (defined $v)
225 0 28 unless ref $self->hdr->{$d} eq 'HASH'
238 0 28 if not $d and wantarray
239 0 28 unless $d
241 0 28 if defined $v and ref $self->hdr->{$d} ne 'HASH'
242 28 0 if defined $v
250 0 42 if not $d and wantarray
251 0 42 unless $d
252 0 42 if defined $v and ref $self->hdr->{$d} ne 'HASH'
254 28 14 if defined $v
262 0 76 if not $d and wantarray
263 3 73 unless $d
264 0 73 if (ref $d eq 'ARRAY') { }
268 12 61 if ref $self->hdr->{$d} ne 'HASH'
269 0 61 unless ref $self->hdr->{$d} eq 'HASH'
270 25 36 if defined $n
283 0 125 unless $k ~~ \@keys
286 0 25 if (ref $self->hdr->{$d} eq 'HASH') { }
288 0 0 if (defined $n) { }
296 4 21 unless $self->hdr->{'ndims'}
301 15 10 if (not defined $p{'pos'} or $p{'pos'} > $self->hdr->{'ndims'})
304 0 25 if ($p{'pos'} < $self->hdr->{'ndims'})
315 6 19 unless $p{'size'}
317 0 25 unless $p{'size'} == $self->dim($p{'pos'})
319 12 13 unless defined spacing($self, $d)
324 4 21 if (ref $p{'vals'} eq 'ARRAY')
334 4 21 if (not spacing($self, $d)) { }
338 11 10 unless defined $p{'num'}
339 10 11 if ($p{'inc'} and $p{'max'}) { }
0 11 elsif ($p{'inc'}) { }
0 11 elsif ($p{'max'}) { }
342 0 10 unless approx(pdl($p{'max'} - $p{'min'}), pdl((dimsize($self, $d) - 1) * $p{'inc'}))
361 0 25 if ($p{'dummy'})
375 0 13 if (not exists $old->hdr->{$dim}) { }
377 0 0 if $err
383 0 0 if $err
394 0 3 unless defined $d
404 0 3 if defined $self->hdr->{$d}
413 0 0 unless defined $self->hdr
416 0 0 if not defined $index and wantarray
417 0 0 unless defined $index
419 0 0 unless ref $self->hdr->{$index} eq 'HASH'
420 0 0 if (defined(my $v = shift()))
429 0 78 unless defined $self->hdr
432 0 78 if not defined $index and wantarray
433 0 78 unless defined $index
435 0 78 unless ref $self->hdr->{$index} eq 'HASH'
436 39 39 if (defined(my $v = shift()))
437 0 39 $v < 0 ? :
438 0 39 $v >= dimsize($self, $index) ? :
447 0 10 unless $d
448 0 10 unless defined $self->hdr->{$d}{'vals'}
451 4 6 if (defined $i)
453 4 0 if (ref $i eq 'ARRAY' and dimsize($self, $d) == $#{$i;} + 1) { }
454 0 4 unless $#$i == dimsize($self, $d) - 1
458 16 0 unless &looks_like_number($_)
460 0 4 if (dnumeric($self, $d)) { }
461 0 0 if $i->[0] eq 'a'
471 0 0 if (defined $v)
475 0 0 unless &looks_like_number($_)
476 0 0 if (dnumeric($self, $d)) { }
485 0 0 if (spacing($self, $d))
492 0 10 if (spacing($self, $d))
493 0 0 if wantarray
494 0 0 unless wantarray
496 6 4 if (wantarray) { }
509 0 0 unless ref $self->hdr->{$d} eq 'HASH'
510 0 0 unless defined $i
511 0 0 if (spacing($self, $d)) { }
520 0 2 unless my $d = shift()
522 0 2 unless ref $self->hdr->{$d} eq 'HASH'
523 0 2 if (spacing($self, $d)) { }
525 0 0 if $res >= dimsize($self, $d)
526 0 0 if $res < 0
534 0 2 if dnumeric($self, $d)
535 2 0 unless dnumeric($self, $d)
539 0 2 if (wantarray) { }
563 0 0 if dimsize($self, $i) == 1
573 0 1 unless $self->isa('PDL')
577 0 1 unless defined didx($self, $d)
580 1 0 if (eval { do { $res->can($op) } }) { }
585 0 1 unless defined $res
586 1 0 if (eval { do { $res->nelem } })
587 0 1 if $self->ndims == $res->ndims
589 1 0 if ($res->ndims == $self->ndims - 1)
608 0 0 unless $#n == $self->ndims - 1
613 0 0 unless (qr/$n[$i]/u ~~ \@except)
618 0 0 unless $i == $#n
626 0 0 unless (qr/$n[$i]/u ~~ \@except)
666 2 0 if ($self->isa('PDL'))
674 1 1 unless defined $dim
677 1 1 if ($op eq 'rotate') { }
684 1 0 if (eval { do { $res->can($op) } }) { }
690 2 0 if ($self->isa('PDL'))
705 0 3 unless (eval { do { $self->isa('PDL') } })
707 0 0 if (eval { do { $self->can($op) } }) { }
712 0 0 if (eval { do { $other->isa('PDL') } })
715 0 0 unless $other->nelem == $res->nelem
721 0 3 unless (eval { do { $other->isa('PDL') } })
722 0 0 if (eval { do { $self->can($op) } }) { }
727 0 0 unless $self->nelem == $res->nelem
753 3 3 if (defined($m = didx($other, $ds))) { }
756 0 3 if (dimsize($self, $ds) == 1)
757 0 0 if dimsize($other, $ds) > 1
775 3 9 if (defined($m = didx($self, $ds))) { }
788 3 0 if defined $nother[0]
789 3 0 if defined $tother[0]
790 3 0 if defined $nself[0]
791 3 0 if defined $tself[0]
804 2 1 if (eval { do { $ns->can($op) } }) { }
859 4 0 unless $s{'names'}
863 7 1 if defined $s{$n[$i]}
864 4 4 unless $i == $#n
873 1 7 unless defined $str
875 0 7 if ($str =~ /\(\s*\d+\s*\)/u)
887 7 0 if (spacing($self, $d)) { }
898 0 0 if (dnumeric($self, $d)) { }
917 0 0 if (dnumeric($self, $d))