File: stressTest.R

package info (click to toggle)
r-cran-foreach 1.3.0-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 628 kB
  • ctags: 4
  • sloc: sh: 76; makefile: 1
file content (9 lines) | stat: -rw-r--r-- 279 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
test01 <- function() {
  m <- 1000  # number of vectors
  for (n in c(100, 1000, 4000, 10000)) {
    r <- foreach(x=irnorm(n, mean=1000, count=m), .combine='+') %dopar% sqrt(x)
    checkTrue(is.atomic(r))
    checkTrue(inherits(r, 'numeric'))
    checkTrue(length(r) == n)
  }
}