From a339794105f1e3849ff4f241088450f552eae7f6 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sun, 2 Mar 2008 12:48:14 +0000 Subject: testing modules ok --- examples/tests.hs | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 examples/tests.hs (limited to 'examples/tests.hs') 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 @@ -module Main where - -import Numeric.LinearAlgebra -import Numeric.LinearAlgebra.Tests -import System.Random(randomRs,mkStdGen) -import Test.HUnit hiding (test) -import System(getArgs) - - -pseudorandomR seed (n,m) = reshape m $ fromList $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed - -pseudorandomC seed (n,m) = toComplex (pseudorandomR seed (n,m), pseudorandomR (seed+1) (n,m)) - -bigmat = m + trans m :: RM - where m = pseudorandomR 18 (1000,1000) -bigmatc = mc + ctrans mc ::CM - where mc = pseudorandomC 19 (1000,1000) - -utest str b = TestCase $ assertBool str b - -feye n = flipud (ident n) :: Matrix Double - -bigtests = do - putStrLn "--------- big matrices -----" - runTestTT $ TestList - [ utest "eigS" $ eigSHProp bigmat - , utest "eigH" $ eigSHProp bigmatc - , utest "eigR" $ eigProp bigmat - , utest "eigC" $ eigProp bigmatc - , utest "det" $ det (feye 1000) == 1 && det (feye 1002) == -1 - ] - return () - -main = do - args <- getArgs - if "--big" `elem` args - then bigtests - else runTests 20 -- cgit v1.2.3