SCM

SCM Repository

[matrix] Annotation of /pkg/tests/group-methods.R
ViewVC logotype

Annotation of /pkg/tests/group-methods.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 573 - (view) (download)

1 : maechler 573 ### Testing the group methods
2 :    
3 :     library(Matrix)
4 :     set.seed(2001)
5 :    
6 :     mm <- Matrix(rnorm(50 * 7), nc = 7)
7 :     xpx <- crossprod(mm)# -> "factors" in mm !
8 :     round(xpx, 3) # works via "Math2"
9 :    
10 :     y <- rnorm(nrow(mm))
11 :     xpy <- crossprod(mm, y)
12 :     res <- solve(xpx, xpy)
13 :     signif(res, 4) # 7 x 1 Matrix
14 :    
15 :     ## exp(): component wise
16 :     signif(dd <- (expm(xpx) - exp(xpx)) / 1e34, 3)# 7 x 7
17 :    
18 :     stopifnot(validObject(xpx),
19 :     validObject(xpy),
20 :     validObject(dd))
21 :    
22 :     proc.time() # for ``statistical reasons''
23 :    
24 :    

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