File Coverage

blib/lib/Graph/MSTHeapElem.pm
Criterion Covered Total %
statement 13 13 100.0
branch 1 2 50.0
condition 2 4 50.0
subroutine 6 6 100.0
pod 0 4 0.0
total 22 29 75.8


line stmt bran cond sub pod time code
1             package Graph::MSTHeapElem;
2              
3 2     2   14 use strict;
  2         4  
  2         84  
4 2     2   9 use warnings;
  2         3  
  2         438  
5              
6             sub new {
7 3090     3090 0 5596 my $class = shift;
8 3090         22777 bless { u => $_[0], v => $_[1], w => $_[2] }, $class;
9             }
10              
11             sub heap {
12 6180     6180 0 106327 my $self = shift;
13 6180 50       17687 @_ ? ($self->{heap} = shift) : $self->{heap};
14             }
15              
16             sub cmp {
17 23100   50 23100 0 931662 ($_[0]->{ w } || 0) <=> ($_[1]->{ w } || 0);
      50        
18             }
19              
20             sub val {
21 3090     3090 0 4861 @{ $_[0] }{ qw(u v w) };
  3090         12817  
22             }
23              
24             1;