diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests/Properties.hs | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests/Properties.hs b/lib/Numeric/LinearAlgebra/Tests/Properties.hs index 0317469..0563e62 100644 --- a/lib/Numeric/LinearAlgebra/Tests/Properties.hs +++ b/lib/Numeric/LinearAlgebra/Tests/Properties.hs | |||
@@ -9,13 +9,33 @@ Maintainer : Alberto Ruiz (aruiz at um dot es) | |||
9 | Stability : provisional | 9 | Stability : provisional |
10 | Portability : portable | 10 | Portability : portable |
11 | 11 | ||
12 | Arbitrary instances for vectors, matrices. | 12 | Testing properties. |
13 | 13 | ||
14 | -} | 14 | -} |
15 | 15 | ||
16 | module Numeric.LinearAlgebra.Tests.Properties | 16 | module Numeric.LinearAlgebra.Tests.Properties ( |
17 | 17 | dist, (|~|), (~:), Aprox((:~)), | |
18 | where | 18 | zeros, ones, |
19 | square, | ||
20 | unitary, | ||
21 | hermitian, | ||
22 | wellCond, | ||
23 | positiveDefinite, | ||
24 | upperTriang, | ||
25 | upperHessenberg, | ||
26 | luProp, | ||
27 | invProp, | ||
28 | pinvProp, | ||
29 | detProp, | ||
30 | nullspaceProp, | ||
31 | svdProp1, svdProp2, | ||
32 | eigProp, eigSHProp, | ||
33 | qrProp, | ||
34 | hessProp, | ||
35 | schurProp1, schurProp2, | ||
36 | cholProp, | ||
37 | expmDiagProp | ||
38 | ) where | ||
19 | 39 | ||
20 | import Numeric.LinearAlgebra | 40 | import Numeric.LinearAlgebra |
21 | import Numeric.LinearAlgebra.Tests.Instances(Sq(..),Her(..),Rot(..)) | 41 | import Numeric.LinearAlgebra.Tests.Instances(Sq(..),Her(..),Rot(..)) |
@@ -50,8 +70,6 @@ unitary m = square m && m <> ctrans m |~| ident (rows m) | |||
50 | 70 | ||
51 | hermitian m = square m && m |~| ctrans m | 71 | hermitian m = square m && m |~| ctrans m |
52 | 72 | ||
53 | degenerate m = rank m < min (rows m) (cols m) | ||
54 | |||
55 | wellCond m = rcond m > 1/100 | 73 | wellCond m = rcond m > 1/100 |
56 | 74 | ||
57 | positiveDefinite m = minimum (toList e) > 0 | 75 | positiveDefinite m = minimum (toList e) > 0 |
@@ -125,3 +143,7 @@ schurProp2 m = m |~| u <> s <> ctrans u && unitary u && upperHessenberg s -- fix | |||
125 | cholProp m = m |~| ctrans c <> c && upperTriang c | 143 | cholProp m = m |~| ctrans c <> c && upperTriang c |
126 | where c = chol m | 144 | where c = chol m |
127 | pos = positiveDefinite m | 145 | pos = positiveDefinite m |
146 | |||
147 | expmDiagProp m = expm (logm m) |~| complex m | ||
148 | where logm m = matFunc log m | ||
149 | |||