Re: [Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion

2016-09-22 Thread Dirk Eddelbuettel
ta 2016 23:09 | Vastaanottaja: Dirk Eddelbuettel | Kopio: Helske, Jouni; rcpp-devel@lists.r-forge.r-project.org | Aihe: Re: [Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion | | Oh, and it should work the same for cube types: | | R> cppFunction("void test2(arm

Re: [Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion

2016-09-22 Thread Helske, Jouni
r-forge.r-project.org Aihe: Re: [Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion Oh, and it should work the same for cube types: R> cppFunction("void test2(arma::cube & x) { x(0,0,0) = 0.5; }", R> depends="RcppArmadillo") R> v <

Re: [Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion

2016-09-22 Thread Dirk Eddelbuettel
Oh, and it should work the same for cube types: R> cppFunction("void test2(arma::cube & x) { x(0,0,0) = 0.5; }", R> depends="RcppArmadillo") R> v <- array(sqrt(1:8), c(2, 2, 2)) R> v , , 1 [,1][,2] [1,] 1.0 1.73205 [2,] 1.41421 2.0 , , 2 [,1][,2]

Re: [Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion

2016-09-22 Thread Dirk Eddelbuettel
Hi Jouni, On 22 September 2016 at 19:39, Helske, Jouni wrote: | Hi, | | I was recently hunting down a bug in my code, and stumbled upon a slightly | incoherent behaviour in Rcpp/RcppArmadillo. In my real application I have a | class which data members are initialized in initialization list from

[Rcpp-devel] Initializing Armadillo vec/cube from NumericVector using as conversion

2016-09-22 Thread Helske, Jouni
Hi, I was recently hunting down a bug in my code, and stumbled upon a slightly incoherent behaviour in Rcpp/RcppArmadillo. In my real application I have a class which data members are initialized in initialization list from the Rcpp List using as. For example, I have a member y which I initiali