Re: [Rcpp-devel] passing function

2011-01-26 Thread Dirk Eddelbuettel
On 26 January 2011 at 08:30, Davor Cubranic wrote: | On 2011-01-26, at 7:38 AM, Dirk Eddelbuettel wrote: | | > cpp <- ' | > int n = as(N); | > NumericVector numvec(xvec) ; | > Function f(fun) ; | > for( int i=0; i numvec = f( numvec ) ; | > } | > return numvec

Re: [Rcpp-devel] passing function

2011-01-26 Thread Davor Cubranic
On 2011-01-26, at 7:38 AM, Dirk Eddelbuettel wrote: > cpp <- ' > int n = as(N); > NumericVector numvec(xvec) ; > Function f(fun) ; > for( int i=0; i numvec = f( numvec ) ; > } > return numvec ; > ' > > # create a C++ function > funx <- cfunction(s

Re: [Rcpp-devel] passing function

2011-01-26 Thread Dirk Eddelbuettel
Dear Sid, On 26 January 2011 at 09:23, Siddhartha Chib wrote: | Thanks. | | I did not understand this code | | # C++ source code to operate on function and vector | cpp <- ' | int n = as(N); | NumericVector numvec(xvec) ; | Function f(fun) ; | for( int i=0; i(N); NumericVecto

Re: [Rcpp-devel] passing function

2011-01-26 Thread Siddhartha Chib
Thanks. I did not understand this code # C++ source code to operate on function and vector cpp<- ' int n = as(N); NumericVector numvec(xvec) ; Function f(fun) ; for( int i=0; i On 25 January 2011 at 12:01, Siddhartha Chib wrote: | Is it possible to pass a user defined function | writt

Re: [Rcpp-devel] passing function

2011-01-26 Thread Siddhartha Chib
Thanks. I did not understand this code # C++ source code to operate on function and vector cpp<- ' int n = as(N); NumericVector numvec(xvec) ; Function f(fun) ; for( int i=0; i On 25 January 2011 at 12:01, Siddhartha Chib wrote: | Is it possible to pass a user defined function | writt

Re: [Rcpp-devel] passing function

2011-01-25 Thread Dirk Eddelbuettel
On 25 January 2011 at 12:01, Siddhartha Chib wrote: | Is it possible to pass a user defined function | written in R for use in rccparma. For example, is it possible to have a (What is rccparma?) | function | SEXP myfunction(SEXP g, SEXP a) | where g is a function object and a is a | matrix, the

[Rcpp-devel] passing function

2011-01-25 Thread Siddhartha Chib
Is it possible to pass a user defined function written in R for use in rccparma. For example, is it possible to have a function SEXP myfunction(SEXP g, SEXP a) where g is a function object and a is a matrix, the argument of g? Thanks in advance. ___ R