[Rcpp-devel] as cube

Richard Chandler richard.chandlers at gmail.com
Mon Jun 6 17:12:59 CEST 2011


I would like to do something like this:

src.cube <- "
    arma::cube a = as<arma::cube>(aR);
    return wrap(a);
fx <- cxxfunction(signature(aR="array"), src.cube, plugin="RcppArmadillo")
fx(array(1:27, c(3,3,3)))

But it fails. Can someone suggest a good alternative? I tried to create the
cube on the C++ side and use .fill() to fill it with a NumericVector, but
this did not work either.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110606/23b9925b/attachment.htm>

More information about the Rcpp-devel mailing list