inst/tests/runit.innerproduct.R

library(Rcpp)
library(RUnit)

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

test.innerproduct <- function() {
   
   x <- runif(1000000)
   y <- runif(1000000)
   
   checkEquals(
      innerProduct(x, y), 
      parallelInnerProduct(x, y)
   )
   
}

Try the RcppParallel package in your browser

Any scripts or data that you put into this service are public.

RcppParallel documentation built on March 7, 2023, 7:05 p.m.