1.2.3-SNAPSHOT permalink Arrow_down_16x16

decomp-lu

incanter.core

  • (decomp-lu mat)
Returns the LU decomposition of the given matrix.


Examples:

(use 'incanter.core)
(def foo (matrix (range 9) 3))
(decomp-lu foo)


Returns:
a map containing:
:L -- the lower triangular factor
:U -- the upper triangular factor

References:
http://en.wikipedia.org/wiki/LU_decomposition
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/decomposition/DoubleLUDecomposition.html

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

(defn decomp-lu
" Returns the LU decomposition of the given matrix.


  Examples:

  (use 'incanter.core)
  (def foo (matrix (range 9) 3))
  (decomp-lu foo)


  Returns:
    a map containing:
      :L -- the lower triangular factor
      :U -- the upper triangular factor

  References:
    http://en.wikipedia.org/wiki/LU_decomposition
    http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/decomposition/DoubleLUDecomposition.html
"
  ([mat]
    (let [result (DenseDoubleLUDecomposition. mat)]
      {:L (Matrix. (.getL result))
       :U (Matrix. (.getU result))})))
Vars in incanter.core/decomp-lu: defn let
Used in 0 other vars

Comments top

No comments for decomp-lu. Log in to add a comment.