diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-03-01 19:58:05 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-03-01 19:58:05 +0100 |
commit | b112f61df9ba7748f6c764c6ae11df7f79e36b19 (patch) | |
tree | 68a8233adf9e0ba5a791963f7440b4e465cb9a77 /packages | |
parent | eed77477c1b6f9383a65c06d96f1d51f8b4e90e7 (diff) | |
parent | 586373e751c77515147f5c109edca5a700e133dc (diff) |
Merge pull request #118 from idontgetoutmuch/master
Add Cholesky to Static.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 037396d..3398e6a 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -52,7 +52,7 @@ module Numeric.LinearAlgebra.Static( | |||
52 | linSolve, (<\>), | 52 | linSolve, (<\>), |
53 | -- * Factorizations | 53 | -- * Factorizations |
54 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), | 54 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), |
55 | withNullspace, qr, | 55 | withNullspace, qr, chol, |
56 | -- * Misc | 56 | -- * Misc |
57 | mean, | 57 | mean, |
58 | Disp(..), Domain(..), | 58 | Disp(..), Domain(..), |
@@ -68,7 +68,7 @@ import Numeric.LinearAlgebra.HMatrix hiding ( | |||
68 | row,col,vector,matrix,linspace,toRows,toColumns, | 68 | row,col,vector,matrix,linspace,toRows,toColumns, |
69 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', | 69 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', |
70 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, | 70 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, |
71 | qr,size,app,mul,dot) | 71 | qr,size,app,mul,dot,chol) |
72 | import qualified Numeric.LinearAlgebra.HMatrix as LA | 72 | import qualified Numeric.LinearAlgebra.HMatrix as LA |
73 | import Data.Proxy(Proxy) | 73 | import Data.Proxy(Proxy) |
74 | import Numeric.LinearAlgebra.Static.Internal | 74 | import Numeric.LinearAlgebra.Static.Internal |
@@ -306,6 +306,9 @@ instance KnownNat n => Eigen (Sq n) (C n) (M n n) | |||
306 | where | 306 | where |
307 | (l,v) = LA.eig m | 307 | (l,v) = LA.eig m |
308 | 308 | ||
309 | chol :: KnownNat n => Sym n -> Sq n | ||
310 | chol (extract . unSym -> m) = mkL $ LA.cholSH m | ||
311 | |||
309 | -------------------------------------------------------------------------------- | 312 | -------------------------------------------------------------------------------- |
310 | 313 | ||
311 | withNullspace | 314 | withNullspace |