Sha256: b76d1d46ec974d806ca8dfa213e3d320835c847e66265b548fde1fea33b18b64

Contents?: true

Size: 824 Bytes

Versions: 6

Compression:

Stored size: 824 Bytes

Contents

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


m = Matrix::alloc([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])
qr, tau = m.QRPT_decomp
p qr.class
p tau.class

b = Vector.alloc([1, 2, 3, 4])

qr, tau, p = m.QRPT_decomp

p Linalg::QRPT.solve(qr, tau, p, b)
p Linalg::QRPT.solve(m, b)
p m.QRPT_solve(b)
p qr.QRPT_solve(tau, p, b)
p m.QRPT_solve(b)

bb = b.clone
p Linalg::QRPT.solve(qr, tau, p, bb)
bb = b.clone
p Linalg::QRPT.solve(m, bb)
bb = b.clone
p m.QRPT_solve(b)
bb = b.clone
p qr.QRPT_solve(tau, p, bb)
bb = b.clone
p m.QRPT_solve(bb)
bb = b.clone
p qr.class
p qr.solve(tau, p, bb)

q, r, tau, p = m.QRPT_decomp2
p q.class
p r.class

p Linalg::QRPT.QRsolve(q, r, p, b)

bb = b.clone
qr.svx(tau, p, bb)
p bb
bb = b.clone
m.QRPT_svx(bb)
p bb

Version data entries

6 entries across 6 versions & 2 rubygems

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