Mercurial > hg > octave-shane
changeset 3801:bc61e418f200
[project @ 2001-02-23 02:13:10 by jwe]
author | jwe |
---|---|
date | Fri, 23 Feb 2001 02:13:11 +0000 |
parents | 115cbfcd067e |
children | 4f1a26a730fd |
files | scripts/ChangeLog scripts/linear-algebra/norm.m |
diffstat | 2 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,12 @@ +2001-02-22 John W. Eaton <jwe@bevo.che.wisc.edu> + + * linear-algebra/norm.m: Use sqrt instead of ^0.5. + +2001-02-22 Heinz Bauschke <bauschke@cecm.sfu.ca> + + * linear-algebra/norm.m: Use more efficient method for Frobenius + norm. + 2001-02-09 David Livings <david.livings@asa.co.uk> * statistics/tests/welch_test.m: Fix typo.
--- a/scripts/linear-algebra/norm.m +++ b/scripts/linear-algebra/norm.m @@ -75,7 +75,7 @@ if (nargin == 2) if (isstr (p)) if (strcmp (p, "fro")) - retval = sqrt (sum (diag (x' * x))); + retval = sqrt (sum (abs (x) .^ 2)); elseif (strcmp (p, "inf")) retval = max (abs (x)); else @@ -91,7 +91,7 @@ endif endif elseif (nargin == 1) - retval = sum (abs (x) .^ 2) ^ 0.5; + retval = sqrt (sum (abs (x) .^ 2)); endif else @@ -99,7 +99,7 @@ if (nargin == 2) if (isstr (p)) if (strcmp (p, "fro")) - retval = sqrt (sum (diag (x' * x))); + retval = sqrt (sum (sum (abs (x) .^ 2))); elseif (strcmp (p, "inf")) retval = max (sum (abs (x'))); else