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.00000 1.73205
        [2,] 1.41421 2.00000

, , 2

        [,1]    [,2]
        [1,] 2.23607 2.64575
        [2,] 2.44949 2.82843

R> test2(v)
R> v
, , 1

        [,1]    [,2]
        [1,] 0.50000 1.73205
        [2,] 1.41421 2.00000

, , 2

        [,1]    [,2]
        [1,] 2.23607 2.64575
        [2,] 2.44949 2.82843

R>

Proxy object that still connected to the outside object, unless a cast is
needed (int <-> double), or a copy is enforced (clone(), possibly via as<>()).

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to