4 #include "local_proto.h" 10 double mean = 0.0, zmax, tmax, *xcopy,
t, z, fx;
13 if ((xcopy = (
double *)
malloc(n *
sizeof(
double))) ==
NULL) {
14 fprintf(stderr,
"Memory error in Cdhc_dmax_exp\n");
18 for (i = 0; i < n; ++i) {
24 qsort(xcopy, n,
sizeof(
double),
Cdhc_dcmp);
26 for (i = 0; i < n; ++i) {
27 fx = 1 - exp(-xcopy[i] / mean);
28 z = (double)(i + 1) / (double)n - fx;
29 t = fx - (double)i / (
double)n;
30 if (i == 0 || z > zmax)
33 if (i == 0 || t > tmax)
double * Cdhc_dmax_exp(double *x, int n)
int Cdhc_dcmp(const void *i, const void *j)
float mean(IClass_statistics *statistics, int band)
Helper function for computing mean.