SCM

SCM Repository

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

Diff of /pkg/tests/indexing.Rout.save

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 1  Line 1 
1    
2  R version 2.6.2 Patched (2008-02-21 r44561)  R version 2.6.2 Patched (2008-03-02 r44664)
3  Copyright (C) 2008 The R Foundation for Statistical Computing  Copyright (C) 2008 The R Foundation for Statistical Computing
4  ISBN 3-900051-07-0  ISBN 3-900051-07-0
5    
# Line 427  Line 427 
427      sparseMatrix#numeric      sparseMatrix#numeric
428    
429  >  >
 > ### Diagonal -- Sparse:  
430  > m0 <- Diagonal(5)  > m0 <- Diagonal(5)
431    > stopifnot(identical(m0[2,], m0[,2]),
432    +         identical(m0[,1], c(1,0,0,0,0)))
433    > ### Diagonal -- Sparse:
434  > (m1 <- as(m0, "sparseMatrix"))  # dtTMatrix  > (m1 <- as(m0, "sparseMatrix"))  # dtTMatrix
435  5 x 5 sparse Matrix of class "dtTMatrix"  5 x 5 sparse Matrix of class "dtTMatrix"
436    
# Line 459  Line 461 
461  +                     Matrix:::uniqTsparse(as(m2[, c(4,2)], "TsparseMatrix")))  +                     Matrix:::uniqTsparse(as(m2[, c(4,2)], "TsparseMatrix")))
462  +           )## failed in 0.9975-11  +           )## failed in 0.9975-11
463  >  >
464    > (uTr <- new("dtTMatrix", Dim = c(3L,3L), diag="U"))
465    3 x 3 sparse Matrix of class "dtTMatrix"
466    
467    [1,] 1 . .
468    [2,] . 1 .
469    [3,] . . 1
470    > uTr[1,] <- 0
471    > assert.EQ.mat(T, cbind(0, rbind(0,diag(2))))
472    >
473  > M <- m0; M[1,] <- 0  > M <- m0; M[1,] <- 0
474  > stopifnot(identical(M, Diagonal(x=c(0, rep(1,4)))))  > stopifnot(identical(M, Diagonal(x=c(0, rep(1,4)))))
475  > M <- m0; M[,3] <- 3 ; M ; stopifnot(is(M, "sparseMatrix"), M[,3] == 3)  > M <- m0; M[,3] <- 3 ; M ; stopifnot(is(M, "sparseMatrix"), M[,3] == 3)
# Line 989  Line 1000 
1000  +           dim(R[FALSE, FALSE]) == c(0,0))  +           dim(R[FALSE, FALSE]) == c(0,0))
1001  >  >
1002  > cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''  > cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''
1003  Time elapsed:  9.297 0.087 9.486 0 0  Time elapsed:  9.741 0.121 9.941 0 0
1004  >  >

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