diff options
Diffstat (limited to 'packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs | 12 |
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 | ||
45 | import Numeric.LinearAlgebra.HMatrix hiding (Testable,unitary) | 45 | import Numeric.LinearAlgebra.HMatrix hiding (Testable,unitary) |
@@ -209,11 +209,11 @@ eigProp m = complex m <> v |~| v <> diag s | |||
209 | eigSHProp m = m <> v |~| v <> real (diag s) | 209 | eigSHProp 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 | ||
214 | eigProp2 m = fst (eig m) |~| eigenvalues m | 214 | eigProp2 m = fst (eig m) |~| eigenvalues m |
215 | 215 | ||
216 | eigSHProp2 m = fst (eigSH m) |~| eigenvaluesSH m | 216 | eigSHProp2 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 | ||
248 | cholProp m = m |~| tr c <> c && upperTriang c | 248 | cholProp m = m |~| tr c <> c && upperTriang c |
249 | where c = chol m | 249 | where c = chol (trustSym m) |
250 | 250 | ||
251 | exactProp m = chol m == chol (m+0) | 251 | exactProp m = chol (trustSym m) == chol (trustSym (m+0)) |
252 | 252 | ||
253 | expmDiagProp m = expm (logm m) :~ 7 ~: complex m | 253 | expmDiagProp 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 | ||
264 | linearSolveProp f m = f m m |~| ident (rows m) | 264 | linearSolveProp f m = f m m |~| ident (rows m) |
265 | 265 | ||
266 | linearSolvePropH f m = f m (her m) |~| ident (rows (her m)) | ||
267 | |||
266 | linearSolveProp2 f (a,x) = not wc `trivial` (not wc || a <> f a b |~| b) | 268 | linearSolveProp2 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 |