blib/lib/Math/ConvexHull/MonotoneChain.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 2 SCAR 3.4
CC
2
Cov
100%
convex_hull
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
↑ Summary MonotoneChain.xs »
1 package Math::ConvexHull::MonotoneChain;
2 2 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 require Exporter;
7  
8 2 our @ISA = qw(Exporter);
9 2 our @EXPORT_OK = qw(
10 convex_hull
11 );
12 2 our @EXPORT = qw();
13 2 our %EXPORT_TAGS = ('all' => \@EXPORT_OK);
14  
15 2 our $VERSION = '0.01';
16  
17 2 require XSLoader;
18 2 XSLoader::load('Math::ConvexHull::MonotoneChain', $VERSION);
19  
20 6 ▶sub convex_hull {
Subroutine convex_hull: called CC=2 SCAR=6.9
Pod documented
21 6 my $ary_ref = shift;
22 return convex_hull_sorted([
23 6 ▶ sort {$a->[0] <=> $b->[0] || $a->[1] <=> $b->[1]} @$ary_ref
Condition100%3/3
$Math::ConvexHull::MonotoneChain::a->[0] <=> $Math::ConvexHull::MonotoneChain::b->[0] || $Math::ConvexHull::MonotoneChain::a->[1] <=> $Math::ConvexHull::MonotoneChain::b->[1]
l!l&&r!l&&!r
23104
MC/DC100%2/2
$Math::ConvexHull::MonotoneChain::a->[0] <=> $Math::ConvexHull::MonotoneChain::b->[0] || $Math::ConvexHull::MonotoneChain::a->[1] <=> $Math::ConvexHull::MonotoneChain::b->[1]
$Math::ConvexHull::MonotoneChain::a->[0] <=> $Math::ConvexHull::MonotoneChain::b->[0] $Math::ConvexHull::MonotoneChain::a->[1] <=> $Math::ConvexHull::MonotoneChain::b->[1]
Truth table100%3/3
A || B
A= $Math::ConvexHull::MonotoneChain::a->[0] <=> $Math::ConvexHull::MonotoneChain::b->[0]B= $Math::ConvexHull::MonotoneChain::a->[1] <=> $Math::ConvexHull::MonotoneChain::b->[1]
ABresult
1X1
011
000
24 ]);
25 }
26 2 1;
27 __END__
↑ Summary MonotoneChain.xs »