search for: tcall_c

Displaying 1 result from an estimated 1 matches for "tcall_c".

2011 Jul 19
1
Measuring and comparing .C and .Call overhead
...with each call rm(list = ls()) system("R CMD SHLIB mvMultiply.cc") dyn.load("mvMultiply.so") m <- 100 #number of rows in matrix A n <- 10 #number of columns in matrix A (= number of rows in vector x) N <- 1000000 A <- runif(m*n) x <- runif(n) # measuring .Call tCall_c <- 0.0 t1 <- proc.time()[3] for (i in 1:N) { tCall_c <- tCall_c + .Call("matvecMultiply", as.double(A), as.double(x)) } tCall_R <- proc.time()[3] - t1 cat(".Call - Time measured in R: ", round(tCall_R,2), "sec\n") cat(".Call - Time measured in C++: &q...