}
@Test
public void test() {
int i,j,NPTS=10000,NSHFT=10;
doubleW ave1=new doubleW(0),ave2 = new doubleW(0);
doubleW var1 = new doubleW(0), var2 = new doubleW(0);
double EPS=0.01,sd,sbeps;
double fingerprint[]={0.024980,0.072904,0.178591,0.369851,0.653879,
1.0,0.653879,0.369851,0.178591,0.072904,0.024980};
double[] data1=new double[NPTS],data2=new double[NPTS];
double[] t=new double[NSHFT+1],prob=new double[NSHFT+1],tt= new double[NSHFT+1];
boolean localflag=false,globalflag=false;
// Test tutest
System.out.println("Testing tutest");
// Generate two gaussian distributions of different variance
Normaldev ndev = new Normaldev(0.0,1.0,17);
for (i=0;i<NPTS;i++) data1[i]=ndev.dev();
avevar(data1,ave1,var1);
for (i=0;i<NPTS;i++) data1[i] -= ave1.val;
// Conclass data with exactly twice the standard deviation
for (i=0;i<NPTS;i++) data2[i]=NSHFT/2.0*EPS+2.0*data1[i];
avevar(data2,ave2,var2);
// System.out.printf(ave1 << " %f\n", ave2 << " %f\n", var1 << " %f\n", var2);
sd=sqrt((var1.val+var2.val)/NPTS);
for (i=0;i<NSHFT+1;i++) {
doubleW tw = new doubleW(0);
doubleW pw = new doubleW(0);
tutest(data1,data2,tw, pw); t[i]=tw.val;prob[i]=pw.val;
for (j=0;j<NPTS;j++) data1[j] += EPS;
tt[i]=(-NSHFT/2.0+i)*EPS/sd;
// System.out.printf(t[i] << " %f\n", prob[i] << " %f\n", tt[i]);
}