GRASS Programmer's Manual  6.4.2(2012)
ksn.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(double *x, int n)
00008 {
00009     static double y[2];
00010     double *d, sqrtn;
00011 
00012     sqrtn = sqrt((double)n);
00013     d = dmax(x, n);
00014 
00015     y[1] = (d[0] > d[1]) ? d[0] : d[1];
00016     y[0] = y[1] * (sqrtn + 0.85 / sqrtn - 0.01);
00017 
00018 #ifdef NOISY
00019     fprintf(stdout, "  TEST10 KSD(N) =%10.4f\n", y[0]);
00020     fprintf(stdout, "  TEST11 KSD    =%10.4f\n", y[1]);
00021 #endif /* NOISY */
00022 
00023     return y;
00024 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines