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

Dirk Eddelbuettel edd at debian.org
Mon May 4 21:37:57 CEST 2015


On 4 May 2015 at 14:23, Tim Keitt wrote:
| 
| 
| On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni <antonio at piccolboni.info>
| 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 that dimension, the number of lists in the output.
| 
| 
| I may have a way around the unlist part; still needs testing.

Keep us posted.
 
| push_back is amortized constant so only a little costly.

But going from std::list to SEXP is one full copy.  Not so bad in the grand
scheme of things.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list