summaryrefslogtreecommitdiff
path: root/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-07-16 20:16:59 +0200
committerAlberto Ruiz <aruiz@um.es>2015-07-16 20:16:59 +0200
commita273fdb74b04db6d57d5c9b15e676d83357e71fd (patch)
tree99189532f2a37129a7ec3696f681ff3fd3314950 /packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
parentd9c99a670a393fb232641183623a7fa5921ccff2 (diff)
Her, LU, LDL, Linear, Additive
Diffstat (limited to 'packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
index 207a303..2ac3588 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
@@ -39,7 +39,7 @@ module Numeric.LinearAlgebra.Tests.Properties (
39 expmDiagProp, 39 expmDiagProp,
40 multProp1, multProp2, 40 multProp1, multProp2,
41 subProp, 41 subProp,
42 linearSolveProp, linearSolveProp2 42 linearSolveProp, linearSolvePropH, linearSolveProp2
43) where 43) where
44 44
45import Numeric.LinearAlgebra.HMatrix hiding (Testable,unitary) 45import Numeric.LinearAlgebra.HMatrix hiding (Testable,unitary)
@@ -209,11 +209,11 @@ eigProp m = complex m <> v |~| v <> diag s
209eigSHProp m = m <> v |~| v <> real (diag s) 209eigSHProp m = m <> v |~| v <> real (diag s)
210 && unitary v 210 && unitary v
211 && m |~| v <> real (diag s) <> tr v 211 && m |~| v <> real (diag s) <> tr v
212 where (s, v) = eigSH m 212 where (s, v) = eigSH' m
213 213
214eigProp2 m = fst (eig m) |~| eigenvalues m 214eigProp2 m = fst (eig m) |~| eigenvalues m
215 215
216eigSHProp2 m = fst (eigSH m) |~| eigenvaluesSH m 216eigSHProp2 m = fst (eigSH' m) |~| eigenvaluesSH' m
217 217
218------------------------------------------------------------------ 218------------------------------------------------------------------
219 219
@@ -246,9 +246,9 @@ schurProp2 m = m |~| u <> s <> tr u && unitary u && upperHessenberg s -- fixme
246 where (u,s) = schur m 246 where (u,s) = schur m
247 247
248cholProp m = m |~| tr c <> c && upperTriang c 248cholProp m = m |~| tr c <> c && upperTriang c
249 where c = chol m 249 where c = chol (trustSym m)
250 250
251exactProp m = chol m == chol (m+0) 251exactProp m = chol (trustSym m) == chol (trustSym (m+0))
252 252
253expmDiagProp m = expm (logm m) :~ 7 ~: complex m 253expmDiagProp m = expm (logm m) :~ 7 ~: complex m
254 where logm = matFunc log 254 where logm = matFunc log
@@ -263,6 +263,8 @@ multProp2 p (a,b) = (tr (a <> b)) :~p~: (tr b <> tr a)
263 263
264linearSolveProp f m = f m m |~| ident (rows m) 264linearSolveProp f m = f m m |~| ident (rows m)
265 265
266linearSolvePropH f m = f m (her m) |~| ident (rows (her m))
267
266linearSolveProp2 f (a,x) = not wc `trivial` (not wc || a <> f a b |~| b) 268linearSolveProp2 f (a,x) = not wc `trivial` (not wc || a <> f a b |~| b)
267 where q = min (rows a) (cols a) 269 where q = min (rows a) (cols a)
268 b = a <> x 270 b = a <> x