changeset 6951:f359defe99ff

[project @ 2007-10-03 21:08:32 by jwe]
author jwe
date Wed, 03 Oct 2007 21:09:37 +0000
parents 4fa8d8a804fb
children 09a89fb42c09
files scripts/ChangeLog scripts/linear-algebra/norm.m
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Oct 03 19:46:26 2007 +0000
+++ b/scripts/ChangeLog	Wed Oct 03 21:09:37 2007 +0000
@@ -1,3 +1,7 @@
+2007-10-03  Quentin Spencer  <qspencer@ieee.org>
+
+	* linear-algebra/norm.m: Special case vector 1-norm.
+
 2007-10-03  David Bateman  <dbateman@free.fr>
 
 	* pkg/pkg.m (is_architecture_dependent): New function to identify
--- a/scripts/linear-algebra/norm.m	Wed Oct 03 19:46:26 2007 +0000
+++ b/scripts/linear-algebra/norm.m	Wed Oct 03 21:09:37 2007 +0000
@@ -93,6 +93,8 @@
           retval = max (abs (x));
         elseif (p == -Inf)
           retval = min (abs (x));
+	elseif (p == 1)
+	  retval = sum (abs (x));
         else
           retval = sum (abs (x) .^ p) ^ (1/p);
         endif