diff options
Diffstat (limited to 'packages/tests/src/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs index 14d02e4..a25f4cb 100644 --- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs +++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs | |||
@@ -1,9 +1,9 @@ | |||
1 | {-# LANGUAGE CPP #-} | 1 | {-# LANGUAGE CPP #-} |
2 | {-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-incomplete-patterns #-} | 2 | {-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-incomplete-patterns #-} |
3 | {-# LANGUAGE DataKinds #-} | 3 | {-# LANGUAGE DataKinds #-} |
4 | {-# LANGUAGE TypeFamilies #-} | ||
4 | {-# LANGUAGE FlexibleContexts #-} | 5 | {-# LANGUAGE FlexibleContexts #-} |
5 | {-# LANGUAGE GADTs #-} | 6 | {-# LANGUAGE RankNTypes #-} |
6 | |||
7 | 7 | ||
8 | ----------------------------------------------------------------------------- | 8 | ----------------------------------------------------------------------------- |
9 | {- | | 9 | {- | |
@@ -30,7 +30,7 @@ module Numeric.LinearAlgebra.Tests( | |||
30 | 30 | ||
31 | import Numeric.LinearAlgebra.HMatrix | 31 | import Numeric.LinearAlgebra.HMatrix |
32 | import Numeric.LinearAlgebra.Devel hiding (vec) | 32 | import Numeric.LinearAlgebra.Devel hiding (vec) |
33 | import Numeric.LinearAlgebra.Util hiding (ones) | 33 | import Numeric.LinearAlgebra.HMatrix.Util |
34 | import Numeric.LinearAlgebra.Static(L) | 34 | import Numeric.LinearAlgebra.Static(L) |
35 | import Numeric.LinearAlgebra.Tests.Instances | 35 | import Numeric.LinearAlgebra.Tests.Instances |
36 | import Numeric.LinearAlgebra.Tests.Properties | 36 | import Numeric.LinearAlgebra.Tests.Properties |
@@ -52,6 +52,7 @@ import Control.Monad(ap) | |||
52 | import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector | 52 | import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector |
53 | ,sized,classify,Testable,Property | 53 | ,sized,classify,Testable,Property |
54 | ,quickCheckWithResult,maxSize,stdArgs,shrink) | 54 | ,quickCheckWithResult,maxSize,stdArgs,shrink) |
55 | import qualified Test.QuickCheck as T | ||
55 | 56 | ||
56 | import Test.QuickCheck.Test(isSuccess) | 57 | import Test.QuickCheck.Test(isSuccess) |
57 | 58 | ||
@@ -413,7 +414,8 @@ indexProp g f x = a1 == g a2 && a2 == a3 && b1 == g b2 && b2 == b3 | |||
413 | runTests :: Int -- ^ maximum dimension | 414 | runTests :: Int -- ^ maximum dimension |
414 | -> IO () | 415 | -> IO () |
415 | runTests n = do | 416 | runTests n = do |
416 | let test p = qCheck n p | 417 | let test :: forall t . T.Testable t => t -> IO () |
418 | test p = qCheck n p | ||
417 | putStrLn "------ index" | 419 | putStrLn "------ index" |
418 | test( \m -> indexProp id flatten (single (m :: RM)) ) | 420 | test( \m -> indexProp id flatten (single (m :: RM)) ) |
419 | test( \v -> indexProp id id (single (v :: Vector Double)) ) | 421 | test( \v -> indexProp id id (single (v :: Vector Double)) ) |
@@ -485,7 +487,7 @@ runTests n = do | |||
485 | test (svdProp6b) | 487 | test (svdProp6b) |
486 | test (svdProp7 . rM) | 488 | test (svdProp7 . rM) |
487 | test (svdProp7 . cM) | 489 | test (svdProp7 . cM) |
488 | putStrLn "------ svdCd" | 490 | -- putStrLn "------ svdCd" |
489 | #ifdef NOZGESDD | 491 | #ifdef NOZGESDD |
490 | -- putStrLn "Omitted" | 492 | -- putStrLn "Omitted" |
491 | #else | 493 | #else |
@@ -532,7 +534,7 @@ runTests n = do | |||
532 | test (\u -> sin u ** 2 + cos u ** 2 |~| (1::RM)) | 534 | test (\u -> sin u ** 2 + cos u ** 2 |~| (1::RM)) |
533 | test (\u -> cos u * tan u |~| sin (u::RM)) | 535 | test (\u -> cos u * tan u |~| sin (u::RM)) |
534 | test $ (\u -> cos u * tan u |~| sin (u::CM)) . liftMatrix makeUnitary | 536 | test $ (\u -> cos u * tan u |~| sin (u::CM)) . liftMatrix makeUnitary |
535 | putStrLn "------ vector operations - Float" | 537 | -- putStrLn "------ vector operations - Float" |
536 | -- test (\u -> sin u ^ 2 + cos u ^ 2 |~~| (1::FM)) | 538 | -- test (\u -> sin u ^ 2 + cos u ^ 2 |~~| (1::FM)) |
537 | -- test $ (\u -> sin u ^ 2 + cos u ^ 2 |~~| (1::ZM)) . liftMatrix makeUnitary | 539 | -- test $ (\u -> sin u ^ 2 + cos u ^ 2 |~~| (1::ZM)) . liftMatrix makeUnitary |
538 | -- test (\u -> sin u ** 2 + cos u ** 2 |~~| (1::FM)) | 540 | -- test (\u -> sin u ** 2 + cos u ** 2 |~~| (1::FM)) |