Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Antonio Piccolboni
You have a point about push_back being amortized constant. In my code I do everything with Lists, which may explain why I needed to preallocate them. Unfortunately I forgot the motivation for using Lists instead of std:vector, which I must have considered at some point. In fact if you look at this

Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Tim Keitt
On Mon, May 4, 2015 at 2:37 PM, Dirk Eddelbuettel wrote: > > On 4 May 2015 at 14:23, Tim Keitt wrote: > | > | > | On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni < > anto...@piccolboni.info> > | wrote: > | > | Check here for something similar to Tim's solution that > preallocates all > |

Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Dirk Eddelbuettel
On 4 May 2015 at 14:23, Tim Keitt wrote: | | | On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni | wrote: | | Check here  for something similar to Tim's solution that preallocates all | vectors to avoid the costly push_back. Still needs the unlists in R, so | it's expensive in th

Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Tim Keitt
On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni wrote: > Check here > > for something similar to Tim's solution that preallocates all vectors to > avoid the costly push_back. Still needs the unlists in R, so it's exp

Re: [Rcpp-devel] Function arguments to R

2015-05-04 Thread soeren . vogel
Thanks for the hints and help. This is good news, since the work with Rcpp modules is very easy. Yet, meanwhile I managed to make it work using RcppExports (with the wrapper from the skeleton example). Works charmingly. Sören > On 04.05.2015, at 15:35, Dirk Eddelbuettel wrote: > > > On 3 May

Re: [Rcpp-devel] Function arguments to R

2015-05-04 Thread Dirk Eddelbuettel
On 3 May 2015 at 20:04, Dirk Eddelbuettel wrote: | Not to sound too flippant but if code and doc are amiss, you could fix either | the doc side, or the code side: | | i) don't document in Rd | | ii) export myfun() by adding // [[Rcpp::export]]above it | | There is simply no formal co

Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Jonathan Olmsted
Embedded link was < https://github.com/RevolutionAnalytics/rmr2/blob/master/pkg/src/t-list.cpp> On Mon, May 4, 2015 at 7:39 AM, Dirk Eddelbuettel wrote: > > On 3 May 2015 at 21:29, Antonio Piccolboni wrote: > | Check here for something similar to Tim's solution that preallocates all > > Please

Re: [Rcpp-devel] List of Lists to List of Vectors

2015-05-04 Thread Dirk Eddelbuettel
On 3 May 2015 at 21:29, Antonio Piccolboni wrote: | Check here  for something similar to Tim's solution that preallocates all Please resend with an explicit URL, the embedded link got lost. Remember, friends don't let friends send html email. Dirk | vectors to avoid the costly push_back. Still