Path: | csvd.rb |
Last Update: | Wed Dec 10 18:20:29 +0100 2008 |
ruby
Singular value decomposition. Slightly modified fom Press et al.
# File csvd.rb, line 13 13: def csvdcmp(a, w, v) 14: 15: m = a.dim1; n = a.dim2 16: fail "svdcmp: bad frame of a" unless m >= n 17: fail "svdcmp: bad frame of w" unless n == w.dim 18: fail "svdcmp: bad frame of v" unless v.dim1 == n && v.dim2 == n 19: fail "svdcmp: dim = 0 as input" if m.zero? || n.zero? 20: 21: 22: ?? 23: end