summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Algorithms.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-04-07 07:18:41 +0000
committerAlberto Ruiz <aruiz@um.es>2010-04-07 07:18:41 +0000
commitbc854c679c77cbdc97ee2e24383322550109118d (patch)
tree903f8cce6d3dfbca8a7f6ca80fbe3b080102c046 /lib/Numeric/LinearAlgebra/Algorithms.hs
parent2e48ffd1a395817288b8271299eebd0e483407af (diff)
mbCholSH
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Algorithms.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Algorithms.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs
index aa18d37..60f5971 100644
--- a/lib/Numeric/LinearAlgebra/Algorithms.hs
+++ b/lib/Numeric/LinearAlgebra/Algorithms.hs
@@ -46,7 +46,7 @@ module Numeric.LinearAlgebra.Algorithms (
46-- ** QR 46-- ** QR
47 qr, rq, 47 qr, rq,
48-- ** Cholesky 48-- ** Cholesky
49 chol, cholSH, 49 chol, cholSH, mbCholSH,
50-- ** Hessenberg 50-- ** Hessenberg
51 hess, 51 hess,
52-- ** Schur 52-- ** Schur
@@ -100,6 +100,7 @@ class (Normed (Matrix t), Linear Vector t, Linear Matrix t) => Field t where
100 eigOnly :: Matrix t -> Vector (Complex Double) 100 eigOnly :: Matrix t -> Vector (Complex Double)
101 eigOnlySH :: Matrix t -> Vector Double 101 eigOnlySH :: Matrix t -> Vector Double
102 cholSH' :: Matrix t -> Matrix t 102 cholSH' :: Matrix t -> Matrix t
103 mbCholSH' :: Matrix t -> Maybe (Matrix t)
103 qr' :: Matrix t -> (Matrix t, Matrix t) 104 qr' :: Matrix t -> (Matrix t, Matrix t)
104 hess' :: Matrix t -> (Matrix t, Matrix t) 105 hess' :: Matrix t -> (Matrix t, Matrix t)
105 schur' :: Matrix t -> (Matrix t, Matrix t) 106 schur' :: Matrix t -> (Matrix t, Matrix t)
@@ -123,6 +124,7 @@ instance Field Double where
123 eigOnly = eigOnlyR 124 eigOnly = eigOnlyR
124 eigOnlySH = eigOnlyS 125 eigOnlySH = eigOnlyS
125 cholSH' = cholS 126 cholSH' = cholS
127 mbCholSH' = mbCholS
126 qr' = unpackQR . qrR 128 qr' = unpackQR . qrR
127 hess' = unpackHess hessR 129 hess' = unpackHess hessR
128 schur' = schurR 130 schur' = schurR
@@ -149,6 +151,7 @@ instance Field (Complex Double) where
149 eigSH'' = eigH 151 eigSH'' = eigH
150 eigOnlySH = eigOnlyH 152 eigOnlySH = eigOnlyH
151 cholSH' = cholH 153 cholSH' = cholH
154 mbCholSH' = mbCholH
152 qr' = unpackQR . qrC 155 qr' = unpackQR . qrC
153 hess' = unpackHess hessC 156 hess' = unpackHess hessC
154 schur' = schurC 157 schur' = schurC
@@ -263,11 +266,11 @@ eig = eig'
263eigenvalues :: Field t => Matrix t -> Vector (Complex Double) 266eigenvalues :: Field t => Matrix t -> Vector (Complex Double)
264eigenvalues = eigOnly 267eigenvalues = eigOnly
265 268
266-- | Similar to 'eigSH' without checking that the input matrix is hermitian or symmetric. 269-- | Similar to 'eigSH' without checking that the input matrix is hermitian or symmetric. It works with the upper triangular part.
267eigSH' :: Field t => Matrix t -> (Vector Double, Matrix t) 270eigSH' :: Field t => Matrix t -> (Vector Double, Matrix t)
268eigSH' = eigSH'' 271eigSH' = eigSH''
269 272
270-- | Similar to 'eigenvaluesSH' without checking that the input matrix is hermitian or symmetric. 273-- | Similar to 'eigenvaluesSH' without checking that the input matrix is hermitian or symmetric. It works with the upper triangular part.
271eigenvaluesSH' :: Field t => Matrix t -> Vector Double 274eigenvaluesSH' :: Field t => Matrix t -> Vector Double
272eigenvaluesSH' = eigOnlySH 275eigenvaluesSH' = eigOnlySH
273 276
@@ -328,8 +331,11 @@ ctrans = ctrans'
328multiply :: Field t => Matrix t -> Matrix t -> Matrix t 331multiply :: Field t => Matrix t -> Matrix t -> Matrix t
329multiply = multiply' 332multiply = multiply'
330 333
334-- | Similar to 'cholSH', but instead of an error (e.g., caused by a matrix not positive definite) it returns 'Nothing'.
335mbCholSH :: Field t => Matrix t -> Maybe (Matrix t)
336mbCholSH = mbCholSH'
331 337
332-- | Similar to 'chol' without checking that the input matrix is hermitian or symmetric. 338-- | Similar to 'chol', without checking that the input matrix is hermitian or symmetric. It works with the upper triangular part.
333cholSH :: Field t => Matrix t -> Matrix t 339cholSH :: Field t => Matrix t -> Matrix t
334cholSH = cholSH' 340cholSH = cholSH'
335 341