diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-09-11 09:10:24 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-09-11 09:10:24 +0000 |
commit | ec9965371be5b37234684ba392f55a1a1e24f053 (patch) | |
tree | fae00b984fc8499e19952200f1b3f9f7ee5f2d20 /lib/Numeric/LinearAlgebra/Tests/Properties.hs | |
parent | ae6d18808cef554979b99cc55f46d5324518df01 (diff) |
optimized conjugate
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests/Properties.hs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests/Properties.hs b/lib/Numeric/LinearAlgebra/Tests/Properties.hs index b96f53e..e780c35 100644 --- a/lib/Numeric/LinearAlgebra/Tests/Properties.hs +++ b/lib/Numeric/LinearAlgebra/Tests/Properties.hs | |||
@@ -32,7 +32,7 @@ module Numeric.LinearAlgebra.Tests.Properties ( | |||
32 | svdProp1, svdProp1a, svdProp1b, svdProp2, svdProp3, svdProp4, | 32 | svdProp1, svdProp1a, svdProp1b, svdProp2, svdProp3, svdProp4, |
33 | svdProp5a, svdProp5b, svdProp6a, svdProp6b, svdProp7, | 33 | svdProp5a, svdProp5b, svdProp6a, svdProp6b, svdProp7, |
34 | eigProp, eigSHProp, eigProp2, eigSHProp2, | 34 | eigProp, eigSHProp, eigProp2, eigSHProp2, |
35 | qrProp, rqProp, | 35 | qrProp, rqProp, rqProp1, rqProp2, rqProp3, |
36 | hessProp, | 36 | hessProp, |
37 | schurProp1, schurProp2, | 37 | schurProp1, schurProp2, |
38 | cholProp, | 38 | cholProp, |
@@ -210,15 +210,21 @@ eigSHProp2 m = fst (eigSH m) |~| eigenvaluesSH m | |||
210 | qrProp m = q <> r |~| m && unitary q && upperTriang r | 210 | qrProp m = q <> r |~| m && unitary q && upperTriang r |
211 | where (q,r) = qr m | 211 | where (q,r) = qr m |
212 | 212 | ||
213 | rqProp m = r <> q |~| m && unitary q && utr | 213 | rqProp m = r <> q |~| m && unitary q && upperTriang' r |
214 | where (r,q) = rq m | 214 | where (r,q) = rq m |
215 | upptr f c = buildMatrix f c $ \(r',c') -> if r'-t > c' then 0 else 1 | ||
216 | where t = f-c | ||
217 | utr = upptr (rows r) (cols r) * r |~| r | ||
218 | 215 | ||
219 | upperTriang' m = rows m == 1 || down |~| z | 216 | rqProp1 m = r <> q |~| m |
220 | where down = fromList $ concat $ zipWith drop [1..] (toLists (ctrans m)) | 217 | where (r,q) = rq m |
221 | z = constant 0 (dim down) | 218 | |
219 | rqProp2 m = unitary q | ||
220 | where (r,q) = rq m | ||
221 | |||
222 | rqProp3 m = upperTriang' r | ||
223 | where (r,q) = rq m | ||
224 | |||
225 | upperTriang' r = upptr (rows r) (cols r) * r |~| r | ||
226 | where upptr f c = buildMatrix f c $ \(r',c') -> if r'-t > c' then 0 else 1 | ||
227 | where t = f-c | ||
222 | 228 | ||
223 | hessProp m = m |~| p <> h <> ctrans p && unitary p && upperHessenberg h | 229 | hessProp m = m |~| p <> h <> ctrans p && unitary p && upperHessenberg h |
224 | where (p,h) = hess m | 230 | where (p,h) = hess m |