1 #include "selectiontotale.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
* phiInit
= readArray_real("phiInit");
18 Real
* rhoInit
= readArray_real("rhoInit");
19 Real
* piInit
= readArray_real("piInit");
20 Real
* gamInit
= readArray_real("gamInit");
21 int mini
= read_int("mini");
22 int maxi
= read_int("maxi");
23 Real gamma
= read_real("gamma");
24 Real
* glambda
= readArray_real("glambda");
25 Real
* X
= readArray_real("X");
26 Real
* Y
= readArray_real("Y");
27 Real seuil
= read_real("seuil");
28 Real tau
= read_real("tau");
33 int* A1
= (int*)malloc(p
*(m
+1)*L
*sizeof(int));
34 int* A2
= (int*)malloc(p
*(m
+1)*L
*sizeof(int));
35 Real
* Rho
= (Real
*)malloc(m
*m
*k
*L
*sizeof(Real
));
36 Real
* Pi
= (Real
*)malloc(k
*L
*sizeof(Real
));
39 /////////////////////////////////////////
40 // Call to constructionModelesLassoMLE //
42 phiInit
,rhoInit
,piInit
,gamInit
,mini
,maxi
,gamma
,glambda
,X
,Y
,seuil
,tau
,
45 /////////////////////////////////////////
55 // Compare to reference outputs
56 int* ref_A1
= readArray_int("A1");
57 compareArray_int("A1", A1
, ref_A1
, p
*(m
+1)*L
);
61 int* ref_A2
= readArray_int("A2");
62 compareArray_int("A2", A2
, ref_A2
, p
*(m
+1)*L
);
66 Real
* ref_Rho
= readArray_real("Rho");
67 compareArray_real("Rho", Rho
, ref_Rho
, m
*m
*k
*L
);
71 Real
* ref_Pi
= readArray_real("Pi");
72 compareArray_real("Pi", Pi
, ref_Pi
, k
*L
);