line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package List::Compare::Base::_Engine; |
2
|
|
|
|
|
|
|
our $VERSION = 0.55; |
3
|
|
|
|
|
|
|
# Holds subroutines used within |
4
|
|
|
|
|
|
|
# List::Compare::Base::Accelerated and List::Compare::Functional |
5
|
52
|
|
|
52
|
|
408
|
use Carp; |
|
52
|
|
|
|
|
112
|
|
|
52
|
|
|
|
|
3267
|
|
6
|
52
|
|
|
|
|
4349
|
use List::Compare::Base::_Auxiliary qw( |
7
|
|
|
|
|
|
|
_equiv_engine |
8
|
|
|
|
|
|
|
_calculate_union_seen_only |
9
|
|
|
|
|
|
|
_calculate_seen_only |
10
|
52
|
|
|
52
|
|
329
|
); |
|
52
|
|
|
|
|
106
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
our @EXPORT_OK = qw| |
13
|
|
|
|
|
|
|
_unique_all_engine |
14
|
|
|
|
|
|
|
_complement_all_engine |
15
|
|
|
|
|
|
|
|; |
16
|
52
|
|
|
52
|
|
381
|
use strict; |
|
52
|
|
|
|
|
149
|
|
|
52
|
|
|
|
|
20102
|
|
17
|
|
|
|
|
|
|
local $^W = 1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _unique_all_engine { |
20
|
96
|
|
|
96
|
|
169
|
my $aref = shift; |
21
|
96
|
|
|
|
|
509
|
my $seenref = _calculate_seen_only($aref); |
22
|
|
|
|
|
|
|
|
23
|
96
|
|
|
|
|
230
|
my @all_uniques = (); |
24
|
96
|
|
|
|
|
304
|
for my $i (sort {$a <=> $b} keys %{$seenref}) { |
|
656
|
|
|
|
|
1057
|
|
|
96
|
|
|
|
|
437
|
|
25
|
456
|
|
|
|
|
659
|
my %seen_in_all_others = (); |
26
|
456
|
|
|
|
|
580
|
for my $j (keys %{$seenref}) { |
|
456
|
|
|
|
|
892
|
|
27
|
2232
|
100
|
|
|
|
3899
|
unless ($i == $j) { |
28
|
1776
|
|
|
|
|
2194
|
for my $k (keys %{$seenref->{$j}}) { |
|
1776
|
|
|
|
|
3836
|
|
29
|
9616
|
|
|
|
|
13770
|
$seen_in_all_others{$k}++; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} |
34
|
456
|
|
|
|
|
729
|
my @these_uniques = (); |
35
|
456
|
|
|
|
|
585
|
for my $l (keys %{$seenref->{$i}}) { |
|
456
|
|
|
|
|
973
|
|
36
|
|
|
|
|
|
|
push @these_uniques, $l |
37
|
2488
|
100
|
|
|
|
4296
|
unless $seen_in_all_others{$l}; |
38
|
|
|
|
|
|
|
} |
39
|
456
|
|
|
|
|
1181
|
$all_uniques[$i] = \@these_uniques; |
40
|
|
|
|
|
|
|
} |
41
|
96
|
|
|
|
|
553
|
return \@all_uniques; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _complement_all_engine { |
45
|
112
|
|
|
112
|
|
253
|
my ($aref, $unsortflag) = @_; |
46
|
112
|
|
|
|
|
337
|
my ($unionref, $seenref) = _calculate_union_seen_only($aref); |
47
|
112
|
100
|
|
|
|
290
|
my @union = $unsortflag ? keys %{$unionref} : sort(keys %{$unionref}); |
|
48
|
|
|
|
|
237
|
|
|
64
|
|
|
|
|
503
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Calculate @xcomplement |
50
|
|
|
|
|
|
|
# Inputs: $aref @union %seen |
51
|
112
|
|
|
|
|
230
|
my (@xcomplement); |
52
|
112
|
|
|
|
|
227
|
for (my $i = 0; $i <= $#{$aref}; $i++) { |
|
648
|
|
|
|
|
1314
|
|
53
|
536
|
|
|
|
|
736
|
my @complementthis = (); |
54
|
536
|
|
|
|
|
772
|
foreach my $el (@union) { |
55
|
5328
|
100
|
|
|
|
9951
|
push(@complementthis, $el) unless (exists $seenref->{$i}->{$el}); |
56
|
|
|
|
|
|
|
} |
57
|
536
|
|
|
|
|
1074
|
$xcomplement[$i] = \@complementthis; |
58
|
|
|
|
|
|
|
} |
59
|
112
|
|
|
|
|
749
|
return \@xcomplement; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |