diff options
Diffstat (limited to 'packages/tests/src/Numeric')
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs index 97cfd01..12eddb2 100644 --- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs +++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Instances.hs | |||
@@ -33,6 +33,7 @@ import System.Random | |||
33 | import Numeric.LinearAlgebra.HMatrix hiding (vector) | 33 | import Numeric.LinearAlgebra.HMatrix hiding (vector) |
34 | import Control.Monad(replicateM) | 34 | import Control.Monad(replicateM) |
35 | import Test.QuickCheck(Arbitrary,arbitrary,choose,vector,sized,shrink) | 35 | import Test.QuickCheck(Arbitrary,arbitrary,choose,vector,sized,shrink) |
36 | import Foreign.Storable | ||
36 | 37 | ||
37 | import GHC.TypeLits | 38 | import GHC.TypeLits |
38 | import Data.Proxy (Proxy(..)) | 39 | import Data.Proxy (Proxy(..)) |
@@ -69,7 +70,7 @@ instance KnownNat n => Arbitrary (Static.R n) where | |||
69 | 70 | ||
70 | shrink _v = [] | 71 | shrink _v = [] |
71 | 72 | ||
72 | instance (Element a, Arbitrary a) => Arbitrary (Matrix a) where | 73 | instance (Storable a, Arbitrary a) => Arbitrary (Matrix a) where |
73 | arbitrary = do | 74 | arbitrary = do |
74 | m <- chooseDim | 75 | m <- chooseDim |
75 | n <- chooseDim | 76 | n <- chooseDim |
@@ -98,7 +99,7 @@ instance (KnownNat n, KnownNat m) => Arbitrary (Static.L m n) where | |||
98 | 99 | ||
99 | -- a square matrix | 100 | -- a square matrix |
100 | newtype (Sq a) = Sq (Matrix a) deriving Show | 101 | newtype (Sq a) = Sq (Matrix a) deriving Show |
101 | instance (Element a, Arbitrary a) => Arbitrary (Sq a) where | 102 | instance (Storable a, Arbitrary a) => Arbitrary (Sq a) where |
102 | arbitrary = do | 103 | arbitrary = do |
103 | n <- chooseDim | 104 | n <- chooseDim |
104 | l <- vector (n*n) | 105 | l <- vector (n*n) |
@@ -141,7 +142,7 @@ instance (Field a, Arbitrary a, Num (Vector a)) => Arbitrary (Herm a) where | |||
141 | return $ sym m' | 142 | return $ sym m' |
142 | 143 | ||
143 | 144 | ||
144 | class (Field a, Arbitrary a, Element (RealOf a), Random (RealOf a)) => ArbitraryField a | 145 | class (Field a, Arbitrary a, Storable (RealOf a), Random (RealOf a)) => ArbitraryField a |
145 | instance ArbitraryField Double | 146 | instance ArbitraryField Double |
146 | instance ArbitraryField (Complex Double) | 147 | instance ArbitraryField (Complex Double) |
147 | 148 | ||