SCM

SCM Repository

[matrix] Diff of /pkg/tests/other-pkgs.R
ViewVC logotype

Diff of /pkg/tests/other-pkgs.R

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

revision 1764, Mon Feb 5 08:14:19 2007 UTC revision 1765, Mon Feb 5 16:32:04 2007 UTC
# Line 2  Line 2 
2    
3  library(Matrix)  library(Matrix)
4    
5  pkgRversion <- function(pkgname)  source(system.file("test-tools.R", package = "Matrix"))# identical3() etc
     substring(packageDescription(pkgname)[["Built"]], 3,5)  
6    
7  MatrixRversion <- pkgRversion("Matrix")  MatrixRversion <- pkgRversion("Matrix")
8    
# Line 94  Line 93 
93            validObject(At.csr <- as.matrix.csr(t(A))),            validObject(At.csr <- as.matrix.csr(t(A))),
94            identical(At.csr, t(A.csr)),            identical(At.csr, t(A.csr)),
95            identical(A, as.matrix(A.csr)),            identical(A, as.matrix(A.csr)),
96            identical(M, as(A.csr, "dgCMatrix")),                    identical(M, as(A.csr, "CsparseMatrix")),
97            identical(t(M), as(At.csr, "dgCMatrix"))                    identical(t(M), as(At.csr, "CsparseMatrix"))
98            )            )
99    
100  ## TODO: More tests; in particular for triplets !          ## More tests, notably for triplets
101            A.coo <- as.matrix.coo(A)
102            str(T  <- as(M, "TsparseMatrix")) # has 'j' sorted
103            str(T. <- as(A.coo, "TsparseMatrix")) # has 'i' sorted
104    
105            T3 <- as(as(T, "matrix.coo"), "Matrix") # dgT
106            M3 <- as(as(M, "matrix.csr"), "Matrix") # dgC
107            M4 <- as(as(M, "matrix.csc"), "Matrix") # dgC
108            M5 <- as(as(M, "matrix.coo"), "Matrix") # dgT
109            uniqT <- Matrix:::uniqTsparse
110            stopifnot(identical4(uniqT(T), uniqT(T.), uniqT(T3), uniqT(M5)),
111                      identical3(M, M3, M4))
112    
113  if(FALSE) # detaching the package gives an error (.GenericTable ...)          if(FALSE) # detaching the package gives error ".GenericTable" not found
114  detach("package:SparseM")  detach("package:SparseM")
115    
116      }      }

Legend:
Removed from v.1764  
changed lines
  Added in v.1765

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