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 1835, Fri May 11 10:41:21 2007 UTC revision 2062, Sat Sep 1 21:06:52 2007 UTC
# Line 186  Line 186 
186    
187  ##-- Sub*assignment* with repeated / duplicated index:  ##-- Sub*assignment* with repeated / duplicated index:
188  A <- Matrix(0,4,3) ; A[c(1,2,1), 2] <- 1 ; A  A <- Matrix(0,4,3) ; A[c(1,2,1), 2] <- 1 ; A
189  B <- A;              B[c(1,2,1), 2] <- 1:3; B  B <- A;              B[c(1,2,1), 2] <- 1:3; B; B. <- B
190    B.[3,] <- rbind(4:2)
191    diag(B.) <- 10 * diag(B.)
192    C <- B.; C[,2] <- C[,2];  C[1,] <- C[1,]; C[2:3,2:1] <- C[2:3,2:1]
193  stopifnot(identical(unname(as.matrix(A)),  stopifnot(identical(unname(as.matrix(A)),
194                      local({a <- matrix(0,4,3); a[c(1,2,1), 2] <-  1 ; a})),                      local({a <- matrix(0,4,3); a[c(1,2,1), 2] <-  1 ; a})),
195            identical(unname(as.matrix(B)),            identical(unname(as.matrix(B)),
196                      local({a <- matrix(0,4,3); a[c(1,2,1), 2] <- 1:3; a})))                      local({a <- matrix(0,4,3); a[c(1,2,1), 2] <- 1:3; a})),
197              identical(C, drop0(B.)))
198    
199    
200  ## used to fail  ## used to fail

Legend:
Removed from v.1835  
changed lines
  Added in v.2062

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