summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
blob: 7ecf8128d2b0f88d878315afc4a607e20a59ea5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-----------------------------------------------------------------------------
{- |
Module      :  Numeric.LinearAlgebra.Tests
Copyright   :  (c) Alberto Ruiz 2007
License     :  GPL-style

Maintainer  :  Alberto Ruiz (aruiz at um dot es)
Stability   :  provisional
Portability :  portable

Some tests.

-}

module Numeric.LinearAlgebra.Tests(
  module Numeric.LinearAlgebra.Tests.Instances,
  module Numeric.LinearAlgebra.Tests.Properties,
  qCheck, runTests
--, runBigTests
) where

import Numeric.LinearAlgebra
import Numeric.LinearAlgebra.Tests.Instances
import Numeric.LinearAlgebra.Tests.Properties
import Test.QuickCheck
import Numeric.GSL(setErrorHandlerOff)

qCheck n = check defaultConfig {configSize = const n}

-- | It runs all the tests.
runTests :: Int  -- ^ maximum dimension
         -> IO ()
runTests n = do
    setErrorHandlerOff
    let test p = qCheck n p
    test (luProp    . rM)
    test (luProp    . cM)
    test (invProp   . rSqWC)
    test (invProp   . cSqWC)
    test (pinvProp  . rM)
    test (pinvProp  . cM)
    test (detProp   . cSqWC)
    test (svdProp1  . rM)
    test (svdProp1  . cM)
    test (svdProp2  . rM)
    test (svdProp2  . cM)
    test (eigSHProp . rHer)
    test (eigSHProp . cHer)
    test (eigProp   . rSq)
    test (eigProp   . cSq)
    test (nullspaceProp . rM)
    test (nullspaceProp . cM)
    test (qrProp     . rM)
    test (qrProp     . cM)
    test (hessProp   . rSq)
    test (hessProp   . cSq)
    test (schurProp2 . rSq)
    test (schurProp1 . cSq)
    test (cholProp   . rPosDef)
    test (cholProp   . cPosDef)

-- | Some additional tests on big matrices. They take a few minutes.
runBigTests :: IO ()
runBigTests = undefined