Shaami
2018-04-18 00:38:26 UTC
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
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