SCM

SCM Repository

[matrix] View of /pkg/tests/simple.R
ViewVC logotype

View of /pkg/tests/simple.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 873 - (download) (annotate)
Sat Aug 27 21:26:23 2005 UTC (14 years ago) by maechler
File size: 461 byte(s)
some new ones
library(Matrix)

set.seed(123)
mm <- Matrix(rnorm(500 * 150), nc = 150)
stopifnot(validObject(mm))
xpx <- crossprod(mm)# alters mm !
stopifnot(validObject(mm),
          validObject(xpx))
str(mm) # 'dge*"
str(xpx)# 'dpo*"
xpy <- crossprod(mm, rnorm(500))
res <- solve(xpx, xpy)
str(xpx)# now with Cholesky factor
stopifnot(validObject(xpx),
          validObject(xpy),
          validObject(res))
stopifnot(all.equal(xpx %*% res, xpy, tol= 1e-12))

proc.time()

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge