lizfcm/deprecated-cl/vector,norm.lisp

15 lines
275 B
Common Lisp
Raw Permalink Normal View History

2023-09-25 12:36:23 -04:00
(in-package :lizfcm.vector)
(defun p-norm (p)
(lambda (v)
(expt
2023-09-27 11:56:00 -04:00
(reduce #'+
2023-09-25 12:36:23 -04:00
(mapcar (lambda (x)
(abs
(expt x p)))
v))
(/ 1 p))))
(defun max-norm (v)
2023-09-27 11:56:00 -04:00
(reduce #'max v))