summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests/Properties.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests/Properties.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests/Properties.hs b/lib/Numeric/LinearAlgebra/Tests/Properties.hs
index 5663b86..b5321c2 100644
--- a/lib/Numeric/LinearAlgebra/Tests/Properties.hs
+++ b/lib/Numeric/LinearAlgebra/Tests/Properties.hs
@@ -39,11 +39,10 @@ module Numeric.LinearAlgebra.Tests.Properties (
39) where 39) where
40 40
41import Numeric.LinearAlgebra 41import Numeric.LinearAlgebra
42import Numeric.LinearAlgebra.Tests.Instances(Sq(..),Her(..),Rot(..))
43import Test.QuickCheck 42import Test.QuickCheck
44import Debug.Trace 43-- import Debug.Trace
45 44
46debug x = trace (show x) x 45-- debug x = trace (show x) x
47 46
48-- relative error 47-- relative error
49dist :: (Normed t, Num t) => t -> t -> Double 48dist :: (Normed t, Num t) => t -> t -> Double
@@ -77,7 +76,7 @@ hermitian m = square m && m |~| ctrans m
77wellCond m = rcond m > 1/100 76wellCond m = rcond m > 1/100
78 77
79positiveDefinite m = minimum (toList e) > 0 78positiveDefinite m = minimum (toList e) > 0
80 where (e,v) = eigSH m 79 where (e,_v) = eigSH m
81 80
82upperTriang m = rows m == 1 || down == z 81upperTriang m = rows m == 1 || down == z
83 where down = fromList $ concat $ zipWith drop [1..] (toLists (ctrans m)) 82 where down = fromList $ concat $ zipWith drop [1..] (toLists (ctrans m))
@@ -107,8 +106,8 @@ pinvProp m = m <> p <> m |~| m
107 106
108detProp m = s d1 |~| s d2 107detProp m = s d1 |~| s d2
109 where d1 = det m 108 where d1 = det m
110 d2 = det' m * det q 109 d2 = det' * det q
111 det' m = product $ toList $ takeDiag r 110 det' = product $ toList $ takeDiag r
112 (q,r) = qr m 111 (q,r) = qr m
113 s x = fromList [x] 112 s x = fromList [x]
114 113
@@ -147,10 +146,10 @@ schurProp2 m = m |~| u <> s <> ctrans u && unitary u && upperHessenberg s -- fix
147 146
148cholProp m = m |~| ctrans c <> c && upperTriang c 147cholProp m = m |~| ctrans c <> c && upperTriang c
149 where c = chol m 148 where c = chol m
150 pos = positiveDefinite m 149 -- pos = positiveDefinite m
151 150
152expmDiagProp m = expm (logm m) :~ 7 ~: complex m 151expmDiagProp m = expm (logm m) :~ 7 ~: complex m
153 where logm m = matFunc log m 152 where logm = matFunc log
154 153
155multProp1 (a,b) = a <> b |~| mulH a b 154multProp1 (a,b) = a <> b |~| mulH a b
156 155