# \[ANN\] Ruby Linear Algebra Library 1.0.0

**URL:** <https://www.ruby-forum.com/t/ann-ruby-linear-algebra-library-1-0-0/150215>\
**Category:** Ruby\
**Created:** [October 6, 2008, 4:51am UTC](https://www.ruby-forum.com/t/ann-ruby-linear-algebra-library-1-0-0/150215 "2008-10-06T04:51:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [October 6, 2008, 4:51am UTC](https://www.ruby-forum.com/t/ann-ruby-linear-algebra-library-1-0-0/150215/1 "2008-10-06T04:51:47Z")

</div>

= Linalg - Ruby Linear Algebra Library

A Fortran-based linear algebra package.

[http://linalg.rubyforge.org/](http://linalg.rubyforge.org/)

[http://rubyforge.org/frs/?group\_id=273](http://rubyforge.org/frs/?group_id=273)

Statically-linked binaries (no dependencies required) are available for  
Win32, Mac, Linux, and Cygwin.

Major features:

- Cholesky decomposition
- LU decomposition
- QR decomposition
- Schur decomposition
- Singular value decomposition
- Eigenvalues and eigenvectors of a general matrix
- Minimization by least squares
- Linear equation solving
- Stand-alone LAPACK bindings: call any LAPACK routine from directly  
from ruby.

Minor features:

- Convenient iterators
- Condition numbers and condition number estimates
- Nullspace, rank, nullity
- Inverse
- Pseudo-inverse
- Determinant
- 2-norm, 1-norm, infinity-norm, Frobenius norm

This release consists of installer changes for Mac and libg2c support.  
This announcement is mostly for Mac users who were previously thwarted  
when they tried to install.

The 1.0.0 naming is intended to convey that the package probably won’t  
change much (pending an outpouring of requests), and to reflect the 2600  
downloads without a bug report (installer issues aside).

Linalg was written 4.27 years ago when I needed the SVD of a general  
(non-symmetric) matrix. Rubyforge had just 272 projects and there  
wasn’t anything which was suitable. (At the time I was also disinclined  
to use my real name on the Internet.)

Today I would guess Linalg fills a niche for those needing to do some  
quick linear algebra. Because its scope is limited it is readily  
comprehensible, and with the binary install you are running immediately.

Since all 1498 Lapack routines are available from ruby, there’s also a  
potential niche for those seeking to optimize bottlenecks with specific  
Lapack routines.

The latest version from the repository compiles with ruby-1.9. The test  
suite (successfully) completes in half the time under 1.9.

James M. Lawrence

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [October 6, 2008, 6:43am UTC](https://www.ruby-forum.com/t/ann-ruby-linear-algebra-library-1-0-0/150215/2 "2008-10-06T06:43:53Z")

</div>

On Mon, 2008-10-06 at 11:50 +0900, James M. Lawrence wrote:

> = Linalg - Ruby Linear Algebra Library
> 
> A Fortran-based linear algebra package.
> 
> [http://linalg.rubyforge.org/](http://linalg.rubyforge.org/)
> 
> [http://rubyforge.org/frs/?group\_id=273](http://rubyforge.org/frs/?group_id=273)
> 
> Statically-linked binaries (no dependencies required) are available for  
> Win32, Mac, Linux, and Cygwin.

If you want to dynamically link – for example, if you have a  
dynamically linked lapack-atlas on Gentoo Linux – how difficult is it?  
Atlas runs like a scalded duck on my Athlon64 X2!

> Since all 1498 Lapack routines are available from ruby, there’s also a  
> potential niche for those seeking to optimize bottlenecks with specific  
> Lapack routines.

Yeah … hence my question about dynamic linking above.

–  
M. Edward (Ed) Borasky  
[ruby-perspectives.blogspot.com](http://ruby-perspectives.blogspot.com)

“A mathematician is a machine for turning coffee into theorems.” –  
AlfrÃ©d RÃ©nyi via Paul ErdÅ‘s

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [October 6, 2008, 10:38am UTC](https://www.ruby-forum.com/t/ann-ruby-linear-algebra-library-1-0-0/150215/3 "2008-10-06T10:38:44Z")

</div>

M. Edward (Ed) Borasky wrote:

> If you want to dynamically link – for example, if you have a  
> dynamically linked lapack-atlas on Gentoo Linux – how difficult is it?  
> Atlas runs like a scalded duck on my Athlon64 X2!

It should automatically work; it links to whatever it finds as -llapack.  
I just tested an ATLAS-based Linalg on Ubuntu and it runs well. (In  
fact I had forgot about ATLAS until you mentioned it.)

In Ubuntu the vanilla LAPACK is

% sudo apt-get install lapack3-dev

while the ATLAS LAPACK is

% sudo apt-get install atlas3-base-dev

Alternatives like atlas3-sse2-dev are also available.

What I said about the Mac was wrong – the Mac binaries are linked to  
LAPACK and BLAS libraries which appear to be present on all 10.4 and  
10.5 machines (the Accelerate framework). So it’s a dynamic link, but  
there are still no external dependencies.

James M. Lawrence
