1.2.3-SNAPSHOT permalink Arrow_down_16x16
  • (solve A & B)
Returns a matrix solution if A is square, least squares solution otherwise.
Equivalent to R's solve function.

Examples:
(solve (matrix [[2 0 0] [0 2 0] [0 0 2]]))

References:
http://en.wikipedia.org/wiki/Matrix_inverse


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

(defn solve
" Returns a matrix solution if A is square, least squares solution otherwise.
  Equivalent to R's solve function.

  Examples:
    (solve (matrix [[2 0 0] [0 2 0] [0 0 2]]))

  References:
    http://en.wikipedia.org/wiki/Matrix_inverse


"
  ([^Matrix A & B]
   (if B
    (Matrix. (.solve (DenseDoubleAlgebra.) A (first B)))
    (Matrix. (.inverse (DenseDoubleAlgebra.) A)))))
Vars in incanter.core/solve: defn first
Used in 0 other vars

Comments top

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