int main(void) { InitialFromBinary(); //LocationMatchTest2(); //CreateProteinInteractionMatrix(); //CreatePhenotypeMatchProteinRelationFile(); Begin(); CalculateDistribution(); CalculatePerformance(); CalculatePrecision(); return 0; }
double OneSim(param_ param, FILE *pipe, arr_info_ arr_info_0, lattice_point_ **nghb, gsl_complex **K, gsl_complex *W, gsl_complex *CW, gsl_complex *dW, gsl_complex *complex_rot, double *argW, double *absW, double *rec, double *prec, pr_max_ *pr_max){ int i; double t = 0.; double *p_levl, *r_levl; abs_info_ abs_info; arr_info_ arr_info; pr_ *rW = NULL, *pW = NULL, *eW = NULL; /* * Zero-ing the pr_max array */ for(i=0;i<param.pr_range;i++){ pr_max[i].rec = 0.; pr_max[i].prec = 0.; } /* * Need to allocate the int_total array * of abs_info. */ abs_info.int_total = (int *)malloc(param.pr_range*sizeof(int)); arr_info.nghb_N = arr_info_0.nghb_N; arr_info.r_N = 0; arr_info.p_N = 0; arr_info.e_N = 0; /* * Clutter needs to be started first */ InitZeros(param, CW); InitAmoeba(param, &arr_info, CW, &rW, &pW, &eW); InitClutter(param, CW); /* * Reset the important arrays before * generating the real amoeba. */ free(rW); rW = NULL; free(pW); pW = NULL; free(eW); eW = NULL; arr_info.r_N = 0; arr_info.p_N = 0; arr_info.e_N = 0; InitZeros(param, W); InitAmoeba(param, &arr_info, W, &rW, &pW, &eW); /* * Reserve memory of the levl arrays */ p_levl = (double *)malloc(arr_info.p_N*sizeof(double)); r_levl = (double *)malloc(arr_info.r_N*sizeof(double)); /* * Check the exclusion zone */ ChckExcl(param, arr_info, CW, eW); /* * Time to add the clutter to the amoeba */ for(i=0;i<param.L*param.L;i++) if(gsl_complex_abs2(W[i]) < EPS) W[i] = CW[i]; AbsArg(param, &abs_info, W, absW, argW, complex_rot); while(t<param.T){ t+=param.dt; Quiver(param,pipe,absW,argW,abs_info.max,t); FieldUpdate(param, arr_info, K, W, dW, absW, complex_rot, nghb); #pragma omp parallel for for(i=0;i<param.L*param.L;i++) W[i]=gsl_complex_add(W[i],gsl_complex_mul_real(dW[i],param.dt)); AbsArg(param, &abs_info, W, absW, argW, complex_rot); FieldRedux(param, W, absW, abs_info); CalculateRecall(param, rec, arr_info, absW, argW, rW, r_levl); CalculatePrecision(param, prec, abs_info, arr_info, absW, argW, pW, p_levl); /* * Time to calculate max precision * and recall for all threshold values. * We use that to evaluate the performance * of the current choice of parameters. */ for(i=0;i<param.pr_range;i++) if(rec[i]+prec[i] > pr_max[i].rec + pr_max[i].prec){ pr_max[i].rec = rec[i]; pr_max[i].prec = prec[i]; } } free(rW); free(pW); free(eW); free(p_levl); free(r_levl); free(abs_info.int_total); return t; }