Mercurial > hg > octave-terminal
changeset 8468:866492035ecf
fsolve.m, fzero.m: undo part of previous change
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 12 Jan 2009 13:32:12 -0500 |
parents | 77b8d4aa2743 |
children | 830a03b5f165 |
files | scripts/optimization/fsolve.m scripts/optimization/fzero.m |
diffstat | 2 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/optimization/fsolve.m +++ b/scripts/optimization/fsolve.m @@ -119,7 +119,7 @@ m = length (fvec); n = length (x); if (m < n) - error ("fsolve: cannot solve underdetermined systems"); + error ("fsolve:under", "cannot solve underdetermined systems"); elseif (m > n && niter == 1) if (isempty (optimget (options, "TolFun"))) warning ("an overdetermined system cannot usually be solved exactly; consider specifying the TolFun option"); @@ -282,9 +282,9 @@ function fx = guarded_eval (fun, x) fx = fun (x); if (! all (isreal (fx))) - error ("fsolve: non-real value encountered"); + error ("fsolve:notreal", "fsolve: non-real value encountered"); elseif (any (isnan (fx))) - error ("fsolve: NaN value encountered"); + error ("fsolve:isnan", "fsolve: NaN value encountered"); endif endfunction @@ -361,4 +361,3 @@ %! assert (info > 0); %! assert (norm (x - x_opt, Inf) < tol); %! assert (norm (fval) < tol); -
--- a/scripts/optimization/fzero.m +++ b/scripts/optimization/fzero.m @@ -124,7 +124,7 @@ endif if (! (sign (fa) * sign (fb) <= 0)) - error ("fzero: not a valid initial bracketing"); + error ("fzero:bracket", "fzero: not a valid initial bracketing"); endif itype = 1; @@ -242,7 +242,7 @@ break; else ## this should never happen. - error ("fzero: zero point is not bracketed"); + error ("fzero:bracket", "fzero: zero point is not bracketed"); endif ## if there's an output function, use it now @@ -288,9 +288,9 @@ fx = fun (x); fx = fx(1); if (! isreal (fx)) - error ("fzero: non-real value encountered"); + error ("fzero:notreal", "fzero: non-real value encountered"); elseif (isnan (fx)) - error ("fzero: NaN value encountered"); + error ("fzero:isnan", "fzero: NaN value encountered"); endif endfunction