On 31 May 2013 at 18:00, Asis Hallab wrote: | Dear Rcpp Experts, | | in my current project I wanted to make use of OpenMP.
That works. | Unfortunately it seems Rcpp Objects cannot be used inside a block | executed in parallel. I think if you're careful it may work. You definitely do not want to call back or invoke R from multiple threads. But using Rcpp::NumericVector et al as "containers" may work. | Seg fault errors are the consequence, according to Dirk's reply in this thread | http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-February/003398.html | | Hence the need to convert | Rcpp::Vector to std::vector, | Rcpp::Matrix to std::vector< std::vector >, and | Rcpp::List to std::map< std::string, … > | | If I am not mistaken there's only support for the first conversion, | using the "as<> wrapper"; | is this correct? | What would be the most efficient way of converting | Rcpp::Matrix and Rcpp::List to the above types? | And how to efficiently convert them back into Rcpp-Objects? See above. Not clear that you "must" convert. And you could use Armadillo types as well. That gives you matrix types. As for Rcpp::List conversions it depends on what the actual list elements are. You can always write yourself custom converter functions to get started. Dirk -- Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com _______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
