1.2.3-SNAPSHOT Arrow_down_16x16

decomp-qr

incanter.core

  • (decomp-qr mat)
Returns the QR decomposition of the given matrix. Equivalent to R's qr function.


Examples:

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



Returns:
a map containing:
:Q -- orthogonal factor
:R -- the upper triangular factor

References:
http://en.wikipedia.org/wiki/QR_decomposition
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/decomposition/DenseDoubleQRDecomposition.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:971 top

(defn decomp-qr
" Returns the QR decomposition of the given matrix. Equivalent to R's qr function.


  Examples:

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



  Returns:
    a map containing:
      :Q -- orthogonal factor
      :R -- the upper triangular factor

  References:
    http://en.wikipedia.org/wiki/QR_decomposition
    http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/decomposition/DenseDoubleQRDecomposition.html
"
  ([mat]
    (let [result (DenseDoubleQRDecomposition. mat)]
      {:Q (Matrix. (.getQ result false))
       :R (Matrix. (.getR result false))})))
Vars in incanter.core/decomp-qr: defn let
Used in 0 other vars

Comments top

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