1.2.3-SNAPSHOT permalink Arrow_down_16x16
  • (mult & args)
Performs element-by-element multiplication on multiple matrices, sequences
and/or numbers. Equivalent to R's * operator.

Examples:

(def A (matrix [[1 2 3]
[4 5 6]
[7 8 9]]))
(mult A A A)
(mult A 2)
(mult 2 A)
(mult [1 2 3] [1 2 3])
(mult [1 2 3] 2)
(mult 2 [1 2 3])


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:451 top

(defn mult
"   Performs element-by-element multiplication on multiple matrices, sequences
    and/or numbers. Equivalent to R's * operator.

    Examples:

      (def A (matrix [[1 2 3]
                      [4 5 6]
                      [7 8 9]]))
      (mult A A A)
      (mult A 2)
      (mult 2 A)
      (mult [1 2 3] [1 2 3])
      (mult [1 2 3] 2)
      (mult 2 [1 2 3])


"
   ([& args] (reduce (fn [A B] (combine-with A B clojure.core/* mult)) args)))
Vars in incanter.core/mult: defn fn reduce *
Used in 0 other vars

Comments top

No comments for mult. Log in to add a comment.