SCM

SCM Repository

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

Diff of /pkg/tests/indexing.R

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

revision 1724, Sat Jan 13 21:06:51 2007 UTC revision 1725, Wed Jan 17 08:01:10 2007 UTC
# Line 273  Line 273 
273  validObject(dm <- kronecker(Diagonal(2), sy3))  validObject(dm <- kronecker(Diagonal(2), sy3))
274  (s2 <- as(dm, "sparseMatrix"))  (s2 <- as(dm, "sparseMatrix"))
275  validObject(st <- as(s2, "TsparseMatrix"))  validObject(st <- as(s2, "TsparseMatrix"))
276    stopifnot(is(s2, "symmetricMatrix"),
277              is(st, "symmetricMatrix"))
278  validObject(s.32  <- st[1:3,1:2]) ## 3 x 2 - and *not* dsTMatrix  validObject(s.32  <- st[1:3,1:2]) ## 3 x 2 - and *not* dsTMatrix
279  validObject(s2.32 <- s2[1:3,1:2])  validObject(s2.32 <- s2[1:3,1:2])
280  I <- c(1,4:3)  I <- c(1,4:3)
# Line 325  Line 327 
327  validObject(x.x)  validObject(x.x)
328  stopifnot(class(x.x) == "dsCMatrix",  stopifnot(class(x.x) == "dsCMatrix",
329            12:16 == as.mat(x.x)[cbind(2:6, 2:6)])            12:16 == as.mat(x.x)[cbind(2:6, 2:6)])
330    (ne1 <- (mc - m.) != 0)
331    stopifnot(identical(ne1, 0 != abs(mc - m.)))
332    (ge <- m. >= mc) # contains "=" -> result is dense
333    ne. <- mc != m.  # was wrong (+ warning)
334    stopifnot(identical(!(m. < mc), m. >= mc),
335              identical(m. < mc, as(!ge, "sparseMatrix")),
336              identical(ne., Matrix:::drop0(ne1)))
337    
338    
339  cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''  cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''

Legend:
Removed from v.1724  
changed lines
  Added in v.1725

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