Skip to content
Prev 7481 / 10988 Next

[Rcpp-devel] Broken conversion from R-type integer to uvec after update to newer Rcpp version

Got it:

R> cppFunction("arma::uvec venelin(const arma::uvec v) { return(v); }", depends="RcppArmadillo")
R> venelin(1:3)
           [,1]
[1,]          0
[2,] 1072693248
[3,]          0
R> cppFunction("arma::uvec venelin2(arma::uvec v) { return(v); }", depends="RcppArmadillo")
R> venelin2(1:3)
     [,1]
[1,]    1
[2,]    2
[3,]    3
R> 

The const seems to throw it off.  We will try to take a look!

Dirk