Computes the singular value decomposition.
linalg_svd(x, s, u = NULL, vt = NULL)
x | Input data. The input values are overwritten. |
---|---|
s | Singular values. |
u, vt | The left/right singular vectors. Should both be |
You will need to initialize the return objects s
and/or u
and
vt
.
manually. See the example.
suppressMessages(library(fmlr)) x = cpumat(3, 2) x$fill_linspace(1, 6) s = cpuvec() linalg_svd(x, s) s$info()#> # cpuvec 2 type=ds$print()#> 9.5080 0.7729 #>