1.2.3-SNAPSHOT permalink Arrow_down_16x16

make-matrix

incanter.internal

  • (make-matrix data)
  • (make-matrix data ncol)
  • (make-matrix init-val rows cols)

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/internal.clj:34 top

(defn make-matrix
  ([data]
   (cond
     (coll? (first data))
      (Matrix. (into-array (map double-array data)))
     (number? (first data))
      (Matrix. (double-array data))))
  ([data ncol]
    (cond
      (coll? data)
        (Matrix. (double-array data) ncol)
       (number? data)
        (Matrix. data ncol))) ; data is the number of rows in this case
  ([init-val rows cols]
    (Matrix. rows cols init-val)))
Vars in incanter.internal/make-matrix: coll? cond defn double-array first into-array map number?
Used in 0 other vars

Comments top

No comments for make-matrix. Log in to add a comment.