Dave B. wrote:

It’s immutable so you can treat it like Numeric objects.

Check out narray on the RAA, it might be what you’re looking for.

Apparently it’s fast, too.

http://raa.ruby-lang.org/project/narray/

Cheers,

Dave

I am looking *at* narray, and I am looking *for* code that does matrix

operations with rational and possibly complex rational matrix elements

and I am looking *to* find ways to tune the Ruby interpreter to do these

efficiently. I may end up, when all the smoke has cleared, with

narray, or GSL, or LAPACK or a home-brew interface to a C/C++ symbolic

math package like Singular or Ginac. But right now, my focus is on

Matrix and how to make it better in pure Ruby.

The application I have in mind will use smallish matrices – the 200x200

test case I posted is probably both bigger and more ill-conditioned than

I will need. The application uses lots of matrix algebra to break large

problems up into block-tridiagonal matrices and other structured forms.

Before I look at alternatives, I want to see what I can build with pure

Ruby and the Matrix/Mathn/Rational/Complex libraries.