[Rcpp-devel] RcppArmadillo questions

Vinh Nguyen vinhdizzo at gmail.com
Thu May 27 17:24:58 CEST 2010

Two questions:

1.  The main difference when using RcppArmadillo and Rcpp is the
header declaration and the return type for the function right?
extern "C" SEXP fastLm(SEXP ys, SEXP Xs) {}
RcppArmadillo takes this extern stuff whereas Rcpp takes RcppExport?
RcppExport SEXP newRcppVectorExample(SEXP vector) {}

2.  From the example, if I update the elements of X or Xr, then both
are updated correct?  Because they are pointing to the same thing.
Just want to make sure.  I'm dealing with both since Xr is used to
deal with some R objects, and X is used to do matrix multiplication,
arma::mat X(Xr.begin(), n, k, false);       // reuses memory and
avoids extra copy
arma::colvec y(yr.begin(), yr.size(), false);


More information about the Rcpp-devel mailing list