diff options
author | Alberto Ruiz <aruiz@um.es> | 2008-03-02 12:48:14 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2008-03-02 12:48:14 +0000 |
commit | a339794105f1e3849ff4f241088450f552eae7f6 (patch) | |
tree | 7cb21ffda8fce287f22d5e8e52a50fc40e2c2805 /examples/tests.hs | |
parent | 2c99bcb1de3fae6e2e075316126cc70658e20ac9 (diff) |
testing modules ok
Diffstat (limited to 'examples/tests.hs')
-rw-r--r-- | examples/tests.hs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/examples/tests.hs b/examples/tests.hs deleted file mode 100644 index cd923cd..0000000 --- a/examples/tests.hs +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | module Main where | ||
2 | |||
3 | import Numeric.LinearAlgebra | ||
4 | import Numeric.LinearAlgebra.Tests | ||
5 | import System.Random(randomRs,mkStdGen) | ||
6 | import Test.HUnit hiding (test) | ||
7 | import System(getArgs) | ||
8 | |||
9 | |||
10 | pseudorandomR seed (n,m) = reshape m $ fromList $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed | ||
11 | |||
12 | pseudorandomC seed (n,m) = toComplex (pseudorandomR seed (n,m), pseudorandomR (seed+1) (n,m)) | ||
13 | |||
14 | bigmat = m + trans m :: RM | ||
15 | where m = pseudorandomR 18 (1000,1000) | ||
16 | bigmatc = mc + ctrans mc ::CM | ||
17 | where mc = pseudorandomC 19 (1000,1000) | ||
18 | |||
19 | utest str b = TestCase $ assertBool str b | ||
20 | |||
21 | feye n = flipud (ident n) :: Matrix Double | ||
22 | |||
23 | bigtests = do | ||
24 | putStrLn "--------- big matrices -----" | ||
25 | runTestTT $ TestList | ||
26 | [ utest "eigS" $ eigSHProp bigmat | ||
27 | , utest "eigH" $ eigSHProp bigmatc | ||
28 | , utest "eigR" $ eigProp bigmat | ||
29 | , utest "eigC" $ eigProp bigmatc | ||
30 | , utest "det" $ det (feye 1000) == 1 && det (feye 1002) == -1 | ||
31 | ] | ||
32 | return () | ||
33 | |||
34 | main = do | ||
35 | args <- getArgs | ||
36 | if "--big" `elem` args | ||
37 | then bigtests | ||
38 | else runTests 20 | ||