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

                             (.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
      (instance? Vec x) (.add a -1.0 ^Vec x)
      (zero-dim? x) (matrix-add! a (- (get-0d x)))
      (is-vector? x)
        (let [size (.size a)]
          (println "WARNING: Operations with mixed matrices/vectors may not yield the fastest result.")
