Thanks for the reply, Xian.<br><br>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.<br>Very often I will need Armadillo and will be "using namespace arma;". Maybe I should keep using arma:: too, according to Darren's advice.<br>
<br>Zhongyi<br><br><div class="gmail_quote">On Wed, Aug 31, 2011 at 6:05 AM, Christian Gunning <span dir="ltr"><<a href="mailto:xian@unm.edu">xian@unm.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Wed, Aug 31, 2011 at 3:00 AM,<br>
<<a href="mailto:rcpp-devel-request@r-forge.wu-wien.ac.at">rcpp-devel-request@r-forge.wu-wien.ac.at</a>> wrote:<br>
><br>
> Rcpp::NumericVector x = as<Rcpp::NumericVector>(x_);<br>
> std::vector<double> x = as< std::vector<double> >(x_);<br>
<br>
</div>Nice clarification of what's going on under the hood, Darren.<br>
For the first case, the above is synonymous with:<br>
<br>
Rcpp::NumericVector x(x_);<br>
<br>
If you want a deep copy, you can use:<br>
<br>
Rcpp::NumericVector x(clone(x_));<br>
<br>
See the quickref pdf for examples<br>
(<a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf%29.." target="_blank">http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf)..</a>..<br>
there, "using namespace Rcpp;" is implied throughout unless otherwise<br>
noted.<br>
<br>
-xian<br>
<font color="#888888"><br>
--<br>
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!<br>
</font></blockquote></div><br>