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 eps
= read_real("eps");
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
,eps
,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);