1 #include "constructionModelesLassoRank.h"
2 #include "test_utils.h"
6 int main(int argc
, char** argv
)
8 int* dimensions
= readArray_int("dimensions");
10 int p
= dimensions
[1];
11 int m
= dimensions
[2];
12 int k
= dimensions
[3];
13 int L
= dimensions
[4];
18 Real
* pi
= readArray_real("pi");
19 Real
* rho
= readArray_real("rho");
20 int mini
= read_int("mini");
21 int maxi
= read_int("maxi");
22 Real
* X
= readArray_real("X");
23 Real
* Y
= readArray_real("Y");
24 Real tau
= read_real("tau");
25 int* A1
= readArray_int("A1");
26 int rangmin
= read_int("rangmin");
27 int rangmax
= read_int("rangmax");
32 int Size
= (int)pow(rangmax
-rangmin
+1, k
);
33 Real
* phi
= (Real
*)malloc(p
*m
*k
*L
*Size
*sizeof(Real
));
34 Real
* llh
= (Real
*)malloc(L
*Size
*2*sizeof(Real
));
37 /////////////////////////////////////////
38 // Call to constructionModelesLassoMLE //
39 constructionModelesLassoRank_core(
40 pi
,rho
,mini
,maxi
,X
,Y
,tau
,A1
,rangmin
,rangmax
,
43 /////////////////////////////////////////
51 // Compare to reference outputs
52 Real
* ref_phi
= readArray_real("phi");
53 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
*L
*Size
);
57 Real
* ref_llh
= readArray_real("llh");
58 compareArray_real("llh", llh
, ref_llh
, L
*Size
*2);