search for: exectime_sxp

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

2011 Jul 19
1
Measuring and comparing .C and .Call overhead
...d("mvMultiply.so") -------------------------------- #code file: myMultiply.cc #include <Rinternals.h> #include <R.h> #include &lt;sys/time.h&gt; extern "C" { SEXP matvecMultiply(SEXP A, SEXP x) { timeval time1, time2; gettimeofday(&time1, NULL); SEXP execTime_sxp; PROTECT(execTime_sxp = allocVector(REALSXP, 1)); double *execTime; execTime = REAL(execTime_sxp); double *rA = REAL(A), *rx = REAL(x), *ry; int n = length(x); int m = length(A) / n; SEXP y; PROTECT(y = allocVector(REALSXP, m)); ry = REAL(y); for (int i = 0; i < m; i++) { ry[i] = 0.0;...