Displaying 1 result from an estimated 1 matches for "veca_len".
2011 Nov 17
3
.Call in R
...w my question is, if I am going to do the same thing in R using .Call.
How can I achieve it in a more efficient way (i.e. less computation time
compared with pure R code above.). My c code (called "change_vecA.c") using
.Call is like this:
SEXP change_vecA(SEXP vecA){
int i,vecA_len;
double sum,*res_ptr,*vecR_ptr,*vecA_ptr;
vecA_ptr=REAL(vecA);
vecA_len=length(vecA);
SEXP res_vec,vecR;
PROTECT(res_vec=allocVector(REALSXP, vec_len));
PROTECT(vecR=allocVector(REALSXP, vec_len));
res_ptr=REAL(res_vec);
vecR...