static void decode_a_frame(gsm0610_state_t *s, int16_t amp[GSM0610_FRAME_LEN], gsm0610_frame_t *f) { int j; int k; int16_t erp[40]; int16_t wt[GSM0610_FRAME_LEN]; int16_t *drp; drp = s->dp0 + 120; for (j = 0; j < 4; j++) { gsm0610_rpe_decoding(s, f->xmaxc[j], f->Mc[j], f->xMc[j], erp); gsm0610_long_term_synthesis_filtering(s, f->Nc[j], f->bc[j], erp, drp); for (k = 0; k < 40; k++) wt[j*40 + k] = drp[k]; /*endfor*/ } /*endfor*/ gsm0610_short_term_synthesis_filter(s, f->LARc, wt, amp); postprocessing(s, amp); }
int main() { //system("date"); int i,a; iAntCount=1000; counts[0]=150; counts[1]=300; ihapsize[0]=6; ihapsize[1]=3; alpha=1; rou=0.05; phe=100; iTopModel=1000; iTopLoci=200; iEpiModel=2; pvalue=0.01; char* para="parameters.txt"; loadparameters(para); SNPdata.input_data(inputfile); //SNPdata.setpheromone(phe); iLociCount=SNPdata.iLoci-1; char* logpath="AntEpiSeeker.log"; char* minipath="results_maximized.txt"; write_result(logpath,0); for(a=0;a<2;a++) { iItCount=counts[a]; cout<<a+1<<" round search"<<endl; iLociModel=ihapsize[a]; loci_TopModel=new int* [iTopModel]; for(i=0;i<iTopModel;i++) loci_TopModel[i]=new int [iLociModel]; loci_TopLoci=new int [iTopLoci]; phe_TopLoci=new double [iTopLoci]; eva_TopModel=new double [iTopModel]; for(i=0;i<iTopModel;i++) eva_TopModel[i]=0; /////////////////////////////////////////////////////////////// cout<<"-----Initializing parameters-----"<<endl; cout<<"Number of ants: "<<iAntCount<<endl; cout<<"Number of iterations: "<<iItCount<<endl; cout<<"Start pheromone level: "<<phe<<endl; cout<<"Rou: "<<rou<<endl; cout<<"Alpha: "<<alpha<<endl; cout<<"Number of top ranking SNP sets: "<<iTopModel<<endl; cout<<"Number of top ranking loci: "<<iTopLoci<<endl; cout<<"Size of SNP sets: "<<ihapsize[a]<<endl; cout<<"Number of SNPs in an epistatic interaction: "<<iEpiModel<<endl; /////////////////////////////////////////////////////////////// SNPdata.setpheromone(phe); project episeeker; episeeker.StartSearch(); get_toploci(); write_result(logpath,3); postprocessing(); for(i=0;i<iTopModel;i++) { delete [] loci_TopModel[i]; } delete [] loci_TopModel; delete [] loci_TopLoci; delete [] phe_TopLoci; delete [] eva_TopModel; } mini_fp(); //////////////////permutation/////////////////////////////// // cout<<"Permuting genotypes:\n"; // for(i=0;i<10000;i++) // { // if(i%500==0) // cout<<i<<" iteractions"<<endl; // rnd_values[i]=random_chi(); // } //////////////////////////////////////////////////////////// write_result(minipath,4); write_result(outputfile,1); SNPdata.destroy(); return 1; }