5 int main(int argc
, char** argv
)
11 int* dimensions
= readArray_int("dimensions");
12 int n
= dimensions
[0];
13 int p
= dimensions
[1];
14 int m
= dimensions
[2];
15 int k
= dimensions
[3];
18 float* phiInit
= readArray_real("phiInit");
19 float* rhoInit
= readArray_real("rhoInit");
20 float* piInit
= readArray_real("piInit");
21 float* gamInit
= readArray_real("gamInit");
22 int mini
= read_int("mini");
23 int maxi
= read_int("maxi");
24 float gamma
= read_real("gamma");
25 float lambda
= read_real("lambda");
26 float* X
= readArray_real("X");
27 float* Y
= readArray_real("Y");
28 float tau
= read_real("tau");
34 float* phi
= (float*)malloc(p
*m
*k
*sizeof(float));
35 float* rho
= (float*)malloc(m
*m
*k
*sizeof(float));
36 float* pi
= (float*)malloc(k
*sizeof(float));
37 float* LLF
= (float*)malloc(maxi
*sizeof(float));
38 float* S
= (float*)malloc(p
*m
*k
*sizeof(float));
44 EMGLLF_core(phiInit
,rhoInit
,piInit
,gamInit
,mini
,maxi
,gamma
,lambda
,X
,Y
,tau
,
55 // Compare to reference outputs
56 float* ref_phi
= readArray_real("phi");
57 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
);
61 float* ref_rho
= readArray_real("rho");
62 compareArray_real("rho", rho
, ref_rho
, m
*m
*k
);
66 float* ref_pi
= readArray_real("pi");
67 compareArray_real("pi", pi
, ref_pi
, k
);
71 float* ref_LLF
= readArray_real("LLF", maxi
);
72 compareArray_real("LLF", LLF
, ref_LLF
);
76 float* ref_S
= readArray_real("S");
77 compareArray_real("S", S
, ref_S
, p
*m
*k
);