1.2.3-SNAPSHOT Arrow_down_16x16

to-vect

incanter.core

  • (to-vect mat)
Returns a vector-of-vectors if the given matrix is two-dimensional
and a flat vector if the matrix is one-dimensional. This is a bit
slower than the to-list function.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/core.clj:1043 top

(defn to-vect
  " Returns a vector-of-vectors if the given matrix is two-dimensional
    and a flat vector if the matrix is one-dimensional. This is a bit
    slower than the to-list function. "
 ([^Matrix mat]
  (into [] (cond
             (= (.columns mat) 1)
              (first (map #(into [] (seq %)) (seq (.toArray (.viewDice mat)))))
             (= (.rows mat) 1)
              (first (map #(into [] (seq %)) (seq (.toArray mat))))
             :else
              (map #(into [] (seq %)) (seq (.toArray mat)))))))
Vars in incanter.core/to-vect: = cond defn first into map seq
Used in 0 other vars

Comments top

No comments for to-vect. Log in to add a comment.