diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-04-07 07:18:41 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-04-07 07:18:41 +0000 |
commit | bc854c679c77cbdc97ee2e24383322550109118d (patch) | |
tree | 903f8cce6d3dfbca8a7f6ca80fbe3b080102c046 /lib/Numeric/LinearAlgebra/Algorithms.hs | |
parent | 2e48ffd1a395817288b8271299eebd0e483407af (diff) |
mbCholSH
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Algorithms.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 14 |
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' | |||
263 | eigenvalues :: Field t => Matrix t -> Vector (Complex Double) | 266 | eigenvalues :: Field t => Matrix t -> Vector (Complex Double) |
264 | eigenvalues = eigOnly | 267 | eigenvalues = 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. |
267 | eigSH' :: Field t => Matrix t -> (Vector Double, Matrix t) | 270 | eigSH' :: Field t => Matrix t -> (Vector Double, Matrix t) |
268 | eigSH' = eigSH'' | 271 | eigSH' = 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. |
271 | eigenvaluesSH' :: Field t => Matrix t -> Vector Double | 274 | eigenvaluesSH' :: Field t => Matrix t -> Vector Double |
272 | eigenvaluesSH' = eigOnlySH | 275 | eigenvaluesSH' = eigOnlySH |
273 | 276 | ||
@@ -328,8 +331,11 @@ ctrans = ctrans' | |||
328 | multiply :: Field t => Matrix t -> Matrix t -> Matrix t | 331 | multiply :: Field t => Matrix t -> Matrix t -> Matrix t |
329 | multiply = multiply' | 332 | multiply = multiply' |
330 | 333 | ||
334 | -- | Similar to 'cholSH', but instead of an error (e.g., caused by a matrix not positive definite) it returns 'Nothing'. | ||
335 | mbCholSH :: Field t => Matrix t -> Maybe (Matrix t) | ||
336 | mbCholSH = 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. |
333 | cholSH :: Field t => Matrix t -> Matrix t | 339 | cholSH :: Field t => Matrix t -> Matrix t |
334 | cholSH = cholSH' | 340 | cholSH = cholSH' |
335 | 341 | ||