← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:45:28 2015

Filename/Users/ap13/perl5/lib/perl5/Graph/Matrix.pm
StatementsExecuted 3 statements in 278µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11121µs48µsGraph::Matrix::::BEGIN@6Graph::Matrix::BEGIN@6
0000s0sGraph::Matrix::::getGraph::Matrix::get
0000s0sGraph::Matrix::::newGraph::Matrix::new
0000s0sGraph::Matrix::::setGraph::Matrix::set
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Graph::Matrix;
2
3# $SIG{__DIE__ } = sub { use Carp; confess };
4# $SIG{__WARN__} = sub { use Carp; confess };
5
62274µs276µs
# spent 48µs (21+27) within Graph::Matrix::BEGIN@6 which was called: # once (21µs+27µs) by Graph::AdjacencyMatrix::BEGIN@6 at line 6
use strict;
# spent 48µs making 1 call to Graph::Matrix::BEGIN@6 # spent 27µs making 1 call to strict::import
7
8sub new {
9 my ($class, $g) = @_;
10 my @V = $g->vertices;
11 my $V = @V;
12 my %V; @V{ @V } = 0 .. $#V;
13 bless [ [ map { [ ] } 0 .. $#V ], \%V ], $class;
14}
15
16sub set {
17 my ($m, $u, $v, $val) = @_;
18 my ($i, $j) = map { $m->[1]->{ $_ } } ($u, $v);
19 $m->[0]->[$i]->[$j] = $val;
20}
21
22sub get {
23 my ($m, $u, $v) = @_;
24 my ($i, $j) = map { $m->[1]->{ $_ } } ($u, $v);
25 $m->[0]->[$i]->[$j];
26}
27
2814µs1;
29__END__