summaryrefslogtreecommitdiff
path: root/packages/tests
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tests')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests.hs11
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs2
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs2
3 files changed, 10 insertions, 5 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
index 55a805a..5fdc5af 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
@@ -25,8 +25,8 @@ module Numeric.LinearAlgebra.Tests(
25) where 25) where
26 26
27--import Data.Packed.Random 27--import Data.Packed.Random
28import Numeric.LinearAlgebra.Compat 28import Numeric.LinearAlgebra
29import Numeric.LinearAlgebra.Util(row,col) 29import Numeric.LinearAlgebra.Util(col,row)
30import Data.Packed 30import Data.Packed
31import Numeric.LinearAlgebra.LAPACK 31import Numeric.LinearAlgebra.LAPACK
32import Numeric.LinearAlgebra.Tests.Instances 32import Numeric.LinearAlgebra.Tests.Instances
@@ -56,6 +56,9 @@ import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector
56 56
57import Test.QuickCheck.Test(isSuccess) 57import Test.QuickCheck.Test(isSuccess)
58 58
59eps = peps :: Double
60i = 0:+1 :: Complex Double
61
59qCheck n x = do 62qCheck n x = do
60 r <- quickCheckWithResult stdArgs {maxSize = n} x 63 r <- quickCheckWithResult stdArgs {maxSize = n} x
61 when (not $ isSuccess r) (exitFailure) 64 when (not $ isSuccess r) (exitFailure)
@@ -473,6 +476,7 @@ kroneckerTest = utest "kronecker" ok
473 476
474-------------------------------------------------------------------------------- 477--------------------------------------------------------------------------------
475 478
479sparseTest = utest "sparse mul" (fst $ checkT (undefined :: SMatrix))
476 480
477 481
478-- | All tests must pass with a maximum dimension of about 20 482-- | All tests must pass with a maximum dimension of about 20
@@ -632,7 +636,7 @@ runTests n = do
632 , utest "buildVector/Matrix" $ 636 , utest "buildVector/Matrix" $
633 complex (10 |> [0::Double ..]) == buildVector 10 fromIntegral 637 complex (10 |> [0::Double ..]) == buildVector 10 fromIntegral
634 && ident 5 == buildMatrix 5 5 (\(r,c) -> if r==c then 1::Double else 0) 638 && ident 5 == buildMatrix 5 5 (\(r,c) -> if r==c then 1::Double else 0)
635 , utest "rank" $ rank ((2><3)[1,0,0,1,6*eps,0]) == 1 639 , utest "rank" $ rank ((2><3)[1,0,0,1,5*eps,0]) == 1
636 && rank ((2><3)[1,0,0,1,7*eps,0]) == 2 640 && rank ((2><3)[1,0,0,1,7*eps,0]) == 2
637 , utest "block" $ fromBlocks [[ident 3,0],[0,ident 4]] == (ident 7 :: CM) 641 , utest "block" $ fromBlocks [[ident 3,0],[0,ident 4]] == (ident 7 :: CM)
638 , odeTest 642 , odeTest
@@ -650,6 +654,7 @@ runTests n = do
650 , accumTest 654 , accumTest
651 , convolutionTest 655 , convolutionTest
652 , kroneckerTest 656 , kroneckerTest
657 , sparseTest
653 ] 658 ]
654 when (errors c + failures c > 0) exitFailure 659 when (errors c + failures c > 0) exitFailure
655 return () 660 return ()
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs
index b306f94..4f5a5d2 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs
@@ -30,7 +30,7 @@ import System.Random
30 30
31import Numeric.LinearAlgebra 31import Numeric.LinearAlgebra
32import Numeric.LinearAlgebra.Devel 32import Numeric.LinearAlgebra.Devel
33import Numeric.Container 33import Numeric.Container hiding (Testable)
34import Control.Monad(replicateM) 34import Control.Monad(replicateM)
35import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector 35import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector
36 ,sized,classify,Testable,Property 36 ,sized,classify,Testable,Property
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
index 70d36e8..110ed24 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
@@ -43,7 +43,7 @@ module Numeric.LinearAlgebra.Tests.Properties (
43 linearSolveProp, linearSolveProp2 43 linearSolveProp, linearSolveProp2
44) where 44) where
45 45
46import Numeric.LinearAlgebra.Compat --hiding (real,complex) 46import Numeric.LinearAlgebra.Compat hiding (Testable) --hiding (real,complex)
47import Numeric.LinearAlgebra.LAPACK 47import Numeric.LinearAlgebra.LAPACK
48import Debug.Trace 48import Debug.Trace
49import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector 49import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector