Skip to content
Prev 1809 / 10988 Next

[Rcpp-devel] passing function

Thanks.

  I did not understand this code

  # C++ source code to operate on function and vector
  cpp<- '
   int n = as<int>(N);
   NumericVector numvec(xvec) ;
   Function f(fun) ;
   for( int i=0; i<n; i++){
    numvec = f( numvec ) ;
   }
   return numvec ;

  I see that f is a Function object but what is fun? And why the looping over numvec rather than elements of numvec? Finally, how to use RcppArmadillo to do the C++ computations on the R function?

  Best.
On 1/25/2011 12:17 PM, Dirk Eddelbuettel wrote: