Suppose we have this program where we have started and ended with SEXP and written out the as and wrap conversions to make them explicit.
How many times is the data copied? Does as copy the underlying data? Does wrap? Is it copied elsewhere? Which file in the source code would one look to determine this? If it does copy the data is there some way to tell as and wrap to just point to it to avoid copying? #include <RcppArmadillo.h> // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::export]] SEXP test(SEXP v) { arma::vec va = Rcpp::as<arma::vec>(v); SEXP vs = Rcpp::wrap(va); return vs; } # run it from R sourceCpp("test.cpp") test(c(1.2, 1.3, 1.4)) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel