inst/tests/testSVD.R

require(XRJulia)
ep = XRJulia::RJulia()
set.seed(773)
mm = matrix(rnorm(12),4,3)
mj = ep$Send(mm)
svdJ <- JuliaFunction("svdfact")
sj <- svdJ(mj)
## ep$Command('show(toR(%s))',mj)
sr <- svd(mm)
all.equal(sr$d,ep$Eval("%s.S",sj,.get=TRUE))
all.equal(sr$u,ep$Eval("%s.U",sj,.get=TRUE))
all.equal(t(sr$v),ep$Eval("%s.Vt",sj,.get=TRUE))

Try the XRJulia package in your browser

Any scripts or data that you put into this service are public.

XRJulia documentation built on May 6, 2019, 1:01 a.m.