void asss() { int a=0,b=0,c=0,d=0,e=0; for(a=0;a<2;a++) for(b=0;b<2;b++) for(c=0;c<2;c++) for(d=0;d<2;d++) for(e=0;e<2;e++) { bm[1][2]=a; bm[2][4]=1-a; bm[3][1]=b; bm[4][3]=1-b; bm[4][3]=c; bm[1][0]=1-c; bm[2][0]=d; bm[1][1]=1-d; bm[3][1]=e; bm[0][2]=1-e; if(check_arry (5)&&bm[3][1]!=bm[4][3]) { print_arry2 (5); printf ("\n"); } fillwith (5,0); } }
/* find most significant feature with respect to Xk */ int gmsw(fl_tp Xk,fl_tp Ym,mic_matrix M) { int *lst_Xk=(int*)malloc((Xk->k+1)*sizeof(int)); int i=0; if(Xk->k!=0) { for(i=0;i<Xk->k;i++) { lst_Xk[i]=Xk->membs[i]; } } int Xk_len=Xk->k+1; float max=-FLT_MAX; int atr=-1; fet_tp cur=Ym->header; for(i=0;i<Ym->k;i++) { lst_Xk[Xk_len-1]=cur->atr; #ifdef debug_gmsw printf("cur->atr:%d\nCheck Xk_:",cur->atr); check_arry(lst_Xk,Xk->k+1); #endif float merit=cal_merit(lst_Xk,Xk_len,M); #ifdef debug_gmsw printf("Debugging gmsw and now merit %f with atr %d.\n",merit,cur->atr); #endif if(EXACT(merit)>EXACT(max)) { max=merit; atr=cur->atr; } cur=cur->nn; } free(lst_Xk); #ifdef debug_gmsw printf("now atr:%d\n",atr); #endif return atr; }