[Rcpp-devel] 4-dimensional array
Avraham Adler
avraham.adler at gmail.com
Wed Apr 18 03:56:38 CEST 2018
May not be possible. See
https://stackoverflow.com/questions/16105548/4-dimensional-matrix-in-armadillo
Avi
On Tue, Apr 17, 2018 at 8:38 PM Shaami <nzshaam at gmail.com> wrote:
> Dear Prof.
>
> I am not finding how to introduce a 4-dimensional array using
> RcppArmadillo. Could you please provide a simple example of introducing a
> 4-dimensional array and how to store the values in it? For example, exactly
> the same as I did for the cube as follows
>
>
> arma::cube X(N, M, Q, fill::zeros);
>
> for(int n=0; n<N; n++)
> {
> for(int m=0; m<M; m++)
> {
> for(int q=0; q<Q; q++)
> {
> X(n, m, q) + = n+m-q
> }
> }
> }
>
> Thank you
>
> Shaami
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180418/cc3be6e7/attachment-0001.html>
More information about the Rcpp-devel
mailing list