Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTikk2MTE67Jv8GL13Vaivzq48rZo6g@mail.gmail.com>
Date: 2011-06-06T15:12:59Z
From: Richard Chandler
Subject: [Rcpp-devel] as cube

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. 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.

Thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110606/23b9925b/attachment.htm>