45402db0f3b237a00b7cb0a57be399653d32ea26
1 #include "constructionModelesLassoMLE.h"
2 #include "test_utils.h"
4 int main(int argc
, char** argv
)
6 int* dimensions
= readArray_int("dimensions");
10 int k
= dimensions
[3];
11 int L
= dimensions
[4];
16 Real
* phiInit
= readArray_real("phiInit");
17 Real
* rhoInit
= readArray_real("rhoInit");
18 Real
* piInit
= readArray_real("piInit");
19 Real
* gamInit
= readArray_real("gamInit");
20 int mini
= read_int("mini");
21 int maxi
= read_int("maxi");
22 Real gamma
= read_real("gamma");
23 Real
* glambda
= readArray_real("glambda");
24 Real
* X
= readArray_real("X");
25 Real
* Y
= readArray_real("Y");
26 Real seuil
= read_real("seuil");
27 Real tau
= read_real("tau");
28 int* A1
= readArray_int("A1");
29 int* A2
= readArray_int("A2");
34 Real
* phi
= (Real
*)malloc(p
*m
*k
*L
*sizeof(Real
));
35 Real
* rho
= (Real
*)malloc(m
*m
*k
*L
*sizeof(Real
));
36 Real
* pi
= (Real
*)malloc(k
*L
*sizeof(Real
));
37 Real
* llh
= (Real
*)malloc(L
*2*sizeof(Real
));
40 /////////////////////////////////////////
41 // Call to constructionModelesLassoMLE //
42 constructionModelesLassoMLE(
43 phiInit
,rhoInit
,piInit
,gamInit
,mini
,maxi
,gamma
,glambda
,X
,Y
,seuil
,tau
,A1
,A2
,
46 /////////////////////////////////////////
58 // Compare to reference outputs
59 Real
* ref_phi
= readArray_real("phi",dimPhi
,4);
60 compareArray_real("phi", phi
, ref_phi
, p
*m
*k
*L
);
64 Real
* ref_rho
= readArray_real("rho",dimRho
,4);
65 compareArray_real("rho", rho
, ref_rho
, m
*m
*k
*L
);
69 Real
* ref_pi
= readArray_real("pi",dimPi
,2);
70 compareArray_real("pi", pi
, ref_pi
, k
*L
);
74 Real
* ref_llh
= readArray_real("llh",dimllh
,2);
75 compareArray_real("llh", llh
, ref_llh
, L
*2);