Mercurial > hg > octave-terminal
changeset 8912:57c3155754d6
fix condest
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 05 Mar 2009 09:37:59 +0100 |
parents | eeed8d649811 |
children | 35cd375d4bb3 |
files | scripts/ChangeLog scripts/linear-algebra/condest.m |
diffstat | 2 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-03-05 Jaroslav Hajek <highegg@gmail.com> + + * linear-algebra/condest.m: Use lu rather than splu. Use relative tols + for tests. + 2009-03-05 John W. Eaton <jwe@octave.org> * deprecated/spdiag.m: Ensure sparse result.
--- a/scripts/linear-algebra/condest.m +++ b/scripts/linear-algebra/condest.m @@ -163,7 +163,7 @@ if (! have_solve) if (issparse (A)) - [L, U, P, Pc] = splu (A); + [L, U, P, Pc] = lu (A); solve = @(x) Pc' * (U \ (L \ (P * x))); solve_t = @(x) P' * (L' \ (U' \ (Pc * x))); else @@ -203,7 +203,7 @@ %! A = hilb (N); %! cA = condest (A); %! cA_test = norm (inv (A), 1) * norm (A, 1); -%! assert (cA, cA_test, 2^-8); +%! assert (cA, cA_test, -2^-8); %!test %! N = 6; @@ -211,7 +211,7 @@ %! solve = @(x) A\x; solve_t = @(x) A'\x; %! cA = condest (A, solve, solve_t); %! cA_test = norm (inv (A), 1) * norm (A, 1); -%! assert (cA, cA_test, 2^-8); +%! assert (cA, cA_test, -2^-8); %!test %! N = 6; @@ -220,7 +220,7 @@ %! solve = @(x) A\x; solve_t = @(x) A'\x; %! cA = condest (apply, apply_t, solve, solve_t, N); %! cA_test = norm (inv (A), 1) * norm (A, 1); -%! assert (cA, cA_test, 2^-6); +%! assert (cA, cA_test, -2^-6); %!test %! N = 12;