2 #include "test_utils.h"
5 int main(int argc
, char** argv
)
7 int* dimensions
= readArray_int("dimensions");
10 int m
= dimensions
[2];
11 int k
= dimensions
[3];
16 Real
* rho
= readArray_real("rho");
17 Real
* pi
= readArray_real("pi");
18 int mini
= read_int("mini");
19 int maxi
= read_int("maxi");
20 Real
* X
= readArray_real("X");
21 Real
* Y
= readArray_real("Y");
22 Real tau
= read_real("tau");
23 int* rank
= readArray_int("rank");
28 Real
* phi
= (Real
*)malloc(p
*m
*k
*sizeof(Real
));
29 Real
* LLF
= (Real
*)malloc(1*sizeof(Real
));
32 //////////////////////////
33 // Main call to EMGrank //
34 EMGrank_core(pi
,rho
,mini
,maxi
,X
,Y
,tau
,rank
,
37 //////////////////////////
45 // Compare to reference outputs
46 Real
* ref_phi
= readArray_real("phi");
47 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
);
52 Real
* ref_LLF
= readArray_real("LLF");
53 compareArray_real("LLF", LLF
, ref_LLF
, 1);