Subject: | as_list possible bug |
Date: | Tue, 16 Aug 2016 09:11:11 +0200 |
To: | bug-Math-MatrixReal [...] rt.cpan.org |
From: | Ilmari Ikonen <ilmari.ikonen84 [...] gmail.com> |
I use this module regularly for statistical analysis with small or
medium data sets.
I encountered the following issue: the function
sub as_list
{
croak "Usage: \$matrix->as_list();" if (@_ != 1);
my($self) = @_;
my($rows,$cols) = ($self->[1], $self->[2]);
my @list;
for(my $i = 0; $i < $rows; $i++ ){
for(my $j = 0; $j < $rows; $j++){
push @list, $self->[0][$i][$j];
}
}
return @list;
}
probably has a bug, since in the two for statements, $rows appears two
times but probably there should be $j < $cols.