From: "M. Edward (Ed) Borasky" Date: 2007-11-23T03:12:51+09:00 Subject: Re: eigenvector discrepency was (Re: [Matrix] eigenvalues, eigenvectors in Ruby ???) Une B�vue wrote: > Axel Etzold wrote: > >> Yes, but that's not what I meant, as you can have different vectors >> mapped to the same vector under a matrix mapping. >> You'd have to check, whether, for a matrix m, the following holds: >> >> for each v that is an eigenvector to m, and each corresponding eigenvalue >> c (vectors and numbers as delivered by the software), >> >> m*v=c*v . >> >> I think one can be pretty sure that this has been thoroughly >> tested for rb-gsl. So, just to gain confidence in extendedmatrix.rb, >> I'd test that. > > > OK, presently it's what i'm doing. > thanks > >> With respect to your Float rounding post, I think '===' is >> a built-in Ruby method of its own, though not necessarily for the >> Float class, and thus this might create problems when >> parsing. So either you introduce additional brackets or you >> rename the method to 'float_round' or something. Just a guess. > > no === method (following the pixaxe for Float), ye i'll try another > naming to see... > > again, thanks for your reply RSpec has an "approximately equal" operator that allows you to specify how close two floating point numbers "should be". I forget what it's called, but you should be able to lift the code for it and specify how close numbers need to be. There is something like this built into the eigensystem solvers, however, so you probably don't want to use a finer tolerance than the solver did. :) Actually, since this capability is built into RSpec, you should consider using RSpec as a test framework for number crunching code. Now that we're doing number crunching on RubyTalk, allow me to post a link to the classic references on it: 1. Golub and Van Loan, _Matrix Computations_, http://www.amazon.com/Computations-Hopkins-Studies-Mathematical-Sciences/dp/0801854148 This is the reference for the matrix extensions on RubyForge. 2. Wilkinson, _The Algebraic Eigenvalue Problem_, http://www.amazon.com/Algebraic-Eigenvalue-Mathematics-Scientific-Computation/dp/0198534183/