GRASS Programmer's Manual  6.4.2(2012)
kse.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <math.h>
00003 #include <grass/cdhc.h>
00004 #include "local_proto.h"
00005 
00006 
00007 double *kolmogorov_smirnov_exp(double *x, int n)
00008 {
00009     static double y[2];
00010     double *d, sqrtn;
00011 
00012     d = dmax_exp(x, n);
00013     sqrtn = sqrt((double)n);
00014 
00015     y[1] = (d[0] > d[1]) ? d[0] : d[1];
00016     y[0] = (y[1] - 0.2 / n) * (sqrtn + 0.5 / sqrtn + 0.26);
00017 
00018 #ifdef NOISY
00019     fprintf(stdout, "  TEST17 KSD(E) =%10.4f\n", y[0]);
00020 #endif /* NOISY */
00021 
00022     return y;
00023 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines