Mercurial > hg > octave-lojdl
changeset 1478:d23a476a93b8
[project @ 1995-09-26 07:48:05 by jwe]
author | jwe |
---|---|
date | Tue, 26 Sep 1995 07:48:05 +0000 |
parents | 774f8fe3798e |
children | f362012138a7 |
files | scripts/linear-algebra/norm.m |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/linear-algebra/norm.m +++ b/scripts/linear-algebra/norm.m @@ -29,6 +29,7 @@ # 1 1-norm, the largest column sum of x # 2 largest singular value of x # Inf infinity norm, the largest row sum of x +# "inf" same as Inf # "fro" Frobenius norm of x, sqrt (sum (diag (x' * x))) # # If x is a vector or a scalar: @@ -60,6 +61,8 @@ if (isstr (p)) if (strcmp (p, "fro")) retval = sqrt (sum (diag (x' * x))); + elseif (strcmp (p, "inf")) + retval = max (abs (x)); else error ("norm: unrecognized norm"); endif