Re: Profiling Ruby Matrix operations

This is the sort of code I’d like to write in pure Ruby, rather than
having to call a C library for efficiency. The matrix I generated is
quite ill-conditioned. It’s quite possible that a “standard” floating
point numerical determinant or matrix inversion routine would choke on
it, while the combination of “matrix”, “mathn” and “rational” I used
had no problem with it. In short, I’m willing to pay for rational
arithmetic and correct results, but not for an inefficient
interpreter. :slight_smile: So if someone is going to rewrite Matrix in C, they
need to do the underlying arithmetic too.

There are some theoretical considerations about exact arithmetic, made
processor-effiicient, in two papers:

E. Kaltofen and V. Pan.
Processor efficient parallel solution of linear systems over an
In Proc. SPAA '91 3rd Ann. ACM Symp. Parallel Algor. Architecture,
180-191, New York, N.Y., 1991. ACM Press

E. Kaltofen and V. Pan.
Processor-efficient parallel solution of linear systems II: the
characteristic and singular cases.
In Proc. 33rd Annual Symp. Foundations of Comp. Sci., pages 714-723,
Alamitos, California, 1992. IEEE Computer Society Press.

These can be downloaded from

From the website, it looks as if these algorithms were implemented in
LINBOX: a generic library for exact black box linear algebra. The
including downloads can be found at
( .

Best regards,


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs