[Rcpp-devel] vector < RawVector > to RawMatrix [like do.call(rbind, mylist)]
romain at r-enthusiasts.com
Fri Jan 10 11:22:26 CET 2014
If you wrap your std::vector<RawVector> you get a list of raw vectors, and this does not do deep copies of the RawVector.
If you want a RawMatrix, you have to make copies as all the matrix data is contiguous in memory.
Perhaps you can change things around, first create the matrix and then fill it instead of creating a vector of RawVector.
Le 10 janv. 2014 à 10:51, "Sven E. Templer" <sven.templer at gmail.com> a écrit :
> reading a matrix from a file and transforming it to raw format, I get a "std::vector< Rcpp::RawVector >", how can I wrap it to "Rcpp::RawMatrix". Right now I use "Rcpp::List::create(vector< RawVector >)" and use do.call(rbind, mylist) in R (does this do a copy to the memory?). Is there a way to wrap it in C++?
> Thank you for your help,
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel