use vars
qw($VERSION @ISA);
@ISA = qw(Exporter Heap::Elem);
Graph::HeapElem - internal use only
B<INTERNAL USE ONLY> for the Graph module
Copyright 1999, O'Reilly & Associates.
This code is distributed under the same copyright terms as Perl itself.
# Preloaded methods go here.
$class = ref($class) || $class;
# two slot array, 0 for the vertex, 1 for use by Heap
my $self = [ [ @_ ], undef ];
return bless $self, $class;
@_ ?
($self->[0]->[0] = shift) : $self->[0]->[0];
($self->[0]->[1]->{ $self->vertex } = shift) :
$self->[0]->[1]->{ $self->vertex };
($self->[0]->[2]->{ $self->vertex } = shift) :
$self->[0]->[2]->{ $self->vertex };
@_ ?
($self->[1] = shift) : $self->[1];
my ($uw, $vw) = ( $u->weight, $v->weight );
return defined $vw ?
$uw <=> $vw : -1;
return defined $vw ?
1 : 0;