summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-02-23 19:35:51 +0000
committerAlberto Ruiz <aruiz@um.es>2008-02-23 19:35:51 +0000
commit500f5fca244dadab494655aa73d7183df1c87c50 (patch)
treee02abfcf4db24a538646c6f0982c58dabb3adc63 /lib/Numeric/LinearAlgebra/Tests.hs
parentda54e2f2c27f68c08f4db7551c57b2c1136dc778 (diff)
working on tests
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests.hs61
1 files changed, 29 insertions, 32 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs
index 534eb04..7ecf812 100644
--- a/lib/Numeric/LinearAlgebra/Tests.hs
+++ b/lib/Numeric/LinearAlgebra/Tests.hs
@@ -15,8 +15,7 @@ Some tests.
15module Numeric.LinearAlgebra.Tests( 15module Numeric.LinearAlgebra.Tests(
16 module Numeric.LinearAlgebra.Tests.Instances, 16 module Numeric.LinearAlgebra.Tests.Instances,
17 module Numeric.LinearAlgebra.Tests.Properties, 17 module Numeric.LinearAlgebra.Tests.Properties,
18 qCheck,RM,CM, rM,cM, rHer,cHer,rRot,cRot,rSq,cSq, 18 qCheck, runTests
19 runTests
20--, runBigTests 19--, runBigTests
21) where 20) where
22 21
@@ -24,43 +23,41 @@ import Numeric.LinearAlgebra
24import Numeric.LinearAlgebra.Tests.Instances 23import Numeric.LinearAlgebra.Tests.Instances
25import Numeric.LinearAlgebra.Tests.Properties 24import Numeric.LinearAlgebra.Tests.Properties
26import Test.QuickCheck 25import Test.QuickCheck
27import Debug.Trace 26import Numeric.GSL(setErrorHandlerOff)
28 27
29qCheck n = check defaultConfig {configSize = const n} 28qCheck n = check defaultConfig {configSize = const n}
30 29
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. 30-- | It runs all the tests.
52runTests :: Int -- ^ maximum dimension 31runTests :: Int -- ^ maximum dimension
53 -> IO () 32 -> IO ()
54runTests n = do 33runTests n = do
55 qCheck n (hermitian . rHer) 34 setErrorHandlerOff
56 qCheck n (hermitian . cHer) 35 let test p = qCheck n p
57 qCheck n (unitary . rRot) 36 test (luProp . rM)
58 qCheck n (unitary . cRot) 37 test (luProp . cM)
59 qCheck n (wellCond . rWC) 38 test (invProp . rSqWC)
60 qCheck n (wellCond . cWC) 39 test (invProp . cSqWC)
61 -------------------------------- 40 test (pinvProp . rM)
62 qCheck n (luTest . rM) 41 test (pinvProp . cM)
63 qCheck n (luTest . cM) 42 test (detProp . cSqWC)
43 test (svdProp1 . rM)
44 test (svdProp1 . cM)
45 test (svdProp2 . rM)
46 test (svdProp2 . cM)
47 test (eigSHProp . rHer)
48 test (eigSHProp . cHer)
49 test (eigProp . rSq)
50 test (eigProp . cSq)
51 test (nullspaceProp . rM)
52 test (nullspaceProp . cM)
53 test (qrProp . rM)
54 test (qrProp . cM)
55 test (hessProp . rSq)
56 test (hessProp . cSq)
57 test (schurProp2 . rSq)
58 test (schurProp1 . cSq)
59 test (cholProp . rPosDef)
60 test (cholProp . cPosDef)
64 61
65-- | Some additional tests on big matrices. They take a few minutes. 62-- | Some additional tests on big matrices. They take a few minutes.
66runBigTests :: IO () 63runBigTests :: IO ()