// utable -- Make a table of the Mann-Whitney U statistic // // utable [

] // #include #include #include #include #include #include "common.h" void options(int, char**); void doit(void); void usage(void); extern "C" { long atol(const char*); double strtod(const char*, char**); void error(const char*); void error1(const char*, const char*); long lpicks(int, int, int, int*); long epicks(int, int, int, int*); long gpicks(int, int, int, int*); } char *PROGNAME; int Nmax; double P; int dflag = 0; int cflag = 0; int indent = 0; void main( int argc, char *argv[] ) { STARTUP; options(argc, argv); doit(); EXITOK; } void options( int argc, char *argv[] ) { if ((1 != argc) && (2 != argc)) usage(); Nmax = atol(argv[0]); if (Nmax <= 0) error("Nmax must be positive"); if (2 == argc) P = strtod(argv[1], NULL); else P = 0.05; } void usage(void) { error1("usage: %s ", PROGNAME); } void doit(void) { int* vals = new int[Nmax]; for(int N = 0; N < Nmax; N++) { vals[N] = N + 1; } for(int N = 2; N < Nmax; N++) { for(int n = 1; n < N; n++) { double tp = gpicks(n, N, 0, vals); double target = tp * P; int sum = (int) (n * (N + 1)/2.0); } } }