mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-15 09:09:58 +08:00
16a76654b8
Graph-0.84 from CPAN
25 lines
335 B
Perl
25 lines
335 B
Perl
package Graph::MSTHeapElem;
|
|
|
|
use strict;
|
|
use vars qw($VERSION @ISA);
|
|
use Heap071::Elem;
|
|
|
|
use base 'Heap071::Elem';
|
|
|
|
$VERSION = 0.01;
|
|
|
|
sub new {
|
|
my $class = shift;
|
|
bless { u => $_[0], v => $_[1], w => $_[2] }, $class;
|
|
}
|
|
|
|
sub cmp {
|
|
($_[0]->{ w } || 0) <=> ($_[1]->{ w } || 0);
|
|
}
|
|
|
|
sub val {
|
|
@{ $_[0] }{ qw(u v w) };
|
|
}
|
|
|
|
1;
|