From: Axel Etzold Date: 2007-11-24T07:17:20+09:00 Subject: Re: eigenvector discrepency was (Re: [Matrix] eigenvalues, eigenvectors in Ruby ???) -------- Original-Nachricht -------- > Datum: Sat, 24 Nov 2007 06:45:00 +0900 > Von: unbewusst.sein@weltanschauung.com.invalid > An: ruby-talk@ruby-lang.org > Betreff: Re: eigenvector discrepency was (Re: [Matrix] eigenvalues, eigenvectors in Ruby ???) > Axel Etzold wrote: > > > These considerations are actually for really big matrices, not for > > 4x4 ones - maybe if you had to calculate symmetries of the DNA or > > something ? > > i'll not compute for DNA, a basic molecule is taxane involving 20 > carbone atoms, then a 20X20 matrix dimension is an average. > > then, you mean GSL is using the QR approach ? I think you can choose whichever you like and let GSL (or rb-gsl) do computations using that method. There are references to the C code GSL is written in for eigen_jacobi.c and for linalg_qr.c -- there are examples for using these in rb-gsl's example section. The result will be correct, though not necessarily identical for either method - as you can choose different vectors to form a basis. I haven't checked for extended_matrix.rb, but I think the same choice will be offered. Now, assuming you have the choice between both these methods and two implementations (rb-gsl/gsl and extended_matrix), I think you'd go for rb-gsl and qr decomposition in a 20x20 matrix, because: GSL is implemented in C, which runs much faster than pure Ruby, (here: extended_matrix) and as you're having a discrete problem, you can round of errors after the computation is done. You'd choose QR over Jacobi, because the cube of 20 is much bigger than the square. You'll feel that if you have to do many calculations like that. But sometimes, you might need some really exact knowledge, involving fractions where every bit counts -- then extended_matrix will take some additional seconds time, but the result will be exact, for all possible decimal points you could wish for .... Best regards, Axel -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser