SCM

SCM Repository

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

Diff of /pkg/Matrix/tests/indexing.R

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

revision 3019, Sat Oct 11 20:51:53 2014 UTC revision 3020, Tue Oct 14 16:14:02 2014 UTC
# Line 73  Line 73 
73  showProc.time()  showProc.time()
74    
75  ## R-forge Matrix bug #2556: Subsetting a sparse matrix did remove  names(dimnames(.)) :  ## R-forge Matrix bug #2556: Subsetting a sparse matrix did remove  names(dimnames(.)) :
76  m <- matrix(1:16, 4, 4, dimnames=list(row=c('a','b','c','d'), col=c('x','y','z','w')))  m44 <- matrix(1:16, 4, 4, dimnames=list(row=c('a','b','c','d'), col=c('x','y','z','w')))
77  ## Dense matrix: ------------------------------------------  ## Dense matrix: ------------------------------------------
78  a <- Matrix(m)  a <- Matrix(m44)
79  identical(  identical(
80      dimnames(m[,FALSE, drop=FALSE]),      dimnames(m44[,FALSE, drop=FALSE]),
81      dimnames(a[,FALSE, drop=FALSE]))      dimnames(a[,FALSE, drop=FALSE]))
82  chk.ndn <- function(a, a0=m)  chk.ndn <- function(a, a0=m44)
83      stopifnot(identical(names(dimnames(a)), names(dimnames(a0))))      stopifnot(identical(names(dimnames(a)), names(dimnames(a0))))
84  i <- 1:2  i <- 1:2
85  chk.ndn(a[i,]); chk.ndn(a[i, i])  chk.ndn(a[i,]); chk.ndn(a[i, i])

Legend:
Removed from v.3019  
changed lines
  Added in v.3020

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