Linear Algebra Library for Ruby/Numo::NArray
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 162 commits behind ruby-numo:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Numo::LAPACK : LAPACK binding with Numo::NArray


This is a binding of LAPACK with Numo::NArray .


About column-major order of LAPACK

Numo::LAPACK doesn't change of matrix row or column-major order. NArray uses row-major, LAPACK uses column-major, user script must convert the argument matrix and returned matrix.

(except for norm)

Or see lib/numo/linalg-compat.rb , this is a tiny sample compatible layer.


See lib/numo/linalg-compat.rb .

Implemented Methods

  • geev, heev, heevd - eigenvalues (for complex Hermitian matrix / using divide and conquer algorithm)
  • gels - finding a least squares solution / minimum norm solution
  • gemm - matrix multiplication
  • gesv - solves linear systems
  • gesvd, gesdd - singular value decomposition (using divide and conquer algorithm)
  • geqrf - QR Factorization
  • getrf, potrf - linear equations
  • matrix_rank - matrix rank
  • norm - various norm of a vector or matrix, with optional axes


$ yum install openblas-devel

  * or, install OpenBLAS from source and enjoy multithread acceleration.

* Install Numo::LAPACK
$ git clone git://
$ cd numo-lapack
$ rake build
$ gem install pkg/numo-lapack-*.gem -- --with-openblas --with-opt-dir=/opt/OpenBLAS


  • Documentation complete