static void enter_function(t_params *p, t_functype ftype, int comb, real reppow, gmx_ffparams_t *ffparams, t_ilist *il, int *maxtypes, gmx_bool bNB, gmx_bool bAppend) { int k, type, nr, nral, delta, start; start = ffparams->ntypes; nr = p->nr; for (k = 0; k < nr; k++) { if (*maxtypes <= ffparams->ntypes) { *maxtypes += 1000; srenew(ffparams->functype, *maxtypes); srenew(ffparams->iparams, *maxtypes); if (debug) { fprintf(debug, "%s, line %d: srenewed idef->functype and idef->iparams to %d\n", __FILE__, __LINE__, *maxtypes); } } type = enter_params(ffparams, ftype, p->param[k].c, comb, reppow, start, bAppend); /* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */ if (!bNB && type >= 0) { nral = NRAL(ftype); delta = nr*(nral+1); srenew(il->iatoms, il->nr+delta); append_interaction(il, type, nral, p->param[k].a); } } }
int main () { int x = 1; while (x == 1) { int selection; printf("\nPerformance Assessment: \n"); printf("-----------------------\n"); printf("1) Enter parameters\n"); printf("2) Print table of parameters\n"); printf("3) Print table of performance\n"); printf("4) Quit\n\n"); printf("Enter Selection: "); scanf("%d", &selection); if (selection == 1) enter_params(); else if (selection == 2) print_params(); else if (selection == 3) print_performance(); else if (selection == 4) { deallocate_memory(); x = 2; } } return 0; }
static void enter_function(t_params *p, t_functype ftype, int comb, real reppow, gmx_ffparams_t *ffparams, InteractionList *il, bool bNB, bool bAppend) { int k, type, nr, nral, start; start = ffparams->numTypes(); nr = p->nr; for (k = 0; k < nr; k++) { type = enter_params(ffparams, ftype, p->param[k].c, comb, reppow, start, bAppend); /* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */ if (!bNB && type >= 0) { assert(il); nral = NRAL(ftype); append_interaction(il, type, nral, p->param[k].a); } } }