Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,7 +1,7 @@
|
|||
(defun matrix* (matrix-1 matrix-2)
|
||||
(list-comp
|
||||
((<- a matrix-1))
|
||||
(list-comp
|
||||
((<- b (transpose matrix-2)))
|
||||
(lists:foldl #'+/2 0
|
||||
(lists:zipwith #'*/2 a b)))))
|
||||
(defun matrix*-map (m1 m2)
|
||||
(let ((m2T (transpose m2)))
|
||||
(lists:map
|
||||
(lambda (row)
|
||||
(lists:map (lambda (col) (dot-product row col))
|
||||
m2T))
|
||||
m1)))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
> (set ma '((1 2)
|
||||
(3 4)
|
||||
(5 6)
|
||||
(7 8)))
|
||||
((1 2) (3 4) (5 6) (7 8))
|
||||
> (set mb (transpose ma))
|
||||
((1 3 5 7) (2 4 6 8))
|
||||
> (matrix* ma mb)
|
||||
((5 11 17 23) (11 25 39 53) (17 39 61 83) (23 53 83 113))
|
||||
(defun matrix*-lc (m1 m2)
|
||||
(let ((m2T (transpose m2)))
|
||||
(list-comp
|
||||
((<- row m1))
|
||||
(list-comp
|
||||
((<- col m2T))
|
||||
(dot-product row col)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue