/* nrutil.h from Numerical Recipes in C, by Press, Teukolsky, Vetterling, and Flannery. * Am adding functions from their nrutil.h to this file as I need them. * * Ken Gosier * May 2002 */ #ifndef _NR_UTILS_H_ #define _NR_UTILS_H_ static double maxarg1, maxarg2; #define FMAX(a, b) (maxarg1 = (a), maxarg2 = (b), (maxarg1) > (maxarg2) ? (maxarg1) : (maxarg2)) #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) /* Numerical Recipes standard error handler */ void nrerror(char error_text[]) { fprintf(stderr, "Numerical Recipes run-time error...\n"); fprintf(stderr, "%s\n", error_text); fprintf(stderr, "...now exiting to system...\n"); exit(1); } #endif /* _NR_UTILS_H_ */