Class: RandSVD
- Inherits:
-
Object
- Object
- RandSVD
- Defined in:
- lib/randsvd.rb,
lib/randsvd/version.rb
Overview
RandSVD is a class that performs truncated singular value decomposition using a randomized algorithm.
Constant Summary collapse
- VERSION =
'0.2.2'
Class Attribute Summary collapse
-
.seed ⇒ Object
readonly
Returns the value of attribute seed.
Class Method Summary collapse
-
.gesdd(mat, k, t = 0, seed = nil) ⇒ Array<NMatrix>
Compute the randomized singular value decompostion using NMatrix::LAPACK.gesdd method.
-
.gesvd(mat, k, t = 0, seed = nil) ⇒ Array<NMatrix>
Compute the randomized singular value decompostion using NMatrix::LAPACK.gesvd method.
Class Attribute Details
.seed ⇒ Object (readonly)
Returns the value of attribute seed.
10 11 12 |
# File 'lib/randsvd.rb', line 10 def seed @seed end |
Class Method Details
.gesdd(mat, k, t = 0, seed = nil) ⇒ Array<NMatrix>
Compute the randomized singular value decompostion using NMatrix::LAPACK.gesdd method.
42 43 44 45 46 |
# File 'lib/randsvd.rb', line 42 def gesdd(mat, k, t = 0, seed = nil) seed ||= srand @seed = seed rsvd(mat, k, t, 1) end |
.gesvd(mat, k, t = 0, seed = nil) ⇒ Array<NMatrix>
Compute the randomized singular value decompostion using NMatrix::LAPACK.gesvd method.
24 25 26 27 28 |
# File 'lib/randsvd.rb', line 24 def gesvd(mat, k, t = 0, seed = nil) seed ||= srand @seed = seed rsvd(mat, k, t, 0) end |