| 1 | package AI::NeuralNet::FastSOM::Hexa; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 3 | ▶ | use AI::NeuralNet::FastSOM; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 3 | our @ISA = qw/AI::NeuralNet::FastSOM/; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 3 | our $VERSION = '0.19'; | |||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 2 | ▶ | sub radius { shift->{_R} } | ||||||||||||||||||
|
Subroutine
radius: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 12 | 16 | ▶ | sub diameter { shift->{_X} } | ||||||||||||||||||
|
Subroutine
diameter: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 0 | ▶ | sub as_data { die 'not implemented' } | ||||||||||||||||||
|
Subroutine
as_data: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 15 | 0 | ▶ | sub as_string { die 'not implemented' } | ||||||||||||||||||
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 11 | ▶ | sub initialize { | ||||||||||||||||||
|
Subroutine
initialize: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 18 | 11 | my $self = shift; | |||||||||||||||||||
| 19 | 11 | my @data = @_; | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 11 | our $i = 0; | |||||||||||||||||||
| 22 | 52 | ▶ | my $get_from_stream = sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 23 | 52 | ▶ | $i = 0 if $i > $#data; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 24 | 52 | return [ @{ $data[$i++] } ]; # cloning ! | |||||||||||||||||||
| 25 | 11 | ▶ | } if @data; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 17 | ▶ | $get_from_stream ||= sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 27 | 17 | return [ map { rand( 1 ) - 0.5 } 1..$self->{_Z} ]; | |||||||||||||||||||
| 28 | 11 | ▶ | }; | ||||||||||||||||||
|
Condition66%2/3
$get_from_stream ||= sub {
return [map({rand(1) - "0.5";} 1 .. $self->{"_Z"})];
}
MC/DC0%0/2
$get_from_stream ||= sub {
return [map({rand(1) - "0.5";} 1 .. $self->{"_Z"})];
}
$get_from_stream
sub {
return [map({rand(1) - "0.5";} 1 .. $self->{"_Z"})];
}
Truth table66%2/3
A ||= B
A= $get_from_streamB= sub {
return [map({rand(1) - "0.5";} 1 .. $self->{"_Z"})];
}
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 11 | for my $x (0 .. $self->{_X}-1) { | |||||||||||||||||||
| 31 | 27 | for my $y (0 .. $self->{_X}-1) { | |||||||||||||||||||
| 32 | 69 | $self->{map}->[$x]->[$y] = &$get_from_stream; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 3 | 1; | |||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||