Branch Coverage

blib/lib/PDL/Transform.pm
Criterion Covered Total %
branch 141 402 35.0


line true false branch
305 13 8 if (UNIVERSAL::isa($me, 'PDL'))
311 21 0 if (UNIVERSAL::isa($me, 'PDL::Transform') and UNIVERSAL::isa($from, 'PDL')) { }
312 0 21 unless defined $me->{'func'} and ref $me->{'func'} eq 'CODE'
353 1 27 if (UNIVERSAL::isa($me, 'PDL'))
359 28 0 if (UNIVERSAL::isa($me, 'PDL::Transform') and UNIVERSAL::isa($data, 'PDL')) { }
360 0 28 unless defined $me->{'inv'} and ref $me->{'inv'} eq 'CODE'
727 0 9 if (ref $_[$#_] ne 'HASH')
731 9 0 unless (@k)
743 18 9 if (UNIVERSAL::isa($me, 'PDL') and UNIVERSAL::isa($in, 'PDL::Transform'))
749 0 27 unless defined $in and UNIVERSAL::isa($in, 'PDL')
752 0 27 unless $in->nelem
759 16 11 if (ref $tmp eq 'HASH' and not defined $opt)
760 16 0 unless (defined $tmp->{'NAXIS'})
766 0 27 if exists $opt->{'p'}
768 18 9 unless defined $tmp
774 5 22 if (UNIVERSAL::isa($tmp, 'PDL')) { }
0 22 elsif (ref $tmp eq 'HASH') { }
22 0 elsif (ref $tmp eq 'ARRAY') { }
778 4 1 if (defined($x = $tmp->gethdr))
796 0 27 if (scalar @odims < scalar $in->dims)
802 4 23 if defined $ohdr
804 27 0 if ($PDL::Bad::Status)
819 0 27 unless @dd
823 0 27 unless $ddtotal
845 9 18 defined $in->hdr->{'NAXIS'} ? :
847 8 19 unless (defined $out->gethdr and $out->hdr->{'NAXIS'} or $nofits)
848 0 8 if $debug
850 8 0 if defined $in->hdr
866 0 8 if (defined $orange) { }
870 0 0 if $debug
871 0 0 unless UNIVERSAL::isa($orange, 'PDL')
872 0 0 unless $orange->dim(1) == $nd and $orange->ndims == 2
887 5 0 unless ($rectify or ref($f_in) =~ /Linear/i)
888 0 5 if ($f_in->{'name'} ne 'identity')
896 0 0 $me->{'name'} eq 'identity' ? :
8 0 $rectify ? :
912 0 8 if (defined $irange) { }
913 0 0 if $debug
914 0 0 unless UNIVERSAL::isa($irange, 'PDL')
915 0 0 unless $irange->dim(1) == $nd and $irange->ndims == 2
952 0 8 if ($justify)
959 0 8 if $debug
960 8 0 if ($rectify) { }
963 0 8 if $debug
987 1 128 if ($k =~ /(^CROTA\d*$)|(^(CD|PC)\d+_\d+[A-Z]?$)/)
997 0 0 if $debug
999 0 0 if $debug
1001 0 0 unless (ref($f_in) =~ /Linear/)
1008 0 0 if $debug
1010 0 0 if $debug
1012 0 0 if $debug
1027 0 0 if $debug
1033 0 0 if ($k =~ /(^CROTA\d*$)|(^(PC)\d+_\d+[A-Z]?$)|(CDELT\d*$)/)
1047 8 19 unless ($nofits)
1062 0 27 unless defined $idx
1066 23 4 if defined $method
1072 15 12 unless ($integrate)
1084 0 12 if $in->ndims < $idx->ndims - 1
1091 12 0 if ($in->ndims == $#iddims) { }
1110 12 0 if (defined $bound)
1111 0 12 if (ref $bound eq 'ARRAY') { }
0 23 elsif (not $bound =~ /^[0123ftepx]+$/ and $bound =~ /^([0123ftepx])/i) { }
1114 0 0 unless $el =~ /^([0123fFtTeEpPmM])/
1135 0 12 if ref $blur
1136 0 12 if ref $svmin
1139 1 11 if ($PDL::Bad::Status and $in->badflag) { }
1146 0 12 unless $idx->type == double()
1147 0 12 if $debug
1196 0 0 if (UNIVERSAL::isa($data, 'PDL::Transform') and UNIVERSAL::isa($me, 'PDL'))
1239 0 16 unless (defined $me->{'inv'})
1315 0 25 unless @funcs
1324 19 32 if $f->{'idim'} > $me->{'idim'}
1325 19 32 if $f->{'odim'} > $me->{'odim'}
1327 8 43 if (UNIVERSAL::isa($f, 'PDL::Transform::Composition')) { }
1328 0 8 if ($f->{'is_inverse'}) { }
1360 0 40 unless defined $t->{'func'} and ref $t->{'func'} eq 'CODE'
1361 0 40 $ip ? :
1372 0 24 unless defined $t->{'inv'} and ref $t->{'inv'} eq 'CODE'
1373 0 24 $ip ? :
1426 0 24 $c ? :
1434 0 0 if $c or UNIVERSAL::isa($y, 'PDL::Transform')
1437 0 0 if $y < 0
1440 0 0 if abs $y == 1
1441 0 0 if abs $y == 0
1597 0 0 if (not defined $o and ref $source eq 'HASH')
1604 0 0 unless ref $o eq 'HASH'
1629 0 0 unless ref $data and UNIVERSAL::isa($data, 'PDL')
1633 0 0 if ($data->dim(0) > $me->{'idim'})
1647 0 0 $x->ndims > $data->ndims - 1 ? :
1661 0 0 unless (defined $p->{'itable'})
1662 0 0 if ($me->{'idim'} != $me->{'odim'})
1665 0 0 if $PDL::verbose or $PDL::debug or $debug
1697 0 0 if $PDL::verbose or $PDL::debug or $debug
1723 0 0 if $i % 1000 == 0 and $PDL::verbose || $PDL::debug || $debug
1854 2 27 if $#_ % 2 == 0 and not defined $_[-1]
1858 9 20 unless (ref $o)
1869 29 0 if defined $me->{'params'}{'pre'}
1874 29 0 if defined $me->{'params'}{'post'}
1878 21 8 if defined $me->{'params'}{'matrix'}
1881 29 0 unless defined $me->{'params'}{'rot'}
1885 2 27 if defined $o_dims
1889 5 24 if defined $scale
1895 21 8 if (defined $me->{'params'}{'matrix'}) { }
1901 8 0 if (defined $me->{'params'}{'rot'} and UNIVERSAL::isa($me->{'params'}{'rot'}, 'PDL'))
1903 8 0 if $me->{'params'}{'rot'}->nelem == 1
1904 0 8 if $me->{'params'}{'rot'}->nelem == 3
1907 3 5 if (defined $scale and UNIVERSAL::isa($scale, 'PDL') and $scale->getndims > 0) { }
3 2 elsif (defined $me->{'params'}{'pre'} and UNIVERSAL::isa($me->{'params'}{'pre'}, 'PDL') and $me->{'params'}{'pre'}->getndims > 0) { }
0 2 elsif (defined $me->{'params'}{'post'} and UNIVERSAL::isa($me->{'params'}{'post'}, 'PDL') and $me->{'params'}{'post'}->getndims > 0) { }
0 2 elsif (defined $o_dims) { }
1925 0 2 if $debug
1937 29 0 if (defined $rot)
1944 0 0 if UNIVERSAL::isa($angle, 'PDL')
1952 0 29 if (UNIVERSAL::isa($rot, 'PDL') and $rot->nelem > 1) { }
1953 0 0 if ($rot->ndims == 2) { }
0 0 elsif ($rot->nelem == 3) { }
1969 0 29 if ($rot != 0 and $me->{'params'}{'matrix'}->dim(0) > 1)
1981 5 24 if defined $scale
1988 29 0 if ($me->{'params'}{'matrix'}->det($o2 = {'lu', undef})) { }
2005 0 31 if $in->dim(0) < $d
2009 1 30 $in->is_inplace ? :
2022 0 9 if $in->dim(0) < $d
2026 0 9 $in->is_inplace ? :
2032 29 0 defined $me->{'params'}{'inverse'} ? :
2042 0 0 if (not $me->{'is_inverse'}) { }
2044 0 0 if defined $mp->{'pre'}
2047 0 0 if defined $mp->{'post'}
2050 0 0 if defined $mp->{'matrix'}
2053 0 0 if defined $mp->{'inverse'}
2056 0 0 if defined $mp->{'post'}
2059 0 0 if defined $mp->{'pre'}
2062 0 0 if defined $mp->{'inverse'}
2065 0 0 if defined $mp->{'matrix'}
2093 0 2 if ref $y eq 'HASH'
2119 0 0 if ref $y eq 'HASH'
2147 0 0 if ref $y eq 'HASH'
2195 2 17 if (ref $opt ne 'HASH')
2196 0 2 defined $opt ? :
2199 19 0 if defined $hdr and UNIVERSAL::isa($hdr, 'PDL')
2203 0 19 if not defined $hdr or ref $hdr ne 'HASH' or not defined $hdr->{'NAXIS'}
2205 0 19 if UNIVERSAL::isa($n, 'PDL')
2208 0 17 if $opt->{'ignore_rgb'} and $n == 3 and $hdr->{'NAXIS3'} == 3
2220 0 19 if (@hgrab = grep(/^CD\d{1,3}_\d{1,3}$/, keys %$hdr)) { }
2229 0 0 if $debug
2249 0 19 if (@hgrab = grep(/^PC\d{1,3}_\d{1,3}$/, keys %$hdr)) { }
10 9 elsif ($n == 2 and defined $hdr->{'CROTA'} || defined $hdr->{'CROTA1'} || defined $hdr->{'CROTA2'}) { }
2252 0 0 unless $h =~ /PC(\d{1,3})_(\d{1,3})$/
2256 0 0 if $debug and @hgrab
2264 10 0 unless defined $cr
2265 0 10 unless defined $cr
2266 0 10 unless defined $cr
2281 0 19 if all($cd == 0)
2303 1 18 unless @names
2308 38 0 $i - 1 <= $#names ? :
2401 0 0 if (ref $inv eq 'HASH')
2518 0 0 if (ref $o ne 'HASH')
2526 0 0 unless defined $me->{'params'}{'origin'}
2535 0 0 $me->{'params'}{'u'} =~ /^d/i ? :
2536 0 0 if $debug
2543 0 0 if ($me->{'params'}{'r0'}) { }
2544 0 0 $me->{'params'}{'r0'} != 1 ? :
2568 0 0 defined $o->{'r0'} ? :
2577 0 0 $d->is_inplace ? :
2587 0 0 defined $o->{'r0'} ? :
2669 0 0 if (ref $o ne 'HASH')
2683 0 0 defined $o->{'dim'} ? :
2687 0 0 if ($data->is_inplace)
2697 0 0 defined $opt->{'dim'} ? :
2705 0 0 if ($data->is_inplace)
2769 0 0 if (ref $o ne 'HASH')
2789 0 0 defined $o->{'dim'} ? :
2805 0 0 if ($data->is_inplace)
2817 0 0 defined $o->{'dim'} ? :
2846 0 0 if ($data->is_inplace) { }
2933 0 0 if (ref $o ne 'HASH')
2947 0 0 defined $o->{'dim'} ? :
2951 0 0 if ($data->is_inplace)
2961 0 0 defined $opt->{'dim'} ? :
2969 0 0 if ($data->is_inplace)
3040 0 0 if (ref $o ne 'HASH')
3051 0 0 unless defined $me->{'params'}{'origin'}
3057 0 0 $unit =~ /^d/i ? :
3067 0 0 $d->is_inplace ? :
3075 0 0 if defined $o->{'angunit'}
3083 0 0 $d->is_inplace ? :
3094 0 0 if (defined $o->{'angunit'}) { }
3183 0 0 if (ref $o ne 'HASH')
3197 0 0 if (defined($matrix = _opt($o, ['m', 'matrix', 'Matrix']))) { }
0 0 elsif (defined($p = pdl(_opt($o, ['p', 'point', 'points', 'Point', 'Points'])))) { }
3199 0 0 if $matrix->dims != 2 or $matrix->dim(0) != $matrix->dim(1)
3203 0 0 unless defined $me->{'params'}{'idim'}
3208 0 0 unless $me->{'params'}{'idim'} == $matrix->dim(0) - 1
3211 0 0 unless all($inv * 0 == 0)
3218 0 0 unless $p->dims == 3 and all(pdl($p->dims) == pdl(2, 2, 4))
3246 0 0 unless defined $me->{'params'}{'idim'}
3309 1 124 UNIVERSAL::isa($alt, 'PDL') ? :
125 1009 if defined $hash->{$_}
3336 0 0 ref $me->{'func'} eq 'CODE' ? :
0 0 defined $me->{'func'} ? :
3337 0 0 ref $me->{'inv'} eq 'CODE' ? :
0 0 defined $me->{'inv'} ? :