// Mon Mar 20 15:31:21 CET 2000 // programa de aprendizaje */ // lun may 8 18:34:06 CEST 2006 // ramas entrelazadas #include #include #include #include "entropia.h" #include "tabla2.h" #include "arbid.h" float entrFun (f, b, nlt) int * f; int * * b; int nlt; { int c0, c1; int l; c0 = c1 = 0; for (l=0; l entmin) if (nvo2 == -1) { nvo2 = nv-1; } // printf ("%d entropia: %8.4f\n", nv, ent) ; } if (nvo2 == -1) { nvo2 = tmx[col]; } nvo = (nvo1 + nvo2)/2; *pentmn = entmin; return nvo; } tpnodo colOpt (f, b, m, nlt) int * f; int * * b; int * * m; int nlt; { int cl, clo; int nv, nvo; int nlmn, nlmy; float ent, entMin; float entF; int * * c; int * * n; int * g; tpnodo nmn, nmyIg; entF = entrFun (f, b, nlt); if (entF == 0) { if (f[0]){ // printf (" cierto\n"); return creaNodo(nd_cierto, 0, 0, NULL, NULL); } else { // printf (" falso\n"); return creaNodo(nd_falso, 0, 0, NULL, NULL); } } entMin = entF ; for (cl=0; cl