[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[Matrix] eigenvalues, eigenvectors in Ruby ???

unbewusst.sein

11/20/2007 10:50:00 AM


is there algo allready implemented to find eigenvalues, eigenvectors in
Ruby ???

for symetrical matrices ?
--
Une Bévue
39 Answers

Edwin van Leeuwen

11/20/2007 11:44:00 AM

0

Une Bév
ue wrote:
> is there algo allready implemented to find eigenvalues, eigenvectors in
> Ruby ???
>
> for symetrical matrices ?
You can use rb-gsl to do that. http://rb-gsl.rubyforge.org/...

It is a binding to the gsl library (written in c).

Edwin
--
Posted via http://www.ruby-....

Alex Shulgin

11/20/2007 12:14:00 PM

0

On Nov 20, 12:49 pm, unbewusst.s...@weltanschauung.com.invalid (Une
Bévue) wrote:
> is there algo allready implemented to find eigenvalues, eigenvectors in
> Ruby ???
>
> for symetrical matrices ?

Take a look at RNum: http://rnum.ruby...

Ruby Numerical Library is a linear algebra package using Blas and
Lapack (the highly regarded scientific libraries originally written in
FORTRAN.)


--
Alex

Axel Etzold

11/20/2007 3:27:00 PM

0


-------- Original-Nachricht --------
> Datum: Tue, 20 Nov 2007 19:50:14 +0900
> Von: unbewusst.sein@weltanschauung.com.invalid
> An: ruby-talk@ruby-lang.org
> Betreff: [Matrix] eigenvalues, eigenvectors in Ruby ???

>
> is there algo allready implemented to find eigenvalues, eigenvectors in
> Ruby ???
>
> for symetrical matrices ?
> --
> Une Bévue

As far as I know, there is nothing like that in the "matrix.rb" Matrix
class, but you can find this information by using Ruby bindings to GSL

http://rb-gsl.ruby...

or, alternatively, via the bindings to the R statistical language,

http://raa.ruby-lang.org/proje...


Best regards,

Axel
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/mult...

M. Edward (Ed) Borasky

11/20/2007 3:34:00 PM

0

Axel Etzold wrote:
> -------- Original-Nachricht --------
>> Datum: Tue, 20 Nov 2007 19:50:14 +0900
>> Von: unbewusst.sein@weltanschauung.com.invalid
>> An: ruby-talk@ruby-lang.org
>> Betreff: [Matrix] eigenvalues, eigenvectors in Ruby ???
>
>> is there algo allready implemented to find eigenvalues, eigenvectors in
>> Ruby ???
>>
>> for symetrical matrices ?
>> --
>> Une Bévue
>
> As far as I know, there is nothing like that in the "matrix.rb" Matrix
> class, but you can find this information by using Ruby bindings to GSL
>
> http://rb-gsl.ruby...
>
> or, alternatively, via the bindings to the R statistical language,
>
> http://raa.ruby-lang.org/proje...
>
>
> Best regards,
>
> Axel

One of the Summer of Code projects extends Matrix to do most of the
common matrix operations. Try

http://rubyforge.org/proje...


Cameron McBride

11/20/2007 3:40:00 PM

0

On 11/20/07, Une B=E9vue <unbewusst.sein@weltanschauung.com.invalid> wrote:
>
> is there algo allready implemented to find eigenvalues, eigenvectors in
> Ruby ???
>
> for symetrical matrices ?

Like several have already said, if you're doing numerical work - you
should use something besides the matrix lib in the stdlib.

For yet another working suggestion, NArray has an extension to do
eigenvalues and eigenvectors based on lapack.

http://narray.ruby...
(ext is called na_geev, it's also available on that page)

It's worked for me.

Cameron

Cameron McBride

11/20/2007 3:48:00 PM

0

On 11/20/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> One of the Summer of Code projects extends Matrix to do most of the
> common matrix operations. Try
>
> http://rubyforge.org/proje...

That's kind of neat, I missed it. Thanks.

Do you know right off how its accuracy compares to GSL/LAPACK routines?

Cameron

Axel Etzold

11/20/2007 4:20:00 PM

0


-------- Original-Nachricht --------
> Datum: Wed, 21 Nov 2007 00:47:45 +0900
> Von: "Cameron McBride" <cameron.mcbride@gmail.com>
> An: ruby-talk@ruby-lang.org
> Betreff: Re: [Matrix] eigenvalues, eigenvectors in Ruby ???

> On 11/20/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> > One of the Summer of Code projects extends Matrix to do most of the
> > common matrix operations. Try
> >
> > http://rubyforge.org/proje...
>

Dear Ed and Cameron,

> That's kind of neat, I missed it. Thanks.
>

Me too. Very nice.

> Do you know right off how its accuracy compares to GSL/LAPACK routines?

Am I wrong in thinking that you can use that library without being
forced to calculate in Floats, i.e. can one use Rationals, Sqrts,
continued fractions, whatever as matrix entries ?

Then, its accuracy should only be limited by the space available on
the machine.

Best regards,

Axel
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/mult...

unbewusst.sein

11/20/2007 7:05:00 PM

0

Alex Shulgin <alex.shulgin@gmail.com> wrote:

> On Nov 20, 12:49 pm, unbewusst.s...@weltanschauung.com.invalid (Une
> Bévue) wrote:
> > is there algo allready implemented to find eigenvalues, eigenvectors in
> > Ruby ???
> >
> > for symetrical matrices ?
>
> Take a look at RNum: http://rnum.ruby...
>
> Ruby Numerical Library is a linear algebra package using Blas and
> Lapack (the highly regarded scientific libraries originally written in
> FORTRAN.)
>
>
> --
> Alex

ok, fine thanks, to both !
--
Une Bévue

unbewusst.sein

11/20/2007 7:35:00 PM

0

Axel Etzold <AEtzold@gmx.de> wrote:

>
> Am I wrong in thinking that you can use that library without being
> forced to calculate in Floats, i.e. can one use Rationals, Sqrts,
> continued fractions, whatever as matrix entries ?

yes i had this prob with gsl, my matrices (coming from chemistry then
having only integer numbers...) print out with -0.000e+00 for 0 and
1.000e+00 for 1 ...)

I'll try it asap ( http://rubyforge.org/proje... ) because the
readme says :

The project consists of some enhancements to the Ruby "Matrix" module
and includes: LU and QR (Householder, Givens, Gram Schmidt, Hessenberg)
decompositions, bidiagonalization, eigenvalue and eigenvector
-----------------------------------^^^^^^^^^^^----^^^^^^^^^^^
calculations.


i need also permutation matrices, whose i didn't understood in gsl...

anyway, thanks a lot !!!

--
Une Bévue

unbewusst.sein

11/20/2007 7:35:00 PM

0

Cameron McBride <cameron.mcbride@gmail.com> wrote:

>
> For yet another working suggestion, NArray has an extension to do
> eigenvalues and eigenvectors based on lapack.

OK, fine thanks, i've a lot a orking solution right now...

--
Une Bévue