File: runit.sum.R

package info (click to toggle)
r-cran-rcppparallel 5.1.7%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 544 kB
  • sloc: cpp: 1,852; sh: 19; makefile: 11
file content (15 lines) | stat: -rw-r--r-- 240 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

library(Rcpp)
library(RUnit)

sourceCpp(system.file("tests/cpp/sum.cpp", package = "RcppParallel"))

test.sum <- function() {
   
   v <- as.numeric(c(1:10000000))
   
   checkEquals(
      vectorSum(v), 
      parallelVectorSum(v)
   )
}