/* optmn.h optimize n parameters to achieve a minimum of a function */ /* the double precision function y = f(double x[]) */ /* srchn does a coarse global search to find initial values */ void optmn(int n, /* number of parameters */ double x[], /* initial and returned optimum */ double *y, /* returned value of function */ double yfinal, /* stop when y < yfinal */ int maxcnt, /* maximum number of steps */ double tol, /* relative tolerance on step */ double step[], /* start and returned step size */ double xmin[], /* minimum value for each x */ double xmax[], /* maximum value for each x */ double (*f)(double x[]) ); /* function to be evaluated */ void srchn(int n, /* number of parameters */ double x[], /* returned best found */ double *y, /* returned value of function */ int maxcnt, /* maximum number of tries */ double xmin[], /* minimum value for each x */ double xmax[], /* maximum value for each x */ double (*f)(double x[]) ); /* function to be evaluated */