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 1724, Sat Jan 13 21:06:51 2007 UTC revision 2192, Thu May 1 08:21:47 2008 UTC
# Line 4  Line 4 
4    
5  source(system.file("test-tools.R", package = "Matrix"))# identical3() etc  source(system.file("test-tools.R", package = "Matrix"))# identical3() etc
6    
7    if(interactive()) {
8        options(error = recover)
9    } else options(verbose = TRUE)# to show message()s
10    
11  ### Dense Matrices  ### Dense Matrices
12    
13  m <- Matrix(1:28 +0, nrow = 7)  m <- Matrix(1:28 +0, nrow = 7)
# Line 13  Line 17 
17            identical(m[2, 3:4], c(16,23))) # simple numeric of length 2            identical(m[2, 3:4], c(16,23))) # simple numeric of length 2
18    
19  m[2, 3:4, drop=FALSE] # sub matrix of class 'dgeMatrix'  m[2, 3:4, drop=FALSE] # sub matrix of class 'dgeMatrix'
20  m[-(4:7), 3:4]        # dito; the upper right corner of 'm'  m[-(4:7), 3:4]        # ditto; the upper right corner of 'm'
21    
22  ## rows or columns only:  ## rows or columns only:
23  m[1,]     # first row, as simple numeric vector  m[1,]     # first row, as simple numeric vector
# Line 32  Line 36 
36  mn <- m  mn <- m
37  dimnames(mn) <- list(paste("r",letters[1:nrow(mn)],sep=""),  dimnames(mn) <- list(paste("r",letters[1:nrow(mn)],sep=""),
38                       LETTERS[1:ncol(mn)])                       LETTERS[1:ncol(mn)])
39    checkMatrix(mn)
40  mn["rd", "D"]  mn["rd", "D"]
41  stopifnot(identical(mn["rc", "D"], mn[3,4]), mn[3,4] == 24,  stopifnot(identical(mn["rc", "D"], mn[3,4]), mn[3,4] == 24,
42            identical(mn[, "A"], mn[,1]), mn[,1] == 1:7,            identical(mn[, "A"], mn[,1]), mn[,1] == 1:7,
# Line 81  Line 86 
86  mC[1:2,]  mC[1:2,]
87  mC[7,  drop = FALSE]  mC[7,  drop = FALSE]
88  assert.EQ.mat(mC[1:2,], mm[1:2,])  assert.EQ.mat(mC[1:2,], mm[1:2,])
89    
90    ## *repeated* (aka 'duplicated') indices - did not work at all ...
91    i <- rep(8:10,2)
92    j <- c(2:4, 4:3)
93    assert.EQ.mat(mC[i,], mm[i,])
94    assert.EQ.mat(mC[,j], mm[,j])
95    assert.EQ.mat(mC[i, 2:1], mm[i, 2:1])
96    assert.EQ.mat(mC[c(4,1,2:1), j], mm[c(4,1,2:1), j])
97    assert.EQ.mat(mC[i,j], mm[i,j])
98    set.seed(7)
99    for(n in 1:50) {
100        i <- sample(sample(nrow(mC), 7), 20, replace = TRUE)
101        j <- sample(sample(ncol(mC), 6), 17, replace = TRUE)
102        assert.EQ.mat(mC[i,j], mm[i,j])
103    }
104    
105    ##---- Symmetric indexing of symmetric Matrix ----------
106    m. <- mC; m.[, c(2, 7:12)] <- 0
107    validObject(S <- crossprod(add.simpleDimnames(m.) %% 100))
108    ss <- as(S, "matrix")
109    T <- as(S, "TsparseMatrix")
110    ## non-repeated indices:
111    i <- c(7:5, 2:4);assert.EQ.mat(T[i,i], ss[i,i])
112    N <- nrow(T)
113    set.seed(11)
114    for(n in 1:50) {
115        i <- sample(N, max(2, sample(N,1)), replace = FALSE)
116        validObject(Tii <- T[i,i])
117        stopifnot(is(Tii, "dsTMatrix"), # remained symmetric Tsparse
118                  identical(t(Tii), t(T)[i,i]))
119        assert.EQ.mat(Tii, ss[i,i])
120    }
121    
122    ## repeated ones ``the challenge'' (to do smartly):
123    j <- c(4, 4, 9, 12, 9, 4, 17, 3, 18, 4, 12, 18, 4, 9)
124    assert.EQ.mat(T[j,j], ss[j,j])
125    ## and another two sets  (a, A) &  (a., A.) :
126    a <- matrix(0, 6,6)
127    a[upper.tri(a)] <- (utr <- c(2, 0,-1, 0,0,5, 7,0,0,0, 0,0,-2,0,8))
128    ta <- t(a); ta[upper.tri(a)] <- utr; a <- t(ta)
129    diag(a) <- c(0,3,0,4,6,0)
130    A <- as(Matrix(a), "TsparseMatrix")
131    A. <- A
132    diag(A.) <- 10 * (1:6)
133    a. <- as(A., "matrix")
134    ## More testing {this was not working for a long time..}
135    set.seed(1)
136    for(n in 1:100) {
137        i <- sample(1:nrow(A), 3+2*rpois(1, lam=3), replace=TRUE)
138        Aii  <- A[i,i]
139        A.ii <- A.[i,i]
140        stopifnot(class(Aii) == class(A),
141                  class(A.ii) == class(A.))
142        assert.EQ.mat(Aii , a [i,i])
143        assert.EQ.mat(A.ii, a.[i,i])
144        assert.EQ.mat(T[i,i], ss[i,i])
145    }
146    
147    
148  stopifnot(all.equal(mC[,3], mm[,3]),  stopifnot(all.equal(mC[,3], mm[,3]),
149            identical(mC[ij], mm[ij]))            identical(mC[ij], mm[ij]))
150  assert.EQ.mat(mC[7, , drop=FALSE], mm[7, , drop=FALSE])  assert.EQ.mat(mC[7, , drop=FALSE], mm[7, , drop=FALSE])
# Line 117  Line 181 
181  lx.x <- as(x.x, "lsCMatrix") # FALSE only for "structural" 0  lx.x <- as(x.x, "lsCMatrix") # FALSE only for "structural" 0
182  (l10 <- lx.x[1:10, 1:10])# "lsC"  (l10 <- lx.x[1:10, 1:10])# "lsC"
183  (l3 <-  lx.x[1:3, ])  (l3 <-  lx.x[1:3, ])
184  m.x <- as(x.x, "matrix")  m.x <- as.mat(x.x) # as.mat() *drops* (NULL,NULL) dimnames
185  stopifnot(class(l10) == "lsCMatrix", # symmetric indexing -> symmetric !  stopifnot(class(l10) == "lsCMatrix", # symmetric indexing -> symmetric !
186            identical(as.mat(lx.x), m.x != 0),            identical(as.mat(lx.x), m.x != 0),
187            identical(as.logical(lx.x), as.logical(m.x)),            identical(as.logical(lx.x), as.logical(m.x)),
# Line 125  Line 189 
189            identical(as.mat(l3 ), m.x[1:3, ] != 0)            identical(as.mat(l3 ), m.x[1:3, ] != 0)
190            )            )
191    
192    ##-- Sub*assignment* with repeated / duplicated index:
193    A <- Matrix(0,4,3) ; A[c(1,2,1), 2] <- 1 ; A
194    B <- A;              B[c(1,2,1), 2] <- 1:3; B; B. <- B
195    B.[3,] <- rbind(4:2)
196    diag(B.) <- 10 * diag(B.)
197    C <- B.; C[,2] <- C[,2];  C[1,] <- C[1,]; C[2:3,2:1] <- C[2:3,2:1]
198    stopifnot(identical(unname(as.matrix(A)),
199                        local({a <- matrix(0,4,3); a[c(1,2,1), 2] <-  1 ; a})),
200              identical(unname(as.matrix(B)),
201                        local({a <- matrix(0,4,3); a[c(1,2,1), 2] <- 1:3; a})),
202              identical(C, drop0(B.)))
203    
204    
205  ## used to fail  ## used to fail
206  n <- 5 ## or much larger  n <- 5 ## or much larger
207  sm <- new("dsTMatrix", i=as.integer(1),j=as.integer(1),  sm <- new("dsTMatrix", i=as.integer(1),j=as.integer(1),
# Line 138  Line 215 
215            all(sm[,-(1:3)] == 0)            all(sm[,-(1:3)] == 0)
216            )            )
217    
 ### Diagonal -- Sparse:  
218  m0 <- Diagonal(5)  m0 <- Diagonal(5)
219    stopifnot(identical(m0[2,], m0[,2]),
220              identical(m0[,1], c(1,0,0,0,0)))
221    ### Diagonal -- Sparse:
222  (m1 <- as(m0, "sparseMatrix"))  # dtTMatrix  (m1 <- as(m0, "sparseMatrix"))  # dtTMatrix
223  (m2 <- as(m0, "CsparseMatrix")) # dtCMatrix (with an irrelevant warning)  (m2 <- as(m0, "CsparseMatrix")) # dtCMatrix (with an irrelevant warning)
224    m1g <- as(m1, "generalMatrix")
225    stopifnot(is(m1g, "dgTMatrix"))
226    assert.EQ.mat(m2[1:3,],    diag(5)[1:3,])
227    assert.EQ.mat(m2[,c(4,1)], diag(5)[,c(4,1)])
228    stopifnot(identical(m2[1:3,], as(m1[1:3,], "CsparseMatrix")),
229              identical(Matrix:::uniqTsparse(m1[, c(4,2)]),
230                        Matrix:::uniqTsparse(as(m2[, c(4,2)], "TsparseMatrix")))
231              )## failed in 0.9975-11
232    
233    (uTr <- new("dtTMatrix", Dim = c(3L,3L), diag="U"))
234    uTr[1,] <- 0
235    assert.EQ.mat(uTr, cbind(0, rbind(0,diag(2))))
236    
237  M <- m0; M[1,] <- 0  M <- m0; M[1,] <- 0
238  stopifnot(identical(M, Diagonal(x=c(0, rep(1,4)))))  stopifnot(identical(M, Diagonal(x=c(0, rep(1,4)))))
239  M <- m0; M[,3] <- 3 ; M ; stopifnot(is(M, "sparseMatrix"), M[,3] == 3)  M <- m0; M[,3] <- 3 ; M ; stopifnot(is(M, "sparseMatrix"), M[,3] == 3)
240  validObject(M)  checkMatrix(M)
241  M <- m0; M[1:3, 3] <- 0 ;M  M <- m0; M[1:3, 3] <- 0 ;M
242  T <- m0; T[1:3, 3] <- 10  T <- m0; T[1:3, 3] <- 10
243  stopifnot(identical(M, Diagonal(x=c(1,1, 0, 1,1))),  stopifnot(identical(M, Diagonal(x=c(1,1, 0, 1,1))),
# Line 154  Line 245 
245    
246  M <- m1; M[1,] <- 0 ; M ; assert.EQ.mat(M, diag(c(0,rep(1,4))), tol=0)  M <- m1; M[1,] <- 0 ; M ; assert.EQ.mat(M, diag(c(0,rep(1,4))), tol=0)
247  M <- m1; M[,3] <- 3 ; stopifnot(is(M,"sparseMatrix"), M[,3] == 3)  M <- m1; M[,3] <- 3 ; stopifnot(is(M,"sparseMatrix"), M[,3] == 3)
248  validObject(M)  checkMatrix(M)
249  M <- m1; M[1:3, 3] <- 0 ;M  M <- m1; M[1:3, 3] <- 0 ;M
250  assert.EQ.mat(M, diag(c(1,1, 0, 1,1)), tol=0)  assert.EQ.mat(M, diag(c(1,1, 0, 1,1)), tol=0)
251  T <- m1; T[1:3, 3] <- 10; validObject(T)  T <- m1; T[1:3, 3] <- 10; checkMatrix(T)
252  stopifnot(is(T, "dtTMatrix"), identical(T[,3], c(10,10,10,0,0)))  stopifnot(is(T, "dtTMatrix"), identical(T[,3], c(10,10,10,0,0)))
253    
254  M <- m2; M[1,] <- 0 ; M ; assert.EQ.mat(M, diag(c(0,rep(1,4))), tol=0)  M <- m2; M[1,] <- 0 ; M ; assert.EQ.mat(M, diag(c(0,rep(1,4))), tol=0)
255  M <- m2; M[,3] <- 3 ; stopifnot(is(M,"sparseMatrix"), M[,3] == 3)  M <- m2; M[,3] <- 3 ; stopifnot(is(M,"sparseMatrix"), M[,3] == 3)
256  validObject(M)  checkMatrix(M)
257  M <- m2; M[1:3, 3] <- 0 ;M  M <- m2; M[1:3, 3] <- 0 ;M
258  assert.EQ.mat(M, diag(c(1,1, 0, 1,1)), tol=0)  assert.EQ.mat(M, diag(c(1,1, 0, 1,1)), tol=0)
259  T <- m2; T[1:3, 3] <- 10; validObject(T)  T <- m2; T[1:3, 3] <- 10; checkMatrix(T)
260  stopifnot(is(T, "dtCMatrix"), identical(T[,3], c(10,10,10,0,0)))  stopifnot(is(T, "dtCMatrix"), identical(T[,3], c(10,10,10,0,0)))
261    
262    
263    ## "Vector indices" -------------------
264    D <- Diagonal(6)
265    M <- as(D,"dgeMatrix")
266    m <- as(D,"matrix")
267    s <- as(D,"TsparseMatrix")
268    S <- as(s,"CsparseMatrix")
269    i <- c(3,1,6); v <- c(10,15,20)
270    ## (logical,value) which both are recycled:
271    L <- c(TRUE, rep(FALSE,8)) ; z <- c(50,99)
272    
273    ## vector subassignment, both with integer & logical
274    ## these now work correctly {though not very efficiently; hence warnings}
275    m[i] <- v # the role model: only first column is affected
276    M[i] <- v; assert.EQ.mat(M,m) # dge
277    D[i] <- v; assert.EQ.mat(D,m) # ddi -> dtT -> dgT
278    s[i] <- v; assert.EQ.mat(s,m) # dtT -> dgT
279    S[i] <- v; assert.EQ.mat(S,m); S # dtC -> dtT -> dgT -> dgC
280    ## logical
281    m[L] <- z
282    M[L] <- z; assert.EQ.mat(M,m)
283    D[L] <- z; assert.EQ.mat(D,m)
284    s[L] <- z; assert.EQ.mat(s,m)
285    S[L] <- z; assert.EQ.mat(S,m) ; S
286    
287    ## indexing [i]  vs  [i,] --- now ok
288    stopifnot(identical4(m[i], M[i], D[i], s[i]), identical(s[i],S[i]))
289    stopifnot(identical4(m[L], M[L], D[L], s[L]), identical(s[L],S[L]))
290    assert.EQ.mat(D[i,], m[i,])
291    assert.EQ.mat(M[i,], m[i,])
292    assert.EQ.mat(s[i,], m[i,])
293    assert.EQ.mat(S[i,], m[i,])
294    
295    assert.EQ.mat(D[,i], m[,i])
296    assert.EQ.mat(M[,i], m[,i])
297    assert.EQ.mat(s[,i], m[,i])
298    assert.EQ.mat(S[,i], m[,i])
299    
300    
301  ## --- negative indices ----------  ## --- negative indices ----------
302  mc <- mC[1:5, 1:7]  mc <- mC[1:5, 1:7]
303  mt <- mT[1:5, 1:7]  mt <- mT[1:5, 1:7]
# Line 215  Line 344 
344    
345  mt[c(2,4), ] <- 0; stopifnot(as(mt[c(2,4), ],"matrix") == 0)  mt[c(2,4), ] <- 0; stopifnot(as(mt[c(2,4), ],"matrix") == 0)
346  mt[2:3, 4:7] <- 33  mt[2:3, 4:7] <- 33
347  validObject(mt)  checkMatrix(mt)
348  mt  mt
349    
350  mc[1,4] <- -99 ; stopifnot(mc[1,4] == -99)  mc[1,4] <- -99 ; stopifnot(mc[1,4] == -99)
# Line 250  Line 379 
379  mc # no longer has non-structural zeros  mc # no longer has non-structural zeros
380  mc[ii, jj] <- 1:6  mc[ii, jj] <- 1:6
381  mc[c(2,5), c(3,5)] <- 3.2  mc[c(2,5), c(3,5)] <- 3.2
382  validObject(mc)  checkMatrix(mc)
383  m. <- mc  m. <- mc
384  mc[4,] <- 0  mc[4,] <- 0
385  mc  mc
386    
387    S <- as(Diagonal(5),"sparseMatrix")
388  H <- Hilbert(9)  H <- Hilbert(9)
389  Hc <- as(round(H, 3), "dsCMatrix")# a sparse matrix with no 0 ...  Hc <- as(round(H, 3), "dsCMatrix")# a sparse matrix with no 0 ...
390  (trH <- tril(Hc[1:5, 1:5]))  (trH <- tril(Hc[1:5, 1:5]))
391  stopifnot(is(trH, "triangularMatrix"), trH@uplo == "L")  stopifnot(is(trH, "triangularMatrix"), trH@uplo == "L",
392              is(S, "triangularMatrix"))
393    
394    ## triangular assignment
395    ## the slick (but inefficient in case of sparse!) way to assign sub-diagonals:
396    ## equivalent to tmp <- `diag<-`(S[,-1], -2:1); S[,-1] <- tmp
397    ## which dispatches to (x="TsparseMatrix", i="missing",j="index", value="replValue")
398    diag(S[,-1]) <- -2:1 # used to give a wrong warning
399    S <- as(S,"triangularMatrix")
400    assert.EQ.mat(S, local({s <- diag(5); diag(s[,-1]) <- -2:1; s}))
401    
402    trH[c(1:2,4), c(2:3,5)] <- 0 # gave an *error* upto Jan.2008
403    trH[ lower.tri(trH) ] <- 0   # ditto, because of callNextMethod()
404    
405    m <- Matrix(0+1:28, nrow = 4)
406    m[-3,c(2,4:5,7)] <- m[ 3, 1:4] <- m[1:3, 6] <- 0
407    mT <- as(m, "dgTMatrix")
408    stopifnot(identical(mT[lower.tri(mT)],
409                        m [lower.tri(m) ]))
410    lM <- upper.tri(mT, diag=TRUE)
411    mT[lM] <- 0
412     m[lM] <- 0
413    assert.EQ.mat(mT, as(m,"matrix"))
414    mT[lM] <- -1:0
415     m[lM] <- -1:0
416    assert.EQ.mat(mT, as(m,"matrix"))
417    (mT <- drop0(mT))
418    
419  i <- c(1:2, 4, 6:7); j <- c(2:4,6)  i <- c(1:2, 4, 6:7); j <- c(2:4,6)
420  H[i,j] <- 0  H[i,j] <- 0
# Line 270  Line 426 
426    
427  ## an example that failed for a long time  ## an example that failed for a long time
428  sy3 <- new("dsyMatrix", Dim = as.integer(c(2, 2)), x = c(14, -1, 2, -7))  sy3 <- new("dsyMatrix", Dim = as.integer(c(2, 2)), x = c(14, -1, 2, -7))
429  validObject(dm <- kronecker(Diagonal(2), sy3))  checkMatrix(dm <- kronecker(Diagonal(2), sy3))# now sparse with new kronecker
430    dm <- Matrix(as.matrix(dm))# -> "dsyMatrix"
431  (s2 <- as(dm, "sparseMatrix"))  (s2 <- as(dm, "sparseMatrix"))
432  validObject(st <- as(s2, "TsparseMatrix"))  checkMatrix(st <- as(s2, "TsparseMatrix"))
433  validObject(s.32  <- st[1:3,1:2]) ## 3 x 2 - and *not* dsTMatrix  stopifnot(is(s2, "symmetricMatrix"),
434  validObject(s2.32 <- s2[1:3,1:2])            is(st, "symmetricMatrix"))
435    checkMatrix(s.32  <- st[1:3,1:2]) ## 3 x 2 - and *not* dsTMatrix
436    checkMatrix(s2.32 <- s2[1:3,1:2])
437  I <- c(1,4:3)  I <- c(1,4:3)
438  stopifnot(is(s2.32, "generalMatrix"),  stopifnot(is(s2.32, "generalMatrix"),
439            is(s.32,  "generalMatrix"),            is(s.32,  "generalMatrix"),
# Line 289  Line 448 
448    
449  ## now sub-assign  and check for consistency  ## now sub-assign  and check for consistency
450  ## symmetric subassign should keep symmetry  ## symmetric subassign should keep symmetry
451  st[I,I] <- 0; validObject(st); stopifnot(is(st,"symmetricMatrix"))  st[I,I] <- 0; checkMatrix(st); stopifnot(is(st,"symmetricMatrix"))
452  s2[I,I] <- 0; validObject(s2); stopifnot(is(s2,"symmetricMatrix"))  s2[I,I] <- 0; checkMatrix(s2); stopifnot(is(s2,"symmetricMatrix"))
453  ##  ##
454  m <- as.mat(st)  m <- as.mat(st)
455   m[2:1,2:1] <- 4:1   m[2:1,2:1] <- 4:1
# Line 322  Line 481 
481  m.[ cbind(3:5, 1:3) ] <- 1:3  m.[ cbind(3:5, 1:3) ] <- 1:3
482  stopifnot(m.[3,1] == 1, m.[4,2] == 2)  stopifnot(m.[3,1] == 1, m.[4,2] == 2)
483  x.x[ cbind(2:6, 2:6)] <- 12:16  x.x[ cbind(2:6, 2:6)] <- 12:16
484  validObject(x.x)  stopifnot(isValid(x.x, "dsCMatrix"),
 stopifnot(class(x.x) == "dsCMatrix",  
485            12:16 == as.mat(x.x)[cbind(2:6, 2:6)])            12:16 == as.mat(x.x)[cbind(2:6, 2:6)])
486    (ne1 <- (mc - m.) != 0)
487    stopifnot(identical(ne1, 0 != abs(mc - m.)))
488    (ge <- m. >= mc) # contains "=" -> result is dense
489    ne. <- mc != m.  # was wrong (+ warning)
490    stopifnot(identical(!(m. < mc), m. >= mc),
491              identical(m. < mc, as(!ge, "sparseMatrix")),
492              identical(ne., drop0(ne1)))
493    
494    d6 <- Diagonal(6)
495    ii <- c(1:2, 4:5)
496    d6[cbind(ii,ii)] <- 7*ii
497    stopifnot(is(d6, "ddiMatrix"), identical(d6, Diagonal(x=c(7*1:2,1,7*4:5,1))))
498    
499    (M3 <- Matrix(upper.tri(matrix(, 3, 3)))) # ltC; indexing used to fail
500    T3 <- as(M3, "TsparseMatrix")
501    stopifnot(identical(drop(M3), M3),
502              identical4(drop(M3[,2, drop = FALSE]), M3[,2, drop = TRUE],
503                         drop(T3[,2, drop = FALSE]), T3[,2, drop = TRUE]),
504              is(T3, "triangularMatrix"),
505              !is(T3[,2, drop=FALSE], "triangularMatrix")
506              )
507    
508    (T6 <- as(as(kronecker(Matrix(c(0,0,1,0),2,2), t(T3)), "lMatrix"),
509              "triangularMatrix"))
510    T6[1:4, -(1:3)] # failed (trying to coerce back to ltTMatrix)
511    stopifnot(identical(T6[1:4, -(1:3)][2:3, -3],
512                        spMatrix(2,2, i=c(1,2,2), j=c(1,1,2), x=rep(TRUE,3))))
513    
514    M <- Diagonal(4); M[1,2] <- 2
515    M. <- as(M, "CsparseMatrix")
516    (R <- as(M., "RsparseMatrix"))
517    (Ms <- symmpart(M.))
518    Rs <- as(Ms, "RsparseMatrix")
519    stopifnot(isValid(M, "triangularMatrix"),
520              isValid(M.,"triangularMatrix"),
521              isValid(Ms, "dsCMatrix"),
522              isValid(R,  "dtRMatrix"),
523              isValid(Rs, "dsRMatrix") )
524    stopifnot(dim(M[2:3, FALSE]) == c(2,0),
525              dim(R[2:3, FALSE]) == c(2,0),
526              identical(M [2:3,TRUE], M [2:3,]),
527              identical(M.[2:3,TRUE], M.[2:3,]),
528              identical(R [2:3,TRUE], R [2:3,]),
529              dim(R[FALSE, FALSE]) == c(0,0))
530    
531    cat('Time elapsed: ', (.pt <- proc.time()),'\n') # "stats"
532    ##
533    cat("checkMatrix() of all: \n---------\n")
534    Sys.setlocale("LC_COLLATE", "C")# to keep ls() reproducible
535    for(nm in ls()) if(is(.m <- get(nm), "Matrix")) {
536        cat(nm, "\n")
537        checkMatrix(.m, verbose = FALSE)
538    }
539    cat('Time elapsed: ', proc.time() - .pt,'\n') # "stats"
540    
541    if(!interactive()) warnings()
542    
 cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''  

Legend:
Removed from v.1724  
changed lines
  Added in v.2192

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