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