Blob


1 (defun dot-product (v w)
2 (accumulate #'+ 0 (mapcar #'* v w)))
3 (defun matrix-*-vector (m v)
4 (mapcar
5 (lambda (row)
6 (dot-product row v))
7 m))
8 (defun transpose (m)
9 (accumulate-n #'cons nil m))
10 (defun matrix-*-matrix (m n)
11 (let ((n-t (transpose n)))
12 (mapcar (lambda (row)
13 (matrix-*-vector n-t row))
14 m)))