diff options
Diffstat (limited to 'packages/tests')
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests.hs | 13 | ||||
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs | 10 |
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 |
28 | import Numeric.LinearAlgebra | 28 | import Numeric.LinearAlgebra.Compat |
29 | import Numeric.Container | 29 | import Numeric.LinearAlgebra.Util(row,col) |
30 | import Data.Packed | ||
30 | import Numeric.LinearAlgebra.LAPACK | 31 | import Numeric.LinearAlgebra.LAPACK |
31 | import Numeric.LinearAlgebra.Tests.Instances | 32 | import Numeric.LinearAlgebra.Tests.Instances |
32 | import Numeric.LinearAlgebra.Tests.Properties | 33 | import Numeric.LinearAlgebra.Tests.Properties |
@@ -67,10 +68,6 @@ a ~~ b = fromList a |~| fromList b | |||
67 | 68 | ||
68 | feye n = flipud (ident n) :: Matrix Double | 69 | feye n = flipud (ident n) :: Matrix Double |
69 | 70 | ||
70 | eps = peps :: Double | ||
71 | |||
72 | i = 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 | ||
46 | import Numeric.LinearAlgebra --hiding (real,complex) | 46 | import Numeric.LinearAlgebra.Compat --hiding (real,complex) |
47 | import Numeric.LinearAlgebra.Devel | ||
48 | import Numeric.Container | ||
49 | import Numeric.LinearAlgebra.LAPACK | 47 | import Numeric.LinearAlgebra.LAPACK |
50 | import Debug.Trace | 48 | import Debug.Trace |
51 | import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector | 49 | import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector |
@@ -95,13 +93,13 @@ positiveDefinite m = minimum (toList e) > 0 | |||
95 | 93 | ||
96 | upperTriang m = rows m == 1 || down == z | 94 | upperTriang 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 | ||
100 | upperHessenberg m = rows m < 3 || down == z | 98 | upperHessenberg 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 | ||
104 | zeros (r,c) = reshape c (constant 0 (r*c)) | 102 | zeros (r,c) = reshape c (konst 0 (r*c)) |
105 | 103 | ||
106 | ones (r,c) = zeros (r,c) + 1 | 104 | ones (r,c) = zeros (r,c) + 1 |
107 | 105 | ||