Hi all, I wonder whether the input of map_rec() function should only be 2-d array? Could it be a 3-d array?
I packed all my data into a 3-d array and each shelf is a shard. Here is how I defined my 3-d array:
int<lower = 0> xi[N_THREAD,M+1, 2*(N_DNA + N_RNA)]
And here is my function:
functions{
vector f(vector alpha, vector beta , real[] xr , int[] xi ){
int M = size(xr);
int N_DNA = xi[M+1, 1];
int N_RNA = xi[M+1, 2];
int a[M,N_DNA] = xi[1:M,1:N_DNA];
.....
and the compiler reports the error that
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
Too many indexes, expression dimensions=1, indexes found=2
error in '/multiple2_2shards.stan' at line 25, column 28
-------------------------------------------------
23: vector f(vector alpha, vector beta , real[] xr , int[] xi ){
24: int M = size(xr);
25: int N_DNA = xi[M+1, 1];
^
26: int N_RNA = xi[M+1, 2];
-------------------------------------------------
And my full code is here:
multiple_2shards.stan (3.5 KB)
functions.stan (759 Bytes)
Any advice would be helpful! Thank you!