Logo

Programming-Idioms

Perform matrix multiplication of a real matrix a with nx rows and ny columns, a real matrix b with ny rows and nz columns and assign the value to a real matrix c with nx rows and nz columns.
New implementation

Type ahead, or select one

Explain stuff

To emphasize a name: _x → x

Please be fair if you are using someone's work

You agree to publish under the CC-BY-SA License

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
(defn t [x] (apply (partial mapv vector) x))
(defn v* [u v] (reduce + (mapv * u v)))
(defn shape [a] (comp (partition-all (count a)) (map vec)))

(defn mm [a b]
    (into [] (shape a)
        (for [line a col (t b)]
            (v* line col))))

(def c (mm a b))