Mercurial > hg > octave-shane
changeset 7547:40ca9fb9a314
polyfit.m: Fixed tests.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Tue, 04 Mar 2008 14:02:53 -0500 |
parents | 4249c6fb6e09 |
children | 9cbf1e2011a3 |
files | scripts/ChangeLog scripts/polynomial/polyfit.m |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-03-04 Ben Abbott <bpabbott@mac.com> + + * polynomial/polyfit.m: Modified tests to respect a relative tolerance. + 2008-02-29 John W. Eaton <jwe@octave.org> * plot/print.m: Handle gif and jpg devices.
--- a/scripts/polynomial/polyfit.m +++ b/scripts/polynomial/polyfit.m @@ -140,8 +140,7 @@ %! 315600.7143, 315602.9508, 315605.1765 ]; %! [p1, s1] = polyfit (x, y, 10); %! [p2, s2, mu] = polyfit (x, y, 10); -%! assert (s1.normr, 0.11264, 0.1) -%! assert (s2.normr < s1.normr) +%! assert (2*s2.normr < s1.normr) %!test %! x = 1:4; @@ -160,7 +159,7 @@ %! assert (p, pn, s.normr) %! assert (s.yf, y, s.normr) %! assert (mu, [mean(x), std(x)]) -%! assert (s.normr/s2.normr < 1e-9) +%! assert (s.normr/s2.normr < sqrt(eps)) %!test %! x = [1, 2, 3; 4, 5, 6];