Mercurial > hg > octave-lyh
changeset 6998:cc049a392a97
[project @ 2007-10-10 16:51:51 by jwe]
author | jwe |
---|---|
date | Wed, 10 Oct 2007 16:53:23 +0000 |
parents | 6d0d8d621532 |
children | 9325d3f604a3 |
files | scripts/ChangeLog scripts/polynomial/mpoles.m scripts/polynomial/residue.m |
diffstat | 3 files changed, 14 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2007-10-10 Ben Abbott <bpabbott@mac.com> + + * polynomial/mpoles.m: Return indx = ordr(indx), not indx(ordr). + 2007-10-10 John W. Eaton <jwe@octave.org> * general/num2str.m: Always allow for sign for automatically
--- a/scripts/polynomial/mpoles.m +++ b/scripts/polynomial/mpoles.m @@ -107,6 +107,6 @@ n = find (multp == 0, 1); endwhile multp = multp(indx); - indx = indx(ordr); + indx = ordr(indx); endfunction
--- a/scripts/polynomial/residue.m +++ b/scripts/polynomial/residue.m @@ -302,14 +302,14 @@ %! b = [1, 1, 1]; %! a = [1, -5, 8, -4]; %! [r, p, k, e] = residue (b, a); -%! assert ((abs (r - [-2; 7; 3]) < 1e-5 -%! && abs (p - [2; 2; 1]) < 1e-7 -%! && isempty (k) -%! && e == [1; 2; 1])); +%! assert (abs (r - [-2; 7; 3]) < 1e-5 +%! && abs (p - [2; 2; 1]) < 1e-7 +%! && isempty (k) +%! && e == [1; 2; 1]); %! k = [1 0]; %! [b, a] = residue (r, p, k); %! assert ((abs (b - [1, -5, 9, -3, 1]) < 1e-12 -%! && abs (a - [1, -5, 8, -4]) < 1e-12)); +%! && abs (a - [1, -5, 8, -4]) < 1e-12)); %!test %! b = [1, 0, 1]; @@ -318,11 +318,9 @@ %! r1 = [-5i; 12; +5i; 12]/54; %! r2 = conj(r1); %! p1 = [+3i; +3i; -3i; -3i]; -%! p2 = conj(p1); -%! assert ((((abs (r - r1) < 1e-7) && (abs (p - p1) < 1e-7)) -%! || ((abs (r - r2) < 1e-7) && (abs (p - p2) < 1e-7))) -%! && isempty (k) -%! && (e == [1; 2; 1; 2])); +%! assert (abs (r - r1) < 1e-7 && abs (p - p1) < 1e-7 +%! && isempty (k) +%! && e == [1; 2; 1; 2]); %! [br, ar] = residue (r, p, k); %! assert ((abs (br - b) < 1e-12 -%! && abs (ar - a) < 1e-12)); +%! && abs (ar - a) < 1e-12));