Re: [Rcpp-devel] pass an R list as an argument and accessing elements of a list

2010-10-08 Thread Dirk Eddelbuettel
Hi Vinh, On 7 October 2010 at 21:41, Vinh Nguyen wrote: | I'll pass the R list as an SEXP object and then use Rcpp to access that list: | extern "C" SEXP MyCppFunc(..., SEXP _list){ | ... | Rcpp::List list(_list) ; | ... | } | | Is the above the proper way to pass a list the Rcpp way?  I've Yes

[Rcpp-devel] pass an R list as an argument and accessing elements of a list

2010-10-07 Thread Vinh Nguyen
Dear Rcpp List, My goal is to write a generic C++ optimizing function (call it "optim" in this email) based on the Newton-Raphson algorithm.  I will be passing into the optimizing function 4 arguments: 1.  (pointer to) a function, "f1", to be optimized, 2.  an initial value/vector, 3.  the remaini