beginning to fold in HOD code with jeremy tinker's approval

This commit is contained in:
P.M. Sutter 2013-12-30 22:48:07 -06:00
parent d8108d3a8e
commit 44cd0eb71f
95 changed files with 21950 additions and 0 deletions

20
c_tools/hod/qtrap.c Normal file
View file

@ -0,0 +1,20 @@
#include <math.h>
#include <stdio.h>
#define JMAX 20
double qtrap(double (*func)(double), double a, double b, double EPS)
{
double trapzd(double (*func)(double), double a, double b, int n);
/*void nrerror(char error_text[]);*/
int j;
double s,olds,t1,t2;
olds = -1.0e30;
for (j=1;j<=JMAX;j++) {
s=trapzd(func,a,b,j);
if (fabs(s-olds) < EPS*fabs(olds)) return s;
olds=s;
}
return s;
}
#undef JMAX