/usr/share/doc/ruby-lapack/README.rdoc is in ruby-lapack 1.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | = 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.
|