2 #include "test_utils.h"
7 int main(int argc
, char** argv
)
9 int* dimensions
= readArray_int("dimensions");
10 int n
= dimensions
[0];
11 int p
= dimensions
[1];
12 int m
= dimensions
[2];
13 int k
= dimensions
[3];
20 float* phiInit
= readArray_real("phiInit");
21 float* rhoInit
= readArray_real("rhoInit");
22 float* piInit
= readArray_real("piInit");
23 float* gamInit
= readArray_real("gamInit");
24 int mini
= read_int("mini");
25 int maxi
= read_int("maxi");
26 float gamma
= read_real("gamma");
27 float lambda
= read_real("lambda");
28 float* X
= readArray_real("X");
29 float* Y
= readArray_real("Y");
30 float tau
= read_real("tau");
36 float* phi
= (float*)malloc(p
*m
*k
*sizeof(float));
37 float* rho
= (float*)malloc(m
*m
*k
*sizeof(float));
38 float* pi
= (float*)malloc(k
*sizeof(float));
39 float* LLF
= (float*)malloc(maxi
*sizeof(float));
40 float* S
= (float*)malloc(p
*m
*k
*sizeof(float));
45 EMGLLF_core(phiInit
,rhoInit
,piInit
,gamInit
,mini
,maxi
,gamma
,lambda
,X
,Y
,tau
,
56 // Compare to reference outputs
57 float* ref_phi
= readArray_real("phi");
58 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
);
62 float* ref_rho
= readArray_real("rho");
63 compareArray_real("rho", rho
, ref_rho
, m
*m
*k
);
67 float* ref_pi
= readArray_real("pi");
68 compareArray_real("pi", pi
, ref_pi
, k
);
72 float* ref_LLF
= readArray_real("LLF");
73 compareArray_real("LLF", LLF
, ref_LLF
, maxi
);
77 float* ref_S
= readArray_real("S");
78 compareArray_real("S", S
, ref_S
, p
*m
*k
);