// Test Poissondev
System.out.println("Testing Poissondev");
// Check fingerprint of doub()
lambda=3.0;
Poissondev myran = new Poissondev(lambda,17);
localflag=false;
for (i=0;i<10;i++)
// System.out.printf(setw(25) << setprecision(20) << myran.dev());
localflag=localflag || (myran.dev() != fingerprint[i]);
globalflag = globalflag || localflag;
if (localflag) {
fail("*** Poissondev: dev() does not match fingerprint");
}
// Check statistics
Poissondist expect = new Poissondist(lambda);
for (i=0;i<M;i++) {
ebins[i]=N*expect.p(i);
bins[i]=0;
}
for (i=0;i<N;i++) {
nbin=myran.dev();
if ((nbin >= 0) && (nbin < M)) bins[nbin] += 1;
}
chsone(bins,ebins,df,chisq,prob);
System.out.printf(" chisq,dev(): %f prob: %f\n",chisq.val, prob.val);
localflag = (prob.val < 0.05);