Re: [Rcpp-devel] Accumulating results in an Rcpp::List

2010-06-19 Thread Romain Francois
Le 20/06/10 03:32, Douglas Bates a écrit : I want to return a named list of results from a call using Rcpp but the components of the list are accumulated in stages. At the C++ level i have a templated class that contains several data members that are themselves instances of classes. What I hav

Re: [Rcpp-devel] Accumulating results in an Rcpp::List

2010-06-19 Thread Dirk Eddelbuettel
On 19 June 2010 at 20:32, Douglas Bates wrote: | I want to return a named list of results from a call using Rcpp but | the components of the list are accumulated in stages. At the C++ | level i have a templated class that contains several data members that | are themselves instances of classes. |

[Rcpp-devel] Accumulating results in an Rcpp::List

2010-06-19 Thread Douglas Bates
I want to return a named list of results from a call using Rcpp but the components of the list are accumulated in stages. At the C++ level i have a templated class that contains several data members that are themselves instances of classes. What I have been doing is defining methods for each of t

Re: [Rcpp-devel] [R] Call by reference or suggest workaround

2010-06-19 Thread Romain Francois
( Reposting this here to Rcpp-devel since this might be of interest to the readers of this list. ) Le 19/06/10 16:32, Chidambaram Annamalai a écrit : > > I have written code to compute multi-indices in R [1] and due to the > recursive nature of the computation I need to pass around the *same* >

[Rcpp-devel] sugar: ifelse, pmin, pmax, lapply

2010-06-19 Thread Romain Francois
Hi, I've implemented lazy versions of them in Rcpp::sugar. Here are some examples: fx <- cxxfunction( signature( x = "integer" ), ' IntegerVector xx(x) ; List res = lapply( xx, seq_len ); return res ; ', plugin = "Rcpp" ) checkEquals( fx( 1:10 ), lapply( 1:10, seq_le