1 #include "constructionModelesLassoMLE.h"
2 #include "test_utils.h"
7 int main(int argc
, char** argv
)
9 int* dimensions
= readArray_int("dimensions");
10 int n
= dimensions
[0];
11 int p
= dimensions
[1];
12 int m
= dimensions
[2];
13 int k
= dimensions
[3];
14 int L
= dimensions
[4];
19 Real
* phiInit
= readArray_real("phiInit");
20 Real
* rhoInit
= readArray_real("rhoInit");
21 Real
* piInit
= readArray_real("piInit");
22 Real
* gamInit
= readArray_real("gamInit");
23 int mini
= read_int("mini");
24 int maxi
= read_int("maxi");
25 Real gamma
= read_real("gamma");
26 Real
* glambda
= readArray_real("glambda");
27 Real
* X
= readArray_real("X");
28 Real
* Y
= readArray_real("Y");
29 Real seuil
= read_real("seuil");
30 Real tau
= read_real("tau");
31 int* A1
= readArray_int("A1");
32 int* A2
= readArray_int("A2");
37 Real
* phi
= (Real
*)malloc(p
*m
*k
*L
*sizeof(Real
));
38 Real
* rho
= (Real
*)malloc(m
*m
*k
*L
*sizeof(Real
));
39 Real
* pi
= (Real
*)malloc(k
*L
*sizeof(Real
));
40 Real
* llh
= (Real
*)malloc(L
*2*sizeof(Real
));
43 /////////////////////////////////////////
44 // Call to constructionModelesLassoMLE //
45 constructionModelesLassoMLE_core(
46 phiInit
,rhoInit
,piInit
,gamInit
,mini
,maxi
,gamma
,glambda
,X
,Y
,seuil
,tau
,A1
,A2
,
49 /////////////////////////////////////////
61 // Compare to reference outputs
62 Real
* ref_phi
= readArray_real("phi");
63 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
*L
);
67 Real
* ref_rho
= readArray_real("rho");
68 compareArray_real("rho", rho
, ref_rho
, m
*m
*k
*L
);
72 Real
* ref_pi
= readArray_real("pi");
73 compareArray_real("pi", pi
, ref_pi
, k
*L
);
77 Real
* ref_llh
= readArray_real("llh");
78 compareArray_real("llh", llh
, ref_llh
, L
*2);