(defmacro ^Matrix transform-with [A op fun]
`(cond
(is-matrix ~A)
(.assign (.copy ~A) (. DoubleFunctions ~fun))
(and (coll? ~A) (coll? (first ~A)))
(.assign ^Matrix (make-matrix ~A) (. DoubleFunctions ~fun))
(coll? ~A)
(map ~op ~A)
(number? ~A)
(~op ~A)))
Comments top
No comments for transform-with. Log in to add a comment.