Sha256: e47c9732bec59684e3b149ebd216b1939c00a1f96d4a33a5cd86de53cb57d7e8

Contents?: true

Size: 334 Bytes

Versions: 4

Compression:

Stored size: 334 Bytes

Contents

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

m = NMatrix[[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]]

u, v, s = Linalg::SV.decomp(m)

puts "u ->"
p u

puts "v ->"
p v

puts "s ->"
p s

b = NArray[1.0, 2, 3, 4]

puts "solved ->"
p Linalg::SV.solve(u, v, s, b)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gsl-2.1.0.3 examples/linalg/SV_narray.rb
gsl-2.1.0.2 examples/linalg/SV_narray.rb
gsl-2.1.0.1 examples/linalg/SV_narray.rb
gsl-2.1.0 examples/linalg/SV_narray.rb