line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SNA::Network::Edge; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
63
|
use warnings; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
400
|
|
4
|
14
|
|
|
14
|
|
52
|
use strict; |
|
14
|
|
|
|
|
20
|
|
|
14
|
|
|
|
|
366
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
59
|
use Carp qw(croak); |
|
14
|
|
|
|
|
18
|
|
|
14
|
|
|
|
|
679
|
|
7
|
14
|
|
|
14
|
|
64
|
use Object::Tiny::XS qw(source target weight); |
|
14
|
|
|
|
|
18
|
|
|
14
|
|
|
|
|
76
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
SNA::Network::Edge - Edge class for SNA::Network |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Quick summary of what the module does. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Perhaps a little code snippet. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use SNA::Network::Edge; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $foo = SNA::Network::Edge->new(); |
23
|
|
|
|
|
|
|
... |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 new |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Create a new edge with source, target and weight. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
4001
|
|
|
4001
|
1
|
7318
|
my ($package, %params) = @_; |
36
|
4001
|
50
|
|
|
|
6469
|
croak unless defined $params{source}; |
37
|
4001
|
50
|
|
|
|
5096
|
croak unless defined $params{target}; |
38
|
4001
|
50
|
|
|
|
5170
|
croak unless defined $params{index}; |
39
|
4001
|
100
|
|
|
|
5266
|
$params{weight} = 1 unless defined $params{weight}; |
40
|
4001
|
|
|
|
|
16130
|
return bless { %params }, $package; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 source |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Returns the source node object of the edge. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 target |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns the target node object of the edge. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 weight |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns the weight of the edge. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Darko Obradovic, C<< >> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 BUGS |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
65
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
66
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SUPPORT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
perldoc SNA::Network |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
You can also look for information at: |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=over 4 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
L |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * CPAN Ratings |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * Search CPAN |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=back |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Copyright 2009 Darko Obradovic, all rights reserved. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
109
|
|
|
|
|
|
|
under the same terms as Perl itself. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
1; # End of SNA::Network::Edge |