3 # $SIG{__DIE__ } = sub { use Carp; confess };
4 # $SIG{__WARN__} = sub { use Carp; confess };
12 my %V; @V{ @V } = 0 .. $#V;
13 bless [ [ map { [ ] } 0 .. $#V ], \
%V ], $class;
17 my ($m, $u, $v, $val) = @_;
18 my ($i, $j) = map { $m->[1]->{ $_ } } ($u, $v);
19 $m->[0]->[$i]->[$j] = $val;
24 my ($i, $j) = map { $m->[1]->{ $_ } } ($u, $v);
34 Graph::Matrix - create and manipulate a V x V matrix of graph G
40 my $g = Graph::Directed->new;
41 $g->add_...(); # build $g
42 my $m = Graph::Matrix->new($g);
48 B<This module is meant for internal use by the Graph module.>
56 Construct a new Matrix from the Graph $g.
66 Return the value at the edge from $u to $v.
68 =item set($u, $v, $val)
70 Set the edge from $u to $v to value $val.
74 =head1 AUTHOR AND COPYRIGHT
76 Jarkko Hietaniemi F<jhi@iki.fi>
80 This module is licensed under the same terms as Perl itself.