= What's Ruby-LAPACK

Ruby-LAPACK is a Ruby wrapper of LAPACK.

= Requires

    * Ruby   (http://www.ruby-lang.org/)
    * LAPACK (http://www.netlib.org/lapack/)
    * NArray (http://narray.rubyforge.org/index.html.en)


= Install

== with gem
 # gem install ruby-lapack

== build from source
 % rake
 % rake tests
 % sudo rake install


= Usage

You need require numru/lapack to use Ruby-lapack
 require 'numru/lapack'

Each subroutine/function is defined as module function of NumRu::Lapack.
 returns = NumRu::Lapack.method_name(args)

    * Arguments
    * The arguments of each method are the arguments of the corresponding subroutine/function without arguments for output, workspace and dimension size of array. Returns
      The methods return the arguments for output of the correspoing subroutine/function. 

In the arguments and returns, array (Matrix) is NArray object. The order of Matrix dimensions is the same as the notation of mathematics: x_ij => x[i-1,j-1].
If you call methods with the argument of :help=>true, or :usage=>true, help or usage message will be printed, respectively.
 NumRu::Lapack.method_name(:help => true)
 NumRu::Lapack.method_name(:usage => true)


= Documents

Documents for individual methods are "doc" directory in the source


= Example

DSYEVR: Compultes selected eigenvalues, and optinally, eigenvectors of a real symmetric matrix.
The following script calculats the leading eigenvalue and corresponding eigenvector of the matrix (x_11 = 1, x_12 = x_21 = 2, x_22 = 3).
Ruby method is NumRu::Lapack.dsyevr.

jobz = "V"
range = "I"
uplo = "U"
a = NArray[[1,2],[2,3]]
vl =  vu = 0 # not be used in this example
il = 1
iu = 2
abstol = 0.0

m, w, z, isuppz, work, iwork, info, a = NumRu::Lapack.dsyevr(jobz, range, uplo, a, vl, vu, il, iu, abstol)

The corresponding FORTRAN subroutine is DSYEVR.

SUBROUTINE DSYEVR(JOBZ, RANGE, UPLO, N, A, LDA, VL, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, IWORK, LIWORK, INFO)
# JOBZ(input), RANGE(input), UPLO(input)
# N(input), A(input/output), LDA(input)
# VL(input), IL(input), IU(input), ABSTOL(input)
# M(output), W(output), Z(output), LDZ(input), ISUPPZ(output)
# WORK(workspace/output), LWORK(input), IWORK(workspace/output), LIWORK(input)
# INFO(output)

N is order of the matrix A, LDA is size of the leading dimension of the array A, and LDZ is size of the leading dimension of the array Z, LWORK is size of the array WORK, and LIWORK is size of the array IWORK.
