1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| double info_mut_cond(MotCompact const *pc, MotCompact const *pc2,TableauMotsCompacts * pcMot)
{
double IM=0;
char const * mot = GetMotCompact(pc);
char * mot1 = malloc(sizeof (*mot1) * 256);
char * mot2 = malloc(sizeof (*mot2) * 256);
double p1,p2,p3,p4,p5;
MotCompact const *m1;
MotCompact const *m2;
sscanf(mot, "%s %s", mot1, mot2);
m1= RechercherMotCompactC(pcMot,mot1);
m2= RechercherMotCompactC(pcMot,mot2);
p1=(NbLignesCommunes(pc,pc2)/((double)596831));
p2=(GetNbLigneMotCompact(m1)/((double)596831));
p4=(NbLignesCommunes(m1,pc2)/((double)596831));
p5=(NbLignesCommunes(m2,pc2)/((double)596831));
IM=p1*log((p2*p1)/(p4*p5));
return IM;
free(mot1);
free(mot2);
} |
Partager