SCM

SCM Repository

[matrix] Diff of /pkg/tests/matprod.R
ViewVC logotype

Diff of /pkg/tests/matprod.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2119, Tue Mar 4 21:44:04 2008 UTC revision 2120, Tue Mar 4 21:44:41 2008 UTC
# Line 88  Line 88 
88            is(im, "dtCMatrix"), is(itm, "dtCMatrix"), is(iitm, "dtCMatrix"),            is(im, "dtCMatrix"), is(itm, "dtCMatrix"), is(iitm, "dtCMatrix"),
89            del < 1e-15)            del < 1e-15)
90    
91    ## *unit* triangular :
92    t1 <- new("dtTMatrix", x= c(3,7), i= 0:1, j=3:2, Dim= as.integer(c(4,4)))
93    ## from  0-diagonal to unit-diagonal {low-level step}:
94    tu <- t1 ; tu@diag <- "U"
95    cu <- as(tu, "dtCMatrix")
96    cu2 <- Diagonal(4) + Matrix(c(rep(0,9),14,0,0,6,0,0,0), 4,4)
97    stopifnot(all(cu %*% cu == cu2),# was wrong for ver. <= 0.999375-4
98    ## FIXME: cu %*% cu should be unit triangular
99              identical(crossprod(cu), Matrix(crossprod(as.matrix(cu)),sparse=TRUE)),
100              identical(tcrossprod(cu), Matrix(tcrossprod(as.matrix(cu)),sparse=TRUE)) )
101    
102    
103  data(KNex); mm <- KNex$mm  data(KNex); mm <- KNex$mm
104  M <- mm[1:500, 1:200]  M <- mm[1:500, 1:200]

Legend:
Removed from v.2119  
changed lines
  Added in v.2120

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