[Rcpp-devel] as cube
Le 06/06/11 17:12, Richard Chandler a ?crit :
Hi,
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.
We have not implemented this.
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.
Maybe you can share what you have tried.
Thanks, Richard
Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr http://romain-francois.com |- http://bit.ly/kaSV6U : Stand up set at Up The Creek |- http://bit.ly/hdKhCy : Rcpp article in JSS `- http://bit.ly/elZJRJ : Montpellier Comedie Club - Avril 2011