summaryrefslogtreecommitdiff
path: root/packages/tests
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tests')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests.hs13
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs10
2 files changed, 9 insertions, 14 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
index e4f0846..55a805a 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
@@ -25,8 +25,9 @@ module Numeric.LinearAlgebra.Tests(
25) where 25) where
26 26
27--import Data.Packed.Random 27--import Data.Packed.Random
28import Numeric.LinearAlgebra 28import Numeric.LinearAlgebra.Compat
29import Numeric.Container 29import Numeric.LinearAlgebra.Util(row,col)
30import Data.Packed
30import Numeric.LinearAlgebra.LAPACK 31import Numeric.LinearAlgebra.LAPACK
31import Numeric.LinearAlgebra.Tests.Instances 32import Numeric.LinearAlgebra.Tests.Instances
32import Numeric.LinearAlgebra.Tests.Properties 33import Numeric.LinearAlgebra.Tests.Properties
@@ -67,10 +68,6 @@ a ~~ b = fromList a |~| fromList b
67 68
68feye n = flipud (ident n) :: Matrix Double 69feye n = flipud (ident n) :: Matrix Double
69 70
70eps = peps :: Double
71
72i = 0 :+ 1 :: Complex Double
73
74 71
75----------------------------------------------------------- 72-----------------------------------------------------------
76 73
@@ -466,10 +463,10 @@ kroneckerTest = utest "kronecker" ok
466 x = (4><2) [3,5..] 463 x = (4><2) [3,5..]
467 b = (2><5) [0,5..] 464 b = (2><5) [0,5..]
468 v1 = vec (a <> x <> b) 465 v1 = vec (a <> x <> b)
469 v2 = (trans b `kronecker` a) <> vec x 466 v2 = (trans b `kronecker` a) <.> vec x
470 s = trans b <> b 467 s = trans b <> b
471 v3 = vec s 468 v3 = vec s
472 v4 = dup 5 <> vech s 469 v4 = (dup 5 :: Matrix Double) <.> vech s
473 ok = v1 == v2 && v3 == v4 470 ok = v1 == v2 && v3 == v4
474 && vtrans 1 a == trans a 471 && vtrans 1 a == trans a
475 && vtrans (rows a) a == asColumn (vec a) 472 && vtrans (rows a) a == asColumn (vec a)
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
index 81cbf61..70d36e8 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
@@ -43,9 +43,7 @@ module Numeric.LinearAlgebra.Tests.Properties (
43 linearSolveProp, linearSolveProp2 43 linearSolveProp, linearSolveProp2
44) where 44) where
45 45
46import Numeric.LinearAlgebra --hiding (real,complex) 46import Numeric.LinearAlgebra.Compat --hiding (real,complex)
47import Numeric.LinearAlgebra.Devel
48import Numeric.Container
49import Numeric.LinearAlgebra.LAPACK 47import Numeric.LinearAlgebra.LAPACK
50import Debug.Trace 48import Debug.Trace
51import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector 49import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector
@@ -95,13 +93,13 @@ positiveDefinite m = minimum (toList e) > 0
95 93
96upperTriang m = rows m == 1 || down == z 94upperTriang m = rows m == 1 || down == z
97 where down = fromList $ concat $ zipWith drop [1..] (toLists (ctrans m)) 95 where down = fromList $ concat $ zipWith drop [1..] (toLists (ctrans m))
98 z = constant 0 (dim down) 96 z = konst 0 (dim down)
99 97
100upperHessenberg m = rows m < 3 || down == z 98upperHessenberg m = rows m < 3 || down == z
101 where down = fromList $ concat $ zipWith drop [2..] (toLists (ctrans m)) 99 where down = fromList $ concat $ zipWith drop [2..] (toLists (ctrans m))
102 z = constant 0 (dim down) 100 z = konst 0 (dim down)
103 101
104zeros (r,c) = reshape c (constant 0 (r*c)) 102zeros (r,c) = reshape c (konst 0 (r*c))
105 103
106ones (r,c) = zeros (r,c) + 1 104ones (r,c) = zeros (r,c) + 1
107 105