File: runit.innerproduct.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 (17 lines) | stat: -rw-r--r-- 286 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

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)
   )
   
}