From e46e5eee74af75aa1123b2370ff2f4587f4adc2a Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 9 Oct 2023 21:37:44 -0600 Subject: flatten directory structure to appease dr koebbe --- src/vector,norm.lisp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/vector,norm.lisp (limited to 'src/vector,norm.lisp') diff --git a/src/vector,norm.lisp b/src/vector,norm.lisp new file mode 100644 index 0000000..aa51bce --- /dev/null +++ b/src/vector,norm.lisp @@ -0,0 +1,14 @@ +(in-package :lizfcm.vector) + +(defun p-norm (p) + (lambda (v) + (expt + (reduce #'+ + (mapcar (lambda (x) + (abs + (expt x p))) + v)) + (/ 1 p)))) + +(defun max-norm (v) + (reduce #'max v)) -- cgit v1.2.3-70-g09d2