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 2508, Thu Dec 24 09:47:57 2009 UTC revision 2517, Wed Feb 3 11:33:18 2010 UTC
# Line 9  Line 9 
9      options(error = recover, warn = 1)      options(error = recover, warn = 1)
10  } else if(FALSE) { ## MM @ testing  } else if(FALSE) { ## MM @ testing
11      options(error = recover, Matrix.verbose = TRUE, warn = 1)      options(error = recover, Matrix.verbose = TRUE, warn = 1)
12  } else options(Matrix.verbose = TRUE, warn = 1)  } else
13    options(Matrix.verbose = TRUE, warn = 1)
14    
15    
16  ### Dense Matrices  ### Dense Matrices
# Line 380  Line 381 
381    
382  ## Sub *Assignment* ---- now works (partially):  ## Sub *Assignment* ---- now works (partially):
383  mt0 <- mt  mt0 <- mt
384    nt <- as(mt, "nMatrix")
385  mt[1, 4] <- -99  mt[1, 4] <- -99
386  mt[2:3, 1:6] <- 0  mt[2:3, 1:6] <- 0
387  mt  mt
# Line 539  Line 541 
541  assert.EQ.mat(s2, m)# failed in 0.9975-8  assert.EQ.mat(s2, m)# failed in 0.9975-8
542    
543    
544  ## m[cbind(i,j)] <- value:  ## m[cbind(i,j)] <- value: (2-column matrix subassignment):
545  m.[ cbind(3:5, 1:3) ] <- 1:3  m.[ cbind(3:5, 1:3) ] <- 1:3
546  stopifnot(m.[3,1] == 1, m.[4,2] == 2)  stopifnot(m.[3,1] == 1, m.[4,2] == 2)
547    nt. <- nt ; nt[rbind(2:3, 3:4, c(3,3))] <- FALSE
548    s. <- m. ; m.[cbind(3:4,2:3)] <- 0 ## assigning 0 where there *is* 0 ..
549    stopifnot(identical(nt.,nt),       ## should not have changed
550              identical(s., m.))
551  x.x[ cbind(2:6, 2:6)] <- 12:16  x.x[ cbind(2:6, 2:6)] <- 12:16
552  stopifnot(isValid(x.x, "dsCMatrix"),  stopifnot(isValid(x.x, "dsCMatrix"),
553            12:16 == as.mat(x.x)[cbind(2:6, 2:6)])            12:16 == as.mat(x.x)[cbind(2:6, 2:6)])

Legend:
Removed from v.2508  
changed lines
  Added in v.2517

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