;(mod (m1 m2) ; (defun get_col (m idx) ; (if (= idx 0) (f m) (get_col (r m) (- idx 1))) ; ) ; (defun dot_product (r1 r2) ; (if r1 (+ (* (f r1) (f r2)) (dot_product (r r1) (r r2))) ()) ; ) ; (defun column (m idx) ; (if m (c (get_col (f m) idx) (column (r m) idx)) ()) ; ) ; (defun list_len (row) ; (if row (+ 1 (list_len (r row))) 0) ; ) ; (defun width (m) ; (list_len (f m)) ; ) ; (defun transpose_impl (m idx rest) ; (if (= -1 idx) ; rest ; (transpose_impl m (- idx 1) (c (column m idx) rest)) ; ) ; ) ; (defun transpose (m) ; (transpose_impl m (- (width m) 1) ()) ; ) ; (defun mul_row (r1 m1) ; (if m1 (c (dot_product r1 (f m1)) (mul_row r1 (r m1))) ()) ; ) ; (defun matrix_mul_transposed (m1 m2) ; (if m1 (c (mul_row (f m1) m2) (matrix_mul_transposed (r m1) m2)) ()) ; ) ; (defun matrix_mul (m1 m2) ; (matrix_mul_transposed m1 (transpose m2)) ; ) ; ; (matrix_mul m1 m2) ;) (a (q 2 60 (c 2 (c 5 (c 11 (q))))) (c (q (((a (i 5 (q 4 (a 20 (c 2 (c 9 (c 11 (q))))) (a 16 (c 2 (c 13 (c 11 (q)))))) (q 1)) 1) 2 (i 5 (q 16 (* 9 19) (a 24 (c 2 (c 13 (c 27 (q)))))) (q 1)) 1) (a (i (= 11 (q)) (q . 9) (q 2 20 (c 2 (c 13 (c (- 11 (q . 1)) (q)))))) 1) (a (i 5 (q 16 (q . 1) (a 44 (c 2 (c 13 (q))))) (q 1)) 1) 2 18 (c 2 (c 5 (c (a 22 (c 2 (c 11 (q)))) (q))))) ((a (i 5 (q 4 (a 26 (c 2 (c 9 (c 11 (q))))) (a 18 (c 2 (c 13 (c 11 (q)))))) (q 1)) 1) 2 (i 11 (q 4 (a 24 (c 2 (c 5 (c 19 (q))))) (a 26 (c 2 (c 5 (c 27 (q)))))) (q 1)) 1) (a 46 (c 2 (c 5 (c (- (a 62 (c 2 (c 5 (q)))) (q . 1)) (q ()))))) (a (i (= (q . -1) 11) (q . 23) (q 2 46 (c 2 (c 5 (c (- 11 (q . 1)) (c (c (a 16 (c 2 (c 5 (c 11 (q))))) 23) (q))))))) 1) 2 44 (c 2 (c 9 (q)))) 1))