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 2175, Wed Apr 23 11:23:50 2008 UTC revision 2186, Mon Apr 28 12:37:01 2008 UTC
# Line 500  Line 500 
500            !is(T3[,2, drop=FALSE], "triangularMatrix")            !is(T3[,2, drop=FALSE], "triangularMatrix")
501            )            )
502    
503    (T6 <- as(as(kronecker(Matrix(c(0,0,1,0),2,2), t(T3)), "lMatrix"),
504              "triangularMatrix"))
505    T6[1:4, -(1:3)] # failed (trying to coerce back to ltTMatrix)
506    stopifnot(identical(T6[1:4, -(1:3)][2:3, -3],
507                        spMatrix(2,2, i=c(1,2,2), j=c(1,1,2), x=rep(TRUE,3))))
508    
509  M <- Diagonal(4); M[1,2] <- 2  M <- Diagonal(4); M[1,2] <- 2
510  M. <- as(M, "CsparseMatrix")  M. <- as(M, "CsparseMatrix")
511  (R <- as(M., "RsparseMatrix"))  (R <- as(M., "RsparseMatrix"))
# Line 523  Line 529 
529  Sys.setlocale("LC_COLLATE", "C")# to keep ls() reproducible  Sys.setlocale("LC_COLLATE", "C")# to keep ls() reproducible
530  for(nm in ls()) if(is(.m <- get(nm), "Matrix")) {  for(nm in ls()) if(is(.m <- get(nm), "Matrix")) {
531      cat(nm, "\n")      cat(nm, "\n")
532      checkMatrix(.m, doCoerce2 = !is(.m, "RsparseMatrix"),      checkMatrix(.m, verbose = FALSE)
                 verbose = FALSE)  
533  }  }
534  cat('Time elapsed: ', proc.time() - .pt,'\n') # "stats"  cat('Time elapsed: ', proc.time() - .pt,'\n') # "stats"
535    

Legend:
Removed from v.2175  
changed lines
  Added in v.2186

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