summaryrefslogtreecommitdiff
path: root/examples/tests.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-03-02 12:48:14 +0000
committerAlberto Ruiz <aruiz@um.es>2008-03-02 12:48:14 +0000
commita339794105f1e3849ff4f241088450f552eae7f6 (patch)
tree7cb21ffda8fce287f22d5e8e52a50fc40e2c2805 /examples/tests.hs
parent2c99bcb1de3fae6e2e075316126cc70658e20ac9 (diff)
testing modules ok
Diffstat (limited to 'examples/tests.hs')
-rw-r--r--examples/tests.hs38
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 @@
1module Main where
2
3import Numeric.LinearAlgebra
4import Numeric.LinearAlgebra.Tests
5import System.Random(randomRs,mkStdGen)
6import Test.HUnit hiding (test)
7import System(getArgs)
8
9
10pseudorandomR seed (n,m) = reshape m $ fromList $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed
11
12pseudorandomC seed (n,m) = toComplex (pseudorandomR seed (n,m), pseudorandomR (seed+1) (n,m))
13
14bigmat = m + trans m :: RM
15 where m = pseudorandomR 18 (1000,1000)
16bigmatc = mc + ctrans mc ::CM
17 where mc = pseudorandomC 19 (1000,1000)
18
19utest str b = TestCase $ assertBool str b
20
21feye n = flipud (ident n) :: Matrix Double
22
23bigtests = 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
34main = do
35 args <- getArgs
36 if "--big" `elem` args
37 then bigtests
38 else runTests 20