diff options
author | Dylan Simon <dylan@dylex.net> | 2008-10-17 16:56:02 +0000 |
---|---|---|
committer | Dylan Simon <dylan@dylex.net> | 2008-10-17 16:56:02 +0000 |
commit | 212ba96a26b6590868d9724560cef8b2471697f5 (patch) | |
tree | 8e04435f20fd03109a864be440cecfe594bf934e /lib/Numeric/LinearAlgebra/Tests | |
parent | 01f85a50c25b47188ae9fe9675974e9435cf64fb (diff) |
fast signum/abs Vector instance
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests/Instances.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests/Instances.hs b/lib/Numeric/LinearAlgebra/Tests/Instances.hs index e7fecf2..677ad2b 100644 --- a/lib/Numeric/LinearAlgebra/Tests/Instances.hs +++ b/lib/Numeric/LinearAlgebra/Tests/Instances.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | {-# OPTIONS #-} | 1 | {-# LANGUAGE FlexibleContexts, UndecidableInstances #-} |
2 | ----------------------------------------------------------------------------- | 2 | ----------------------------------------------------------------------------- |
3 | {- | | 3 | {- | |
4 | Module : Numeric.LinearAlgebra.Tests.Instances | 4 | Module : Numeric.LinearAlgebra.Tests.Instances |
@@ -71,7 +71,7 @@ instance (Field a, Arbitrary a) => Arbitrary (Rot a) where | |||
71 | 71 | ||
72 | -- a complex hermitian or real symmetric matrix | 72 | -- a complex hermitian or real symmetric matrix |
73 | newtype (Her a) = Her (Matrix a) deriving Show | 73 | newtype (Her a) = Her (Matrix a) deriving Show |
74 | instance (Field a, Arbitrary a) => Arbitrary (Her a) where | 74 | instance (Field a, Arbitrary a, Num (Vector a)) => Arbitrary (Her a) where |
75 | arbitrary = do | 75 | arbitrary = do |
76 | Sq m <- arbitrary | 76 | Sq m <- arbitrary |
77 | let m' = m/2 | 77 | let m' = m/2 |
@@ -106,7 +106,7 @@ instance (Field a, Arbitrary a) => Arbitrary (SqWC a) where | |||
106 | 106 | ||
107 | -- a positive definite square matrix (the eigenvalues are between 0 and 100) | 107 | -- a positive definite square matrix (the eigenvalues are between 0 and 100) |
108 | newtype (PosDef a) = PosDef (Matrix a) deriving Show | 108 | newtype (PosDef a) = PosDef (Matrix a) deriving Show |
109 | instance (Field a, Arbitrary a) => Arbitrary (PosDef a) where | 109 | instance (Field a, Arbitrary a, Num (Vector a)) => Arbitrary (PosDef a) where |
110 | arbitrary = do | 110 | arbitrary = do |
111 | Her m <- arbitrary | 111 | Her m <- arbitrary |
112 | let (_,v) = eigSH m | 112 | let (_,v) = eigSH m |