Running 'abind.R' [177s]
  Running 'apply.R' [178s]
  Running 'crossprod.R' [169s]
  Running 'dimgets.R' [0s]
  Running 'extract.R' [0s]
  Comparing 'extract.Rout' to 'extract.Rout.save' ... OK
  Running 'matrix.R' [169s]
  Running 'matrix_dimnames.R' [0s]
  Comparing 'matrix_dimnames.Rout' to 'matrix_dimnames.Rout.save' ... OK
  Running 'rollup.R' [160s]
  Running 'split.R' [156s]
  Running 'ssa_valid.R' [0s]
  Comparing 'ssa_valid.Rout' to 'ssa_valid.Rout.save' ... OK
  Running 'stm.R' [0s]
  Comparing 'stm.Rout' to 'stm.Rout.save' ... OK
  Running 'stm_apply.R' [0s]
  Comparing 'stm_apply.Rout' to 'stm_apply.Rout.save' ... OK
  Running 'stm_rollup.R' [0s]
  Comparing 'stm_rollup.Rout' to 'stm_rollup.Rout.save' ...113a114,115
> _row_tsums: reduced 1 (3) zeros
> _row_tsums: 0.000s [0.000s/0.000s]
  Running 'stm_subassign.R' [0s]
  Comparing 'stm_subassign.Rout' to 'stm_subassign.Rout.save' ... OK
  Running 'stm_ttcrossprod.R' [0s]
  Comparing 'stm_ttcrossprod.Rout' to 'stm_ttcrossprod.Rout.save' ... OK
  Running 'stm_valid.R' [0s]
  Comparing 'stm_valid.Rout' to 'stm_valid.Rout.save' ... OK
  Running 'stm_zeros.R' [0s]
  Comparing 'stm_zeros.Rout' to 'stm_zeros.Rout.save' ... OK
  Running 'subassign.R' [0s]
  Comparing 'subassign.Rout' to 'subassign.Rout.save' ... OK
  Running 'util.R' [163s]
Running the tests in 'tests/abind.R' failed.
Complete output:
  > ##
  > library("slam")
  > x <- matrix(1:12, 4, dimnames = list(NULL, B = 1:3))
  > s <- as.simple_sparse_array(x)
  > s
  A simple sparse array of dimension 4x3.
  > 
  > extend_simple_sparse_array(s,  0L)
  A simple sparse array of dimension 1x4x3.
  > extend_simple_sparse_array(s, -1L)  ## the same
  A simple sparse array of dimension 1x4x3.
  > extend_simple_sparse_array(s,  1L)
  A simple sparse array of dimension 4x1x3.
  > extend_simple_sparse_array(s,  2L)
  A simple sparse array of dimension 4x3x1.
  > extend_simple_sparse_array(s, -3L)  ## the same
  A simple sparse array of dimension 4x3x1.
  > 
  > extend_simple_sparse_array(s, c( 0L,  0L))
  A simple sparse array of dimension 1x1x4x3.
  > extend_simple_sparse_array(s, c(-3L, -3L))
  A simple sparse array of dimension 4x3x1x1.
  > 
  > ## automatic
  > z <- abind_simple_sparse_array(s, 1:3)
  > z
  A simple sparse array of dimension 5x3.
  > all.equal(as.array(z), rbind(x, 1:3))
  [1] "Attributes: < Component \"dimnames\": names for target but not for current >"
  > z <- abind_simple_sparse_array(1:4, s, MARGIN = 2L)
  > z
  A simple sparse array of dimension 4x4.
  > all.equal(as.array(z), cbind(1:4, x))
  [1] "Attributes: < Component \"dimnames\": names for target but not for current >"
  > 
  > abind_simple_sparse_array(1:3, array(2:4, c(1,3)), array(3:8, c(1,2,3)))
  A simple sparse array of dimension 2x2x3.
  > abind_simple_sparse_array(1:3, array(2:4, c(3,1)), array(3:8, c(3,2,1)), MARGIN = 3L) 
  A simple sparse array of dimension 3x2x2.
  > 
  > ## manual
  > abind_simple_sparse_array(1:3, 2:4)
  A simple sparse array of dimension 6.
  > abind_simple_sparse_array(1:3, 2:4, MARGIN = -1L)
  A simple sparse array of dimension 2x3.
  > abind_simple_sparse_array(1:3, 2:4, MARGIN = -2L)
  A simple sparse array of dimension 3x2.
  > 
  > ###
  > 
  > proc.time()
     user  system elapsed 
     0.15    0.04    0.18 
Running the tests in 'tests/apply.R' failed.
Complete output:
  > 
  > library("slam")
  > set.seed(201311)
  > 
  > ###
  > x <- matrix(rnorm(100), nrow = 20,
  +     dimnames =  list(1:20, LETTERS[1:5])
  + )
  > x[sample(100, 80)] <- 0
  > 
  > s <- as.simple_triplet_matrix(x)
  > s
  A 20x5 simple triplet matrix.
  > 
  > ##
  > identical(apply(x, 2L, var), colapply_simple_triplet_matrix(s, var))
  [1] TRUE
  > identical(apply(x, 1L, var), rowapply_simple_triplet_matrix(s, var))
  [1] TRUE
  > 
  > local({
  +     x[] <- as.complex(x)
  +     s   <- as.simple_triplet_matrix(x)
  +     identical(apply(x, 2L, var), colapply_simple_triplet_matrix(s, var))
  + })
  [1] TRUE
  > 
  > ##
  > k <- 1:2
  > z <- var(x[, k], x[, -k])
  > identical(z, crossapply_simple_triplet_matrix(s[, k], s[, -k], FUN = var))
  [1] TRUE
  > identical(z, crossapply_simple_triplet_matrix(x[, k], s[, -k], FUN = var))
  [1] TRUE
  > 
  > identical(z, 
  +     tcrossapply_simple_triplet_matrix(t(s[, k]), t(s[, -k]), FUN = var))
  [1] TRUE
  > identical(z, 
  +     tcrossapply_simple_triplet_matrix(t(x[, k]), t(s[, -k]), FUN = var))
  [1] TRUE
  > 
  > z <- var(x)
  > identical(z, crossapply_simple_triplet_matrix(s, FUN = var))
  [1] TRUE
  > 
  > ## null-dimensions
  > z <- var(x[, 0], x)
  > z
       A B C D E
  > all.equal(z, crossapply_simple_triplet_matrix(s[, 0], s, FUN = var))
  [1] TRUE
  > all.equal(z, crossapply_simple_triplet_matrix(x[, 0], s, FUN = var))
  [1] TRUE
  > 
  > try(crossapply_simple_triplet_matrix(x[, 0], s, FUN = var, use = "all.obs"))
  Error in FUN(x, y, ...) : 'x' is empty
  > 
  > z <- var(x, x[, 0])
  > z
   
  A
  B
  C
  D
  E
  > all.equal(z, crossapply_simple_triplet_matrix(s, s[, 0], FUN = var))
  [1] TRUE
  > all.equal(z, crossapply_simple_triplet_matrix(x, s[, 0], FUN = var))
  [1] TRUE
  > 
  > 
  > z <- var(x[, 0])
  > z
  <0 x 0 matrix>
  > all.equal(z, crossapply_simple_triplet_matrix(s[, 0], s[, 0], FUN = var))
  [1] TRUE
  > all.equal(z, crossapply_simple_triplet_matrix(x[, 0], s[, 0], FUN = var))
  [1] TRUE
  > 
  > all.equal(z, crossapply_simple_triplet_matrix(s[, 0], FUN = var))
  [1] TRUE
  > 
  > z <- var(x[0, ])
  > z
     A  B  C  D  E
  A NA NA NA NA NA
  B NA NA NA NA NA
  C NA NA NA NA NA
  D NA NA NA NA NA
  E NA NA NA NA NA
  > all.equal(z, crossapply_simple_triplet_matrix(s[0, ], s[0, ], FUN = var))
  [1] TRUE
  > all.equal(z, crossapply_simple_triplet_matrix(x[0, ], s[0, ], FUN = var))
  [1] TRUE
  > 
  > all.equal(z, crossapply_simple_triplet_matrix(s[0, ], FUN = var))
  [1] TRUE
  > 
  > ## non-scalar
  > z <- crossapply_simple_triplet_matrix(s, s, FUN = ">")
  > all.equal(z, crossapply_simple_triplet_matrix(x, s, FUN = ">"))
  [1] TRUE
  > 
  > all.equal(z[lower.tri(z)],
  +     crossapply_simple_triplet_matrix(s, FUN = ">")[lower.tri(z)])
  [1] TRUE
  > 
  > ###
  > 
  > proc.time()
     user  system elapsed 
     0.20    0.06    0.26 
Running the tests in 'tests/crossprod.R' failed.
Complete output:
  > 
  > library("slam")
  > 
  > ##
  > x <- matrix(c(1, 0, 0, 2, 1, 0), nrow = 3)
  > x
       [,1] [,2]
  [1,]    1    2
  [2,]    0    1
  [3,]    0    0
  > sx <- as.simple_triplet_matrix(x)
  > 
  > y <- matrix(1:6, nrow = 3)
  > sy <- as.simple_triplet_matrix(y)
  > 
  > identical(tcrossprod(x, y), tcrossprod_simple_triplet_matrix( x, sy))
  [1] TRUE
  > identical(tcrossprod(x),    tcrossprod_simple_triplet_matrix(sx))
  [1] TRUE
  > identical(tcrossprod(x, y), tcrossprod_simple_triplet_matrix(sx, sy))
  [1] TRUE
  > identical(tcrossprod(x, y), tcrossprod_simple_triplet_matrix(sx,  y))
  [1] TRUE
  > 
  > identical(crossprod(x, y),  crossprod_simple_triplet_matrix( x, sy))
  [1] TRUE
  > identical(crossprod(x),     crossprod_simple_triplet_matrix(sx))
  [1] TRUE
  > identical(crossprod(x, y),  crossprod_simple_triplet_matrix(sx, sy))
  [1] TRUE
  > identical(crossprod(x, y),  crossprod_simple_triplet_matrix(sx,  y))
  [1] TRUE
  > 
  > identical(crossprod(x, y),  matprod_simple_triplet_matrix(t( x), sy))
  [1] TRUE
  > identical(crossprod(x, y),  matprod_simple_triplet_matrix(t(sx), sy))
  [1] TRUE
  > identical(crossprod(x, y),  matprod_simple_triplet_matrix(t(sx),  y))
  [1] TRUE
  > 
  > ## Note that correctness under bailout is covered elsewhere.
  > 
  > ##
  > 
  > proc.time()
     user  system elapsed 
     0.17    0.09    0.23 
Running the tests in 'tests/matrix.R' failed.
Complete output:
  > 
  > library("slam")
  > 
  > s <- simple_triplet_diag_matrix(1, nrow = 3)
  > 
  > identical(as.matrix(s) * Inf, as.matrix(s * Inf))
  [1] TRUE
  > identical(as.matrix(s) *  NA, as.matrix(s *  NA_real_))
  [1] TRUE
  > 
  > identical(as.matrix(s) * c(Inf, NA, 0), as.matrix(s * c(Inf, NA, 0)))
  [1] TRUE
  > 
  > x1 <- matrix(c(1, Inf, 0, 1), nrow = 2)
  > x2 <- matrix(c(1, 0,  NA, 1), nrow = 2)
  > 
  > identical(x1 * x2, as.matrix(as.simple_triplet_matrix(x1) * x2))
  [1] TRUE
  > identical(x1 * x2, as.matrix(as.simple_triplet_matrix(x1) *
  +                              as.simple_triplet_matrix(x2)))
  [1] TRUE
  > 
  > x <- matrix(1, nrow = 3, ncol = 3)
  > identical(x * as.matrix(s), as.matrix(s * as.simple_triplet_matrix(x)))
  [1] TRUE
  > identical(x / as.matrix(s), as.matrix(as.simple_triplet_matrix(x) / s))
  [1] TRUE
  > 
  > identical(x * as.matrix(s), as.matrix(s * x))
  [1] TRUE
  > identical(x / as.matrix(s), as.matrix(x / s))
  [1] TRUE
  > 
  > ###
  > 
  > proc.time()
     user  system elapsed 
     0.20    0.03    0.21 
Running the tests in 'tests/rollup.R' failed.
Complete output:
  > 
  > ##
  > library("slam")
  > 
  > ##
  > x <- matrix(c(1, 0, 0, 2, 1, NA), nrow = 2,
  +             dimnames = list(A = 1:2, B = 1:3))
  > x
     B
  A   1 2  3
    1 1 0  1
    2 0 2 NA
  > 
  > a <- as.simple_sparse_array(x)
  > a
  A simple sparse array of dimension 2x3.
  > 
  > ##
  > z <- rollup(x, 2L, c(1,2,1), na.rm = TRUE)
  > z
     B
  A   1 2
    1 2 0
    2 0 2
  > identical(as.array(z),
  + 	  as.array(rollup(a, 2L, c(1,2,1), na.rm = TRUE)))
  [1] TRUE
  > identical(as.array(z),
  + 	  as.array(rollup(a, 2L, c(1,2,1), na.rm = TRUE, EXPAND = "dense")))
  [1] TRUE
  > identical(as.array(z),
  + 	  as.array(rollup(a, 2L, c(1,2,1), na.rm = TRUE, EXPAND = "all")))
  [1] TRUE
  > 
  > ##
  > z <- rollup(x, 2L, c(1,NA,1), na.rm = TRUE)
  > z
     B
  A   1
    1 2
    2 0
  > identical(as.array(z),
  +           as.array(rollup(a, 2L, c(1,NA,1), na.rm = TRUE)))
  [1] TRUE
  > identical(as.array(z),
  +           as.array(rollup(a, 2L, c(1,NA,1), na.rm = TRUE, EXPAND = "dense")))
  [1] TRUE
  > identical(as.array(z),
  +           as.array(rollup(a, 2L, c(1,NA,1), na.rm = TRUE, EXPAND = "all")))
  [1] TRUE
  > 
  > ##
  > z <- rollup(x, 2L, c(1,NA,1), na.rm = TRUE, DROP = TRUE)
  > identical(as.array(z),
  +           as.array(rollup(a, 2L, c(1,NA,1), na.rm = TRUE, DROP = TRUE)))
  [1] TRUE
  > 
  > 
  > ##
  > z <- rollup(x, 1:2, list(1:2, c(1,2,1)), na.rm = TRUE)
  > identical(as.array(z),
  + 	  as.array(rollup(a, 1:2, list(1:2, c(1,2,1)), na.rm = TRUE)))
  [1] TRUE
  > 
  > ##
  > s <- as.simple_triplet_matrix(a)
  > z <- rollup(x, 2L, FUN = min, na.rm = TRUE)
  > identical(as.matrix(z),
  + 	  as.matrix(rollup(s, 2L, FUN = min, na.rm = TRUE, EXPAND = "dense")))
  [1] TRUE
  > 
  > 
  > ## 2016/6
  > s <- simple_sparse_zero_array(dim = c(2, 3, 4))
  > z <- rollup(s, 1:2)
  > identical(as.array(z), 
  + 	  rollup(as.array(s), 1:2))
  [1] TRUE
  > 
  > ###
  > 
  > proc.time()
     user  system elapsed 
     0.20    0.03    0.21 
Running the tests in 'tests/split.R' failed.
Complete output:
  > library("slam")
  > 
  > m <- matrix(c(2, 5, 0, 8, 0,
  +               0, 0, 0, 0, 0,
  +               0, 0, 3, 2, 1),
  +             nr = 3, nc = 5, byrow = TRUE,
  +             dimnames = list(c("X", "Y", "Z"),
  +                             LETTERS[1 : 5]))
  > x <- as.simple_triplet_matrix(m)
  > 
  > identical(
  +     lapply(split(x, c(1, 2, 2)), as.matrix),
  + 	   split.data.frame(m, c(1, 2, 2))
  + )
  [1] TRUE
  > identical(
  +     lapply(split(x, c(1, NA, 2)), as.matrix),
  + 	   split.data.frame(m, c(1, NA, 2))
  + )
  [1] TRUE
  > 
  > local({
  +     colnames(x) <- NULL
  +     x[] <- 0
  +     identical(
  + 	lapply(split(x, c(1, 1, 2, 2, 3), MARGIN = 2), as.matrix),
  + 	lapply(split.data.frame(as.matrix(t(x)), c(1, 1, 2, 2, 3)), t)
  +     )
  + })
  [1] TRUE
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.18    0.09    0.26 
Running the tests in 'tests/util.R' failed.
Complete output:
  > 
  > library("slam")
  > 
  > ##
  > .Call(slam:::R_part_index, factor(rep(1L, 4L)))
  [1] 1 2 3 4
  attr(,"table")
  [1] 4
  > .Call(slam:::R_part_index, factor(1:4))
  [1] 1 1 1 1
  attr(,"table")
  [1] 1 1 1 1
  > .Call(slam:::R_part_index, factor(c(1L,2L,2L,1L)))
  [1] 1 1 2 2
  attr(,"table")
  [1] 2 2
  > .Call(slam:::R_part_index, factor(c(1L,2L,NA,1L)))
  [1]  1  1 NA  2
  attr(,"table")
  [1] 2 1
  > 
  > ##
  > i <- 1:27
  > x <- arrayInd(i, .dim = c(3L,3L,3L))
  > .Call(slam:::R_vector_index, c(3L,3L,3L), x)
   [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
  [26] 26 27
  > x[14L, 2L] <- NA
  > .Call(slam:::R_vector_index, c(3L,3L,3L), x)
   [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 NA 15 16 17 18 19 20 21 22 23 24 25
  [26] 26 27
  > 
  > ##
  > v <- c(1L,1L)
  > p <- matrix(c(1L,2L,3L, 2L,2L,2L), nrow = 2L, byrow = TRUE)
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, v, 2L)
  , , 1
  
       [,1] [,2] [,3]
  [1,]    0    0    0
  [2,]    0    0    0
  [3,]    0    0    0
  
  , , 2
  
       [,1] [,2] [,3]
  [1,]    0    0    0
  [2,]    0    1    0
  [3,]    0    0    0
  
  , , 3
  
       [,1] [,2] [,3]
  [1,]    0    0    0
  [2,]    0    0    0
  [3,]    0    0    0
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.logical(v), 2L)
  , , 1
  
        [,1]  [,2]  [,3]
  [1,] FALSE FALSE FALSE
  [2,] FALSE FALSE FALSE
  [3,] FALSE FALSE FALSE
  
  , , 2
  
        [,1]  [,2]  [,3]
  [1,] FALSE FALSE FALSE
  [2,] FALSE  TRUE FALSE
  [3,] FALSE FALSE FALSE
  
  , , 3
  
        [,1]  [,2]  [,3]
  [1,] FALSE FALSE FALSE
  [2,] FALSE FALSE FALSE
  [3,] FALSE FALSE FALSE
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.double(v), 2L)
  , , 1
  
       [,1] [,2] [,3]
  [1,]    0    0    0
  [2,]    0    0    0
  [3,]    0    0    0
  
  , , 2
  
       [,1] [,2] [,3]
  [1,]    0    0    0
  [2,]    0    1    0
  [3,]    0    0    0
  
  , , 3
  
       [,1] [,2] [,3]
  [1,]    0    0    0
  [2,]    0    0    0
  [3,]    0    0    0
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.raw(v), 2L)
  , , 1
  
       [,1] [,2] [,3]
  [1,]   00   00   00
  [2,]   00   00   00
  [3,]   00   00   00
  
  , , 2
  
       [,1] [,2] [,3]
  [1,]   00   00   00
  [2,]   00   01   00
  [3,]   00   00   00
  
  , , 3
  
       [,1] [,2] [,3]
  [1,]   00   00   00
  [2,]   00   00   00
  [3,]   00   00   00
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.complex(v), 2L)
  , , 1
  
       [,1] [,2] [,3]
  [1,] 0+0i 0+0i 0+0i
  [2,] 0+0i 0+0i 0+0i
  [3,] 0+0i 0+0i 0+0i
  
  , , 2
  
       [,1] [,2] [,3]
  [1,] 0+0i 0+0i 0+0i
  [2,] 0+0i 1+0i 0+0i
  [3,] 0+0i 0+0i 0+0i
  
  , , 3
  
       [,1] [,2] [,3]
  [1,] 0+0i 0+0i 0+0i
  [2,] 0+0i 0+0i 0+0i
  [3,] 0+0i 0+0i 0+0i
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.character(v), 2L)
  , , 1
  
       [,1] [,2] [,3]
  [1,] ""   ""   ""  
  [2,] ""   ""   ""  
  [3,] ""   ""   ""  
  
  , , 2
  
       [,1] [,2] [,3]
  [1,] ""   ""   ""  
  [2,] ""   "1"  ""  
  [3,] ""   ""   ""  
  
  , , 3
  
       [,1] [,2] [,3]
  [1,] ""   ""   ""  
  [2,] ""   ""   ""  
  [3,] ""   ""   ""  
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.list(v), 2L)
  , , 1
  
       [,1] [,2] [,3]
  [1,] NULL NULL NULL
  [2,] NULL NULL NULL
  [3,] NULL NULL NULL
  
  , , 2
  
       [,1] [,2] [,3]
  [1,] NULL NULL NULL
  [2,] NULL 1    NULL
  [3,] NULL NULL NULL
  
  , , 3
  
       [,1] [,2] [,3]
  [1,] NULL NULL NULL
  [2,] NULL NULL NULL
  [3,] NULL NULL NULL
  
  > .Call(slam:::R_ini_array, c(3L,3L,3L), p, as.expression(v), 2L)
  expression(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
      NULL, NULL, NULL, NULL, 1L, NULL, NULL, NULL, NULL, NULL, 
      NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
  > 
  > .Call(slam:::R_ini_array, 3L, c(1L,2L), c(1L,1L), 2L)
  [1] 0 1 0
  > 
  > .Call(slam:::R_split_col, array(c(1L,2L), c(2L, 2L)))
  [[1]]
  [1] 1 2
  
  [[2]]
  [1] 1 2
  
  > 
  > ##
  > x <- matrix(c(1L,1L,1L,1L,1L,2L,1L,3L,1L,2L), 
  + 	    ncol = 2, byrow = TRUE)
  > x
       [,1] [,2]
  [1,]    1    1
  [2,]    1    1
  [3,]    1    2
  [4,]    1    3
  [5,]    1    2
  > .Call(slam:::R_match_matrix, x, NULL, NULL)
  [[1]]
  [1] 1 1 2 3 2
  
  [[2]]
  [1] 1 3 4
  
  > .Call(slam:::R_match_matrix, x, x[1:3,], 0L)
  [[1]]
  [1] 1 1 2 3 2
  
  [[2]]
  [1] 1 1 2
  
  > .Call(slam:::R_match_matrix, x, matrix(0L, 0, 2), 0L)
  [[1]]
  [1] 1 1 2 3 2
  
  [[2]]
  integer(0)
  
  > 
  > 
  > ##
  > x <- matrix(c(1L,2L,2L,2L,NA,1L,NA,2L,NA,NA), 
  + 	    ncol = 2, byrow = TRUE)
  > x
       [,1] [,2]
  [1,]    1    2
  [2,]    2    2
  [3,]   NA    1
  [4,]   NA    2
  [5,]   NA   NA
  > .Call(slam:::R_all_row, x > 1L, FALSE)
  [1] FALSE  TRUE    NA    NA    NA
  > .Call(slam:::R_all_row, x > 1L, TRUE)
  [1] FALSE  TRUE FALSE  TRUE  TRUE
  > 
  > ###
  > 
  > proc.time()
     user  system elapsed 
     0.21    0.01    0.21