Subject: | math-gsl eigenpair bug |
Date: | Tue, 14 Apr 2009 23:37:21 +0100 |
To: | bug-Math-Gsl [...] rt.cpan.org |
From: | Ian Malone <ibmalone [...] cantab.net> |
Hi,
It seems the Math::GSL::Matrix eigenpair method only returns the first
two eigenvectors, I've tried patching the module as below and this seems
to allow larger matrices:
v5.10.0 built for x86_64-linux-thread-multi on Fedora, both Math::GSL
0.18 and 0.19
--- ../Math-GSL-0.18//lib/Math/GSL/Matrix.pm 2009-03-24
04:53:10.000000000 +0000
+++ ../Math-GSL-0.18/blib/lib/Math/GSL/Matrix.pm 2009-04-14
23:30:30.000000000 +0100
@@ -1653,7 +1653,7 @@
gsl_eigen_nonsymmv($self->raw, $vector->raw, $evec->raw, $eigen);
- my $eigenvectors = [ map { $evec->col($_)->as_vector } (0,1) ];
+ my $eigenvectors = [ map { $evec->col($_)->as_vector } (0 .. $r-1) ];
my $x = gsl_vector_complex_real($vector->raw); # vector of real
components
my $y = gsl_vector_complex_imag($vector->raw); # vector of
imaginary components
Thanks
imalone