Sha256: 0d094b4833c77422a0328a9e0408f6d967ba425530b9c5a3dbe8605fb4bfb9eb

Contents?: true

Size: 436 Bytes

Versions: 6

Compression:

Stored size: 436 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")
include GSL
include Linalg

m = NArray[[0.18, 0.60, 0.57, 0.96], [0.41, 0.24, 0.99, 0.58],
           [0.14, 0.30, 0.97, 0.66], [0.51, 0.13, 0.19, 0.85]]
b = NArray[1.0, 2, 3, 4]

lu, perm, signum = LU.decomp(m)
p m
p lu

x = LU.solve(lu, perm, b)
p x
p b

LU.svx(lu, perm, b)
p b

m2 = Matrix.alloc([1, 2, 3, 6, 5, 4, 7, 8, 1], 3, 3).to_nmatrix
lu, perm, signum = LU.decomp(m2)
p LU.det(lu, signum)

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gsl-2.1.0.3 examples/linalg/LU_narray.rb
gsl-2.1.0.2 examples/linalg/LU_narray.rb
gsl-2.1.0.1 examples/linalg/LU_narray.rb
gsl-2.1.0 examples/linalg/LU_narray.rb
gsl-1.16.0.6 examples/linalg/LU_narray.rb
rb-gsl-1.16.0.5 examples/linalg/LU_narray.rb