38 for(k=0;k<
NT;++k)
for(j=0;j<
NS;++j)
for(i=0;i<
NR;++
i)
39 elx[(k*NS+j)*NR+
i] = zr[
i],
40 ely[(k*NS+j)*NR+i] = zs[j],
41 elz[(k*NS+j)*NR+
i] = zt[k];
45 for(k=0;k<
NT;++k)
for(j=0;j<
NS;++j)
for(i=0;i<
NR;++
i) {
47 p->
x[0] = zr[
i]*2, p->
x[1] = zs[j]*2, p->
x[2] = zt[k]*2;
48 p->
r[0] = 0, p->
r[1] = 0, p->
r[2] = 0;
55 for(k=0;k<
NT;++k)
for(j=0;j<
NS;++j)
for(i=0;i<
NR;++
i) {
58 printf(
"x = (%g,%g,%g), r = (%g,%g,%g), flags = %x, dist2 = %g\n",
59 p->
x[0],p->
x[1],p->
x[2], p->
r[0],p->
r[1],p->
r[2],
62 do { double temp=r; x = temp<-1?-1:(temp>1?1:temp); } while(0)
65 if( fabs(r-p->
r[0])+fabs(s-p->
r[1])+fabs(t-p->
r[2]) > 1024*DBL_EPSILON )
66 { printf(
"off by %g\n", fabs(r-p->
r[0])+fabs(s-p->
r[1])+fabs(t-p->
r[2]));
74 printf(
"Tests %s\n", pass?
"passed":
"failed");
static const double *const elx3[3]
static struct findpts_el_pt_3 * findpts_el_points_3(struct findpts_el_data_3 *const fd)
static double elz[NR *NS *NT]
static double ely[NR *NS *NT]
static const unsigned nr[3]
#define findpts_el_free_3
#define findpts_el_setup_3
static void findpts_el_start_3(struct findpts_el_data_3 *const fd, const double *const x[3])
static double elx[NR *NS *NT]
establishes some macros to establish naming conventions