| 1 |
typedef const int cint; |
| 2 |
typedef struct { |
| 3 |
} Bounds; |
| 4 |
int ndim_, ncomp_, selectedcomp_, nregions_; |
| 5 |
void *voidregion_; |
| 6 |
typedef struct { |
| 7 |
double diff, err, spread; |
| 8 |
} Errors; |
| 9 |
typedef const Errors cErrors; |
| 10 |
void Split(int iregion, int depth, int xregion) |
| 11 |
{ |
| 12 |
typedef struct { |
| 13 |
double avg, err, spread, chisq; |
| 14 |
double xmin[ndim_], xmax[ndim_]; |
| 15 |
} Result; |
| 16 |
typedef struct region { |
| 17 |
Result result[ncomp_]; |
| 18 |
} Region; |
| 19 |
Errors errors[ncomp_]; |
| 20 |
int comp, ireg, xreg; |
| 21 |
for( ireg = iregion, xreg = xregion; ireg < nregions_; ireg = xreg++ ) |
| 22 |
{ |
| 23 |
Result *result = ((Region *)voidregion_)[ireg].result; |
| 24 |
for( comp = 0; comp < ncomp_; ++comp ) |
| 25 |
{ |
| 26 |
Result *r = &result[comp]; |
| 27 |
cErrors *e = &errors[comp]; |
| 28 |
double c = e->diff; |
| 29 |
if( r->err > 0 ) r->err = r->err*e->err + c; |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
|