line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AI::NeuralNet::FastSOM::Hexa; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
52368
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
84
|
|
4
|
3
|
|
|
3
|
|
10
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
75
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1473
|
use AI::NeuralNet::FastSOM; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1061
|
|
7
|
|
|
|
|
|
|
our @ISA = qw/AI::NeuralNet::FastSOM/; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
1
|
2163
|
sub radius { shift->{_R} } |
12
|
16
|
|
|
16
|
1
|
2108
|
sub diameter { shift->{_X} } |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
1
|
0
|
sub as_data { die 'not implemented' } |
15
|
0
|
|
|
0
|
1
|
0
|
sub as_string { die 'not implemented' } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub initialize { |
18
|
11
|
|
|
11
|
0
|
12975
|
my $self = shift; |
19
|
11
|
|
|
|
|
26
|
my @data = @_; |
20
|
|
|
|
|
|
|
|
21
|
11
|
|
|
|
|
24
|
our $i = 0; |
22
|
|
|
|
|
|
|
my $get_from_stream = sub { |
23
|
52
|
100
|
|
52
|
|
96
|
$i = 0 if $i > $#data; |
24
|
52
|
|
|
|
|
54
|
return [ @{ $data[$i++] } ]; # cloning ! |
|
52
|
|
|
|
|
405
|
|
25
|
11
|
100
|
|
|
|
59
|
} if @data; |
26
|
|
|
|
|
|
|
$get_from_stream ||= sub { |
27
|
17
|
|
|
17
|
|
69
|
return [ map { rand( 1 ) - 0.5 } 1..$self->{_Z} ]; |
|
51
|
|
|
|
|
301
|
|
28
|
11
|
|
100
|
|
|
97
|
}; |
29
|
|
|
|
|
|
|
|
30
|
11
|
|
|
|
|
94
|
for my $x (0 .. $self->{_X}-1) { |
31
|
27
|
|
|
|
|
112
|
for my $y (0 .. $self->{_X}-1) { |
32
|
69
|
|
|
|
|
88
|
$self->{map}->[$x]->[$y] = &$get_from_stream; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |