@Test
public void test() {
int i,j;
int NPTS=10000,NSHFT=10;
doubleW ave1=new doubleW(0),ave2 = new doubleW(0);
doubleW var1 = new doubleW(0), var2 = new doubleW(0);
double sd,EPS=0.005,sbeps;
double fingerprint[]={0.076341,0.156226,0.287591,0.478354,0.722981,
1.0,0.722981,0.478354,0.287591,0.156226,0.076341};
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 ttest
System.out.println("Testing ttest");
// Generate gaussian distributed data
Normaldev ndev=new Normaldev(0.0,1.0,17);
// Special case: identical distributions
for (i=0;i<NPTS;i++) data1[i]=ndev.dev();
for (i=0;i<NPTS;i++) data2[i]=(NSHFT/2.0)*EPS+data1[i];
avevar(data1,ave1,var1);
avevar(data2,ave2,var2);
sd=sqrt(var1.val/NPTS*2.0);
for (i=0;i<NSHFT+1;i++) {
doubleW tw = new doubleW(0);
doubleW pw = new doubleW(0);
ttest(data1,data2,tw,pw);t[i]=tw.val;prob[i]=pw.val;
tt[i]=((-NSHFT/2.0)+i)*EPS/sd;
// System.out.printf(i << " %f\n", t[i] << " %f\n", tt[i] << " %f\n", prob[i]);
for (j=0;j<NPTS;j++) data1[j] += EPS;
}