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 1828, Wed Apr 25 22:23:31 2007 UTC revision 1829, Thu Apr 26 06:35:20 2007 UTC
# Line 87  Line 87 
87  j <- c(2:4, 4:3)  j <- c(2:4, 4:3)
88  assert.EQ.mat(mC[i,], mm[i,])  assert.EQ.mat(mC[i,], mm[i,])
89  assert.EQ.mat(mC[,j], mm[,j])  assert.EQ.mat(mC[,j], mm[,j])
90  if(FALSE) ## FIXME  assert.EQ.mat(mC[i, 2:1], mm[i, 2:1])
91    assert.EQ.mat(mC[c(4,1), j], mm[c(4,1), j])
92    assert.EQ.mat(mC[i,j], mm[i,j])
93    set.seed(7)
94    for(n in 1:50) {
95        i <- sample(sample(nrow(mC), 7), 20, replace = TRUE)
96        j <- sample(sample(ncol(mC), 6), 17, replace = TRUE)
97  assert.EQ.mat(mC[i,j], mm[i,j])  assert.EQ.mat(mC[i,j], mm[i,j])
98    }
99    ## symmetric index of symmetric matrix 000 not yet  ok
100    m. <- mC; m.[, c(2, 7:12)] <- 0
101    validObject(S <- crossprod(m.) %% 100)
102    ss <- as(S, "matrix")
103    T <- as(S, "TsparseMatrix")
104    i <- c(4:2,7) ;  assert.EQ.mat(T[i,i], ss[i,i])
105    i <- c(7:5, 2:4);assert.EQ.mat(T[i,i], ss[i,i])
106    if(FALSE) ## FIXME
107    assert.EQ.mat(T[j,j], ss[j,j])
108    
109    
110  stopifnot(all.equal(mC[,3], mm[,3]),  stopifnot(all.equal(mC[,3], mm[,3]),
111            identical(mC[ij], mm[ij]))            identical(mC[ij], mm[ij]))

Legend:
Removed from v.1828  
changed lines
  Added in v.1829

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