summaryrefslogtreecommitdiff
path: root/packages/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tests/src')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests.hs6
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs13
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs2
3 files changed, 10 insertions, 11 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
index 30480d7..ecda6c1 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
@@ -500,10 +500,10 @@ sliceTest = utest "slice test" $ and
500 , testSlice (test_qrgr 4 tau2) qrr2 500 , testSlice (test_qrgr 4 tau2) qrr2
501 ] 501 ]
502 where 502 where
503 (qrr1,tau1) = qrRaw (rec :: Matrix R) 503 QR qrr1 tau1 = qrRaw (rec :: Matrix R)
504 (qrr2,tau2) = qrRaw (rec :: Matrix C) 504 QR qrr2 tau2 = qrRaw (rec :: Matrix C)
505 505
506 test_qrgr n t x = qrgr n (x,t) 506 test_qrgr n t x = qrgr n (QR x t)
507 507
508 ok_qrgr x = simeq 1E-15 q q' 508 ok_qrgr x = simeq 1E-15 q q'
509 where 509 where
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs
index 4704989..3d5441d 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs
@@ -81,8 +81,7 @@ instance (Field a, Arbitrary a) => Arbitrary (Rot a) where
81 81
82 82
83-- a complex hermitian or real symmetric matrix 83-- a complex hermitian or real symmetric matrix
84--newtype (Her a) = Her (Matrix a) deriving Show 84instance (Field a, Arbitrary a, Num (Vector a)) => Arbitrary (Herm a) where
85instance (Field a, Arbitrary a, Num (Vector a)) => Arbitrary (Her a) where
86 arbitrary = do 85 arbitrary = do
87 Sq m <- arbitrary 86 Sq m <- arbitrary
88 let m' = m/2 87 let m' = m/2
@@ -127,7 +126,7 @@ instance (Numeric a, ArbitraryField a, Num (Vector a))
127 arbitrary = do 126 arbitrary = do
128 m <- arbitrary 127 m <- arbitrary
129 let (_,v) = eigSH m 128 let (_,v) = eigSH m
130 n = rows (her m) 129 n = rows (unSym m)
131 l <- replicateM n (choose (0,100)) 130 l <- replicateM n (choose (0,100))
132 let s = diag (fromList l) 131 let s = diag (fromList l)
133 p = v <> real s <> tr v 132 p = v <> real s <> tr v
@@ -161,8 +160,8 @@ fM m = m :: FM
161zM m = m :: ZM 160zM m = m :: ZM
162 161
163 162
164rHer m = her m :: RM 163rHer m = unSym m :: RM
165cHer m = her m :: CM 164cHer m = unSym m :: CM
166 165
167rRot (Rot m) = m :: RM 166rRot (Rot m) = m :: RM
168cRot (Rot m) = m :: CM 167cRot (Rot m) = m :: CM
@@ -176,8 +175,8 @@ cWC (WC m) = m :: CM
176rSqWC (SqWC m) = m :: RM 175rSqWC (SqWC m) = m :: RM
177cSqWC (SqWC m) = m :: CM 176cSqWC (SqWC m) = m :: CM
178 177
179rSymWC (SqWC m) = sym m :: Her R 178rSymWC (SqWC m) = sym m :: Herm R
180cSymWC (SqWC m) = sym m :: Her C 179cSymWC (SqWC m) = sym m :: Herm C
181 180
182rPosDef (PosDef m) = m :: RM 181rPosDef (PosDef m) = m :: RM
183cPosDef (PosDef m) = m :: CM 182cPosDef (PosDef m) = m :: CM
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
index 2ac3588..720b7bd 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
@@ -263,7 +263,7 @@ 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)) 266linearSolvePropH f m = f m (unSym m) |~| ident (rows (unSym m))
267 267
268linearSolveProp2 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)
269 where q = min (rows a) (cols a) 269 where q = min (rows a) (cols a)