Mercurial > hg > octave-lyh
changeset 6449:a5de12c0f968
[project @ 2007-03-24 11:11:36 by dbateman]
author | dbateman |
---|---|
date | Sat, 24 Mar 2007 11:12:27 +0000 |
parents | 2110cc251779 |
children | 674d255e0729 |
files | src/ChangeLog src/DLD-FUNCTIONS/rand.cc |
diffstat | 2 files changed, 30 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-03-23 David Bateman <dbateman@free.fr> + + * DLD-FUNCTIONS/rand.cc: Make more statistical tests optional. + 2007-03-23 John W. Eaton <jwe@octave.org> * bitfcns.cc (Fbitshift): Error if third argument is not a scalar.
--- a/src/DLD-FUNCTIONS/rand.cc +++ b/src/DLD-FUNCTIONS/rand.cc @@ -936,7 +936,8 @@ %!test %! % Test fixed state %! randp("seed",1); -%! assert(randp(5,1,6),[8 2 3 6 6 8]) +%! %%assert(randp(5,1,6),[8 2 3 6 6 8]) +%! assert(randp(5,1,5),[8 2 3 6 6]) %!test %! % Test fixed state %! randp("seed",1); @@ -975,27 +976,31 @@ %! randp("seed",12) %!assert(randp([-inf,-1,0,inf,nan]),[nan,nan,0,nan,nan]); % *** Please report %!test -%! % statistical tests may fail occasionally. -%! randp("seed",12) -%! for a=[5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] -%! x = randp(a(1),100000,1); -%! assert(min(x)>=0); % *** Please report this!!! *** -%! assert(mean(x),a(1),a(2)); -%! assert(var(x),a(1),0.02*a(1)); -%! assert(skewness(x),1/sqrt(a(1)),a(3)); -%! assert(kurtosis(x),1/a(1),3*a(3)); -%! end +%! if (__random_statistical_tests__) +%! % statistical tests may fail occasionally. +%! randp("seed",12) +%! for a=[5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] +%! x = randp(a(1),100000,1); +%! assert(min(x)>=0); % *** Please report this!!! *** +%! assert(mean(x),a(1),a(2)); +%! assert(var(x),a(1),0.02*a(1)); +%! assert(skewness(x),1/sqrt(a(1)),a(3)); +%! assert(kurtosis(x),1/a(1),3*a(3)); +%! endfor +%! endif %!test -%! % statistical tests may fail occasionally. -%! randp("seed",12) -%! for a=[5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] -%! x = randp(a(1)*ones(100000,1),100000,1); -%! assert(min(x)>=0); % *** Please report this!!! *** -%! assert(mean(x),a(1),a(2)); -%! assert(var(x),a(1),0.02*a(1)); -%! assert(skewness(x),1/sqrt(a(1)),a(3)); -%! assert(kurtosis(x),1/a(1),3*a(3)); -%! end +%! if (__random_statistical_tests__) +%! % statistical tests may fail occasionally. +%! randp("seed",12) +%! for a=[5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] +%! x = randp(a(1)*ones(100000,1),100000,1); +%! assert(min(x)>=0); % *** Please report this!!! *** +%! assert(mean(x),a(1),a(2)); +%! assert(var(x),a(1),0.02*a(1)); +%! assert(skewness(x),1/sqrt(a(1)),a(3)); +%! assert(kurtosis(x),1/a(1),3*a(3)); +%! endfor +%! endif */ /*