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

pkg/tests/graph.R revision 1326, Wed Jul 19 14:58:26 2006 UTC pkg/tests/other-pkgs.R revision 1327, Fri Jul 21 06:43:31 2006 UTC
# Line 1  Line 1 
1  if(!require(graph))  ####--------- Test interfaces to other non-standard Packages ---------------
2      q('no')  
3    ###-- 1)  'graph' (from Bioconductor) ---------------------------
4    ###-- ==  =======                     ---------------------------
5    if(require(graph)) {
6    
7  if(packageDescription("graph")$Version <= "1.10.2") {  if(packageDescription("graph")$Version <= "1.10.2") {
8      ## graph 1.10.x for x <= 2  had too much problems in  as(<graph>, "matrix")      ## graph 1.10.x for x <= 2  had too much problems in  as(<graph>, "matrix")
9      cat("Version of 'graph' is too old --- no tests done here!\n")      cat("Version of 'graph' is too old --- no tests done here!\n")
# Line 9  Line 13 
13  ## else do things  ## else do things
14    
15  library(Matrix)  library(Matrix)
 if(FALSE)## for ease of developer:  
     library(Matrix, lib="/u/maechler/R/Pkgs/Matrix.Rcheck")  
16    
17  example("graphNEL-class", echo = FALSE)  example("graphNEL-class", echo = FALSE)
18  nodes(gR)  nodes(gR)
# Line 36  Line 38 
38      gmgU <- as(sgU, "graphNEL")      gmgU <- as(sgU, "graphNEL")
39  }  }
40    
41    }## end{graph}
42    
43    ###-- 2)  'SparseM' ---------------------------------------------
44    ###-- ==  ========  ---------------------------------------------
45    
46    if(require(SparseM)) {
47    
48    set.seed(1)
49    a <- round(rnorm(5*4), 2)
50    a[abs(a) < 0.7] <- 0
51    A <- matrix(a,5,4)
52    print(M <- Matrix(A))
53    stopifnot(
54              validObject(A.csr <- as.matrix.csr(A)),
55              validObject(At.csr <- as.matrix.csr(t(A))),
56              identical(At.csr, t(A.csr)),
57              identical(A, as.matrix(A.csr)),
58              identical(M, as(A.csr, "dgCMatrix")),
59              identical(t(M), as(At.csr, "dgCMatrix"))
60              )
61    
62    ## TODO: More tests; in particular for triplets !
63    
64    }## end{SparseM}

Legend:
Removed from v.1326  
changed lines
  Added in v.1327

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