/* note #undef's at end of file */ #define NRANSI #include #include #include "nrutil.h" #define TOL 2.0e-4 int ncom; float *pcom,*xicom,(*nrfunc)(float []); void linmin(float p[], float xi[], int n, float *fret, float (*func)(float [])) { float brent (float ax, float bx, float cx, float (*f)(float), float tol, float *xmin); void mnbrak(float *ax, float *bx, float *cx, float *fa, float *fb, float *fc, float (*func)(float)); float f1dim (float x); int j; float xx,xmin,fx,fb,fa,bx,ax; ncom=n; pcom=nrvector(0,n-1); xicom=nrvector(0,n-1); nrfunc=func; for (j=0;j