Paste number 52200: matrix multiply

Paste number 52200: matrix multiply
Pasted by: faxathisia
7 months, 4 weeks ago
#lispcafe | Context in IRC logs
Paste contents:
Raw Source | XML | Display As
(defun matrix-multiply (a b)
  (flet ((col (mat i) (mapcar #'(lambda (row) (elt row i)) mat))
         (row (mat i) (elt mat i))
)

    (loop for row from 0 below (length a)
          collect (loop for col from 0 below (length (row b 0))
                        collect (apply #'+ (mapcar #'* (row a row) (col b col)))
)
)
)
)


This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.