Re: [Rcpp-devel] Working with arma::cube

2013-03-05 Thread Dirk Eddelbuettel
On 6 March 2013 at 03:22, alexios ghalanos wrote: | Try this: | | library(RcppArmadillo) | library(inline) | if( require( RcppArmadillo ) ){ | fx <- cxxfunction( signature(x = "vector", n = "integer") , ' | Rcpp::NumericVector XX(x); | Rcpp::IntegerVector dim(n);

Re: [Rcpp-devel] Working with arma::cube

2013-03-05 Thread alexios ghalanos
Try this: library(RcppArmadillo) library(inline) if( require( RcppArmadillo ) ){ fx <- cxxfunction( signature(x = "vector", n = "integer") , ' Rcpp::NumericVector XX(x); Rcpp::IntegerVector dim(n); arma::cube AY(XX.begin(), dim[0], dim[1], d

Re: [Rcpp-devel] Working with arma::cube

2013-03-05 Thread Dirk Eddelbuettel
On 6 March 2013 at 00:50, Silkworth,David J. wrote: | I am helping a student build some R code in Rcpp for his first time. He is | working with 3-dimensional arrays, so I am hopeful to be working with | arma::cube objects. | | When I simply try to bring the array in as an argument I can?t seem

[Rcpp-devel] Working with arma::cube

2013-03-05 Thread Silkworth,David J.
I am helping a student build some R code in Rcpp for his first time. He is working with 3-dimensional arrays, so I am hopeful to be working with arma::cube objects. When I simply try to bring the array in as an argument I can't seem to use the same as<[TEMPLATE]> construction as other objects.