Branch Coverage

blib/lib/Math/Vector/Real/kdTree.pm
Criterion Covered Total %
branch 145 342 42.4


line true false branch
33 642 41 @v ? :
43 0 0 if $$self{'hidden'}
49 18845 19926 if (@$ixs > $recommended_per_pole) { }
79 0 6536 unless @_
82 6495 41 if (my $tree = $$self{'tree'}) { }
108 28562 6447 if (defined(my $axis = $$t[6])) { }
115 14735 13827 if ($c <= $cut) { }
116 14710 25 if (2 * $n1 + $max_per_pole >= $n0)
122 13804 23 if (2 * $n0 + $max_per_pole >= $n1)
138 350 6097 if ($n > $max_per_pole)
147 0 0 unless $ix >= 0 and $ix < @$vs
155 0 0 if (defined(my $axis = $$t[6])) { }
159 0 0 if ($c <= $cut and _delete($vs, $s0, $ix)) { }
0 0 elsif ($c >= $cut and _delete($vs, $s1, $ix)) { }
160 0 0 if ($$s0[0]) { }
171 0 0 if ($$s1[0]) { }
184 0 0 if ($$ixs[$_] == $ix)
198 0 0 unless $ix >= 0 and $ix < @$vs
207 416 464 if (defined $$t[6]) { }
228 0 0 if (defined(my $axis = $$t[6])) { }
233 0 0 if ($c <= $cut)
234 0 0 if ($p = _path($vs, $$t[4], $ix))
239 0 0 if ($c >= $cut)
240 0 0 if ($p = _path($vs, $$t[5], $ix))
247 0 0 if grep(($_ == $ix), @{$$t[4];})
262 0 0 if ($c < $cut) { }
266 0 0 if ($c == $cut)
268 0 0 if defined $ix
275 0 0 if $$vs[$_] == $v
282 0 67728 unless my $t = $$self{'tree'}
284 0 67728 defined $d ? :
287 12992 54736 if (@but)
288 0 12992 if (@but == 1 and ref $but[0] eq 'HASH') { }
299 0 67728 wantarray ? :
306 0 12992 unless $ix >= 0
319 639556 358457 if (defined(my $axis = $$t[6])) { }
322 331292 308264 $$v[$axis] <= $$t[7] ? :
324 410338 229218 if ($q_d2 <= $best_d2)
327 279293 916558 if $queue_d2[$j] >= $q_d2
335 12992 1643576 if $but and $$but{$_}
337 261272 1382304 if ($d21 <= $best_d2)
343 309551 48906 if ($t = pop @queue)
344 265952 43599 if ($best_d2 >= pop @queue_d2)
357 0 0 unless my $t = $$self{'tree'}
360 0 0 defined $d ? :
362 0 0 if (@but)
363 0 0 if (@but == 1 and ref $but[0] eq 'HASH') { }
373 0 0 wantarray ? :
383 0 0 if $best_d2 < pop @queue_d2
384 0 0 if (defined(my $axis = $$t[6])) { }
386 0 0 if $$a[$axis] <= $$t[7]
387 0 0 if $$b[$axis] >= $$t[7]
390 0 0 if ($d2 <= $best_d2)
393 0 0 if $queue_d2[$j] >= $d2
402 0 0 if $but and $$but{$_}
405 0 0 if ($d2 <= $best_d2 and $v1->dist2_to_box($a, $b) == 0)
418 0 0 unless my $t = $$self{'tree'}
421 0 0 defined $d ? :
423 0 0 if (@but)
424 0 0 if (@but == 1 and ref $but[0] eq 'HASH') { }
434 0 0 wantarray ? :
444 0 0 if $best_d < pop @queue_d
445 0 0 if (defined(my $axis = $$t[6])) { }
447 0 0 if $$a[$axis] <= $$t[7]
448 0 0 if $$b[$axis] >= $$t[7]
451 0 0 if ($d <= $best_d)
454 0 0 if $queue_d[$j] >= $d
463 0 0 if $but and $$but{$_}
466 0 0 if ($d <= $best_d and $v1->chebyshev_dist_to_box($a, $b) == 0)
479 0 80 unless @$vs > 1
480 0 80 defined $d ? :
492 2714 2794 if (defined(my $axis = $$t[6])) { }
501 24777 54917 if ($v->dist2_to_box($c0, $c1) < $$d2s[$ix])
518 15644 12896 if ($d2 < $$d2s[$ix_i])
522 8496 20044 if ($d2 < $$d2s[$ix_j])
534 0 418 unless my $t = $$self{'tree'}
536 418 0 if (my($rix0, $rix1, $rd2) = _find_two_nearest_vectors($vs, $t))
537 418 0 wantarray ? :
549 0 0 if (defined $$t[6])
566 15310 15728 if (defined $$t[6]) { }
581 1956 119899 if ($d2 < $best_d2)
595 115655 3697 if ($d2 < $best_d2)
596 36385 79270 unless (defined $$t1[6])
597 34452 1933 unless (defined $$t2[6])
602 101 738746 if ($d2 < $best_d2)
614 153202 9204 if ($d2) { }
615 94838 58364 if ($d2 < $best_d2)
634 6496 0 if (defined $but and ref $but ne 'HASH')
646 161868 124372 if (defined(my $axis = $$t[6])) { }
649 82785 79083 $c <= $cut ? :
650 117876 43992 if $z->dist2_to_box(@{$q;}[1, 2]) <= $d2
654 124372 0 if (wantarray) { }
658 0 0 if not $$but{$_}
660 0 0 $but ? :
663 6496 117876 unless $t = pop @queue
667 6496 0 if (wantarray)
668 6496 0 if ($but)
679 0 0 if (defined $but and ref $but ne 'HASH')
690 0 0 if (defined(my $axis = $$t[6])) { }
692 0 0 if $cut >= $$a[$axis]
693 0 0 if $cut <= $$b[$axis]
697 0 0 if (wantarray) { }
701 0 0 if not $$but{$_}
703 0 0 $but ? :
706 0 0 unless $t = pop @queue
709 0 0 if (wantarray)
710 0 0 if ($but)
720 0 6496 unless my $t = $$self{'tree'}
722 0 6496 $d ? :
724 6496 0 if (@but)
725 0 6496 if (@but == 1 and ref $but[0] eq 'HASH') { }
736 0 6496 wantarray ? :
741 0 6496 unless $ix >= 0
752 126964 69143 if (defined(my $axis = $$t[6])) { }
755 66619 60345 $$v[$axis] >= $$t[7] ? :
757 88329 38635 if ($q_d2 >= $best_d2)
760 70092 425783 if $queue_d2[$j] <= $q_d2
768 180 443910 if $but and $$but{$_}
770 53073 390837 if ($d21 >= $best_d2)
776 68173 970 if ($t = pop @queue)
777 62647 5526 if ($best_d2 <= pop @queue_d2)
788 0 0 unless my $t = $$self{'tree'}
791 0 0 if (not $hidden or @$vs > 20 * keys(%$hidden))
795 0 0 unless $hidden and $$hidden{$ix}
804 0 0 rand $$t[0] < $$t[4][0] ? :
811 0 224 unless $n_req = int $n_req
812 0 224 unless my $t = $$self{'tree'}
821 2353 5263 if ($n_req <= 1) { }
822 16 2337 if $n_req < 1
828 3696 1567 if (defined $$t[6]) { }
833 0 3696 if $n0_req > $n0
841 4423 5960 if rand $n - $_ < $n_req - @out
863 0 0 if (ref $p) { }
869 0 0 if (@store)
882 0 0 unless $n_req = int $n_req
884 0 0 unless my $t = $$self{'tree'}
899 0 0 unless @km < $n_req
909 0 0 if ($max_d2 > $min_d2_to_box)
910 0 0 if (defined $$p[6]) { }
916 0 0 if ($d2 < ($d2[$_] //= $d2))
922 0 0 if ($min_d2_to_box < $min_d2)
927 0 0 if ($max_d2_to_box < $max_d2)
984 0 0 if ($weight[$pivot] < $dice) { }
1000 0 224 unless @k
1001 0 224 unless my $t = $$self{'tree'}
1011 29478 1570 if (my $n = $n[$_])
1013 8990 20488 if $k != $k[$_]
1017 224 934 unless ($diffs)
1018 224 0 wantarray ? :
1025 0 0 unless @_
1026 0 0 unless my $t = $$self{'tree'}
1035 0 0 if (my $n = $n[$_]) { }
1043 0 0 wantarray ? :
1049 109606 0 if ($n)
1054 10438 99168 if (@down <= 1) { }
1057 8870 1568 if (defined $$sums[$best]) { }
1065 54224 44944 if (defined(my $axis = $$t[6])) { }
1075 242171 27910 if (defined $$sums[$best]) { }
1089 0 224 unless @_
1090 0 224 unless my $t = $$self{'tree'}
1101 14110 0 if ($n)
1106 1418 12692 if (@down <= 1) { }
1110 6943 5749 if (defined(my $axis = $$t[6])) { }
1128 2517 3935 if (defined(my $axis = $$t[6])) { }
1148 209665 216201 if (defined $$t[6]) { }
1160 0 0 $$opts{'pole_id'} ? :
1161 0 0 if (defined(my $axis = $$t[6])) { }
1176 0 0 if ($$opts{'dump_vectors'} // 1) { }
1192 0 0 unless $$self{'hidden'}
1194 0 0 if (my $t = $$self{'tree'}) { }
1195 0 0 if $opts{'remark'}