Thanks for the reply, Xian. The quick reference is quite helpful. Most of the time, I use 'inline' to create R functions and I think 'inline' includes Rcpp.h which specifies the namespace Rcpp. Very often I will need Armadillo and will be "using namespace arma;". Maybe I should keep using arma:: too, according to Darren's advice.
Zhongyi On Wed, Aug 31, 2011 at 6:05 AM, Christian Gunning <x...@unm.edu> wrote: > On Wed, Aug 31, 2011 at 3:00 AM, > <rcpp-devel-requ...@r-forge.wu-wien.ac.at> wrote: > > > > Rcpp::NumericVector x = as<Rcpp::NumericVector>(x_); > > std::vector<double> x = as< std::vector<double> >(x_); > > Nice clarification of what's going on under the hood, Darren. > For the first case, the above is synonymous with: > > Rcpp::NumericVector x(x_); > > If you want a deep copy, you can use: > > Rcpp::NumericVector x(clone(x_)); > > See the quickref pdf for examples > ( > http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf).. > .. > there, "using namespace Rcpp;" is implied throughout unless otherwise > noted. > > -xian > > -- > A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama! >
_______________________________________________ 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