Mercurial > octave-libtiff
changeset 11918:f2af2233ce7f release-3-0-x
polyfit.m: Fixed tests.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 12 Jan 2009 12:14:06 +0100 |
parents | deb777a926ee |
children | 66881d20101d |
files | scripts/ChangeLog scripts/polynomial/polyfit.m |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog Mon Jan 12 12:13:21 2009 +0100 +++ b/scripts/ChangeLog Mon Jan 12 12:14:06 2009 +0100 @@ -1,3 +1,7 @@ +2008-03-04 Ben Abbott <bpabbott@mac.com> + + * polynomial/polyfit.m: Modified tests to respect a relative tolerance. + 2008-02-19 Ben Abbott <bpabbott@mac.com> * polynomial/polyfit.m: Use QR decomposition. Handle
--- a/scripts/polynomial/polyfit.m Mon Jan 12 12:13:21 2009 +0100 +++ b/scripts/polynomial/polyfit.m Mon Jan 12 12:14:06 2009 +0100 @@ -120,8 +120,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; @@ -140,7 +139,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];