summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests.hs67
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs
new file mode 100644
index 0000000..534eb04
--- /dev/null
+++ b/lib/Numeric/LinearAlgebra/Tests.hs
@@ -0,0 +1,67 @@
1-----------------------------------------------------------------------------
2{- |
3Module : Numeric.LinearAlgebra.Tests
4Copyright : (c) Alberto Ruiz 2007
5License : GPL-style
6
7Maintainer : Alberto Ruiz (aruiz at um dot es)
8Stability : provisional
9Portability : portable
10
11Some tests.
12
13-}
14
15module Numeric.LinearAlgebra.Tests(
16 module Numeric.LinearAlgebra.Tests.Instances,
17 module Numeric.LinearAlgebra.Tests.Properties,
18 qCheck,RM,CM, rM,cM, rHer,cHer,rRot,cRot,rSq,cSq,
19 runTests
20--, runBigTests
21) where
22
23import Numeric.LinearAlgebra
24import Numeric.LinearAlgebra.Tests.Instances
25import Numeric.LinearAlgebra.Tests.Properties
26import Test.QuickCheck
27import Debug.Trace
28
29qCheck n = check defaultConfig {configSize = const n}
30
31debug x = trace (show x) x
32
33type RM = Matrix Double
34type CM = Matrix (Complex Double)
35
36rM m = m :: RM
37cM m = m :: CM
38
39rHer (Her m) = m :: RM
40cHer (Her m) = m :: CM
41
42rRot (Rot m) = m :: RM
43cRot (Rot m) = m :: CM
44
45rSq (Sq m) = m :: RM
46cSq (Sq m) = m :: CM
47
48rWC (WC m) = m :: RM
49cWC (WC m) = m :: CM
50
51-- | It runs all the tests.
52runTests :: Int -- ^ maximum dimension
53 -> IO ()
54runTests n = do
55 qCheck n (hermitian . rHer)
56 qCheck n (hermitian . cHer)
57 qCheck n (unitary . rRot)
58 qCheck n (unitary . cRot)
59 qCheck n (wellCond . rWC)
60 qCheck n (wellCond . cWC)
61 --------------------------------
62 qCheck n (luTest . rM)
63 qCheck n (luTest . cM)
64
65-- | Some additional tests on big matrices. They take a few minutes.
66runBigTests :: IO ()
67runBigTests = undefined