1 #include "constructionModelesLassoRank.h"
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];
12 int L
= dimensions
[4];
17 Real
* Pi
= readArray_real("Pi");
18 Real
* Rho
= readArray_real("Rho");
19 int mini
= read_int("mini");
20 int maxi
= read_int("maxi");
21 Real
* X
= readArray_real("X");
22 Real
* Y
= readArray_real("Y");
23 Real tau
= read_real("tau");
24 int* A1
= readArray_int("A1");
25 int rangmin
= read_int("rangmin");
26 int rangmax
= read_int("rangmax");
31 int Size
= (int)pow(rangmax
-rangmin
+1, k
);
32 Real
* phi
= (Real
*)malloc(p
*m
*k
*L
*Size
*sizeof(Real
));
33 Real
* llh
= (Real
*)malloc(L
*Size
*2*sizeof(Real
));
36 /////////////////////////////////////////
37 // Call to constructionModelesLassoMLE //
38 constructionModelesLassoRank_core(
39 Pi
,Rho
,mini
,maxi
,X
,Y
,tau
,A1
,rangmin
,rangmax
,
42 /////////////////////////////////////////
50 // Compare to reference outputs
51 Real
* ref_phi
= readArray_real("phi");
52 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
*L
*Size
);
56 Real
* ref_llh
= readArray_real("llh");
57 compareArray_real("llh", llh
, ref_llh
, L
*Size
*2);