# HG changeset patch # User jwe # Date 1165327611 0 # Node ID 0b190c3434712be4467f74108bd954d0bd423cf2 # Parent c67c11e2282879e32b42cf925094016a3d2097a1 [project @ 2006-12-05 14:06:50 by jwe] diff -r c67c11e22828 -r 0b190c343471 liboctave/ChangeLog --- a/liboctave/ChangeLog Mon Dec 04 16:08:30 2006 +0000 +++ b/liboctave/ChangeLog Tue Dec 05 14:06:51 2006 +0000 @@ -1,3 +1,8 @@ +2006-12-05 Paul Kienzle + + * randpoisson.c (oct_fill_randp): For lambda > 1e8, upper limit of + loop is n, not L. + 2006-11-30 John W. Eaton * lo-utils.cc (octave_read_double, read_inf_nan_na): diff -r c67c11e22828 -r 0b190c343471 liboctave/randpoisson.c --- a/liboctave/randpoisson.c Mon Dec 04 16:08:30 2006 +0000 +++ b/liboctave/randpoisson.c Tue Dec 05 14:06:51 2006 +0000 @@ -400,7 +400,7 @@ { /* normal approximation: from Phys. Rev. D (1994) v50 p1284 */ const double sqrtL = sqrt(L); - for (i = 0; i < L; i++) + for (i = 0; i < n; i++) { p[i] = floor(RNOR*sqrtL + L + 0.5); if (p[i] < 0.0) diff -r c67c11e22828 -r 0b190c343471 src/ChangeLog --- a/src/ChangeLog Mon Dec 04 16:08:30 2006 +0000 +++ b/src/ChangeLog Tue Dec 05 14:06:51 2006 +0000 @@ -1,3 +1,7 @@ +2006-12-05 Paul Kienzle + + * DLD-FUNCTIONS/rand.cc: Test for Poisson generator with lambda > 1e8. + 2006-12-04 David Bateman * data.cc (Fdata): If ndims is greater than nargout and diff -r c67c11e22828 -r 0b190c343471 src/DLD-FUNCTIONS/rand.cc --- a/src/DLD-FUNCTIONS/rand.cc Mon Dec 04 16:08:30 2006 +0000 +++ b/src/DLD-FUNCTIONS/rand.cc Tue Dec 05 14:06:51 2006 +0000 @@ -809,7 +809,7 @@ %!assert(randp([-inf,-1,0,inf,nan]),[nan,nan,0,nan,nan]); % *** Please report %!test %! % statistical tests may fail occasionally. -%! for a=[5 15] +%! for a=[5 15 1e9] %! x = randp(a,100000,1); %! assert(min(x)>=0); % *** Please report this!!! *** %! assert(mean(x),a,0.03); @@ -819,7 +819,7 @@ %! end %!test %! % statistical tests may fail occasionally. -%! for a=[5 15] +%! for a=[5 15 1e9] %! x = randp(a*ones(100000,1),100000,1); %! assert(min(x)>=0); % *** Please report this!!! *** %! assert(mean(x),a,0.03); @@ -832,7 +832,7 @@ %!assert(randp([-inf,-1,0,inf,nan]),[nan,nan,0,nan,nan]); % *** Please report %!test %! % statistical tests may fail occasionally. -%! for a=[5 15] +%! for a=[5 15 1e9] %! x = randp(a,100000,1); %! assert(min(x)>=0); % *** Please report this!!! *** %! assert(mean(x),a,0.03); @@ -842,7 +842,7 @@ %! end %!test %! % statistical tests may fail occasionally. -%! for a=[5 15] +%! for a=[5 15 1e9] %! x = randp(a*ones(100000,1),100000,1); %! assert(min(x)>=0); % *** Please report this!!! *** %! assert(mean(x),a,0.03);