<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi, </div><div><br></div><div>If you wrap your std::vector<RawVector> you get a list of raw vectors, and this does not do deep copies of the RawVector. </div><div><br></div><div>If you want a RawMatrix, you have to make copies as all the matrix data is contiguous in memory. </div><div><br></div><div>Perhaps you can change things around, first create the matrix and then fill it instead of creating a vector of RawVector. </div><div><br></div><div>Romain</div><div><br>Le 10 janv. 2014 à 10:51, "Sven E. Templer" <<a href="mailto:sven.templer@gmail.com">sven.templer@gmail.com</a>> a écrit :<br><br></div><blockquote type="cite"><div><div dir="ltr"><font face="courier new, monospace">Hello,</font><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">reading a matrix from a file and transforming it to raw format, I get a </font><span style="font-family:'courier new',monospace">"std::vector< Rcpp::RawVector >", </span><span style="font-family:'courier new',monospace">how can I wrap it</span><span style="font-family:'courier new',monospace"> to "Rcpp::</span><span style="font-family:'courier new',monospace">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++?</span></div>
<div><br></div><div><font face="courier new, monospace">Thank you for your help,</font></div><div><font face="courier new, monospace">Sven.</font></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Rcpp-devel mailing list</span><br><span><a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a></span><br><span><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></span></div></blockquote></body></html>