                              (.add a i j (- (first vs)))
                              (recur (inc j) (rest vs)))))
                        a)
-      (instance? Mat x) (.add a -1.0 ^Mat x)
       (same-shape? a x) (do
                           (println "WARNING: Operations with mixed matrices/vectors may not yield the fastest result.")
                           (dotimes [i (.numRows a)]

      :else (error "Incompatible shape.")))
  (matrix-sub! [a x]
    (cond
      (zero-dim? x) (matrix-add! a (- (get-0d x)))
      (instance? Vec x) (.add a -1.0 ^Vec x)
      (is-vector? x)
        (let [size (.size a)]
          (println "WARNING: Operations with mixed matrices/vectors may not yield the fastest result.")

  
(require '[clojure.core.matrix :as m])
(require '[clojure.core.matrix.linear :as l])
(require '[criterium.core :refer [quick-bench]])

(def w 1000)
(def h 1000)
(def numbers (for [_ (range w)]
               (for [_ (range h)]
                 (rand))))

(def clatrix (m/matrix :clatrix numbers))
(def mtj (m/matrix :mtj numbers))

(quick-bench (m/mmul clatrix clatrix))
(quick-bench (m/mmul mtj mtj))

  )
