summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests
diff options
context:
space:
mode:
authorDylan Simon <dylan@dylex.net>2008-10-17 16:56:02 +0000
committerDylan Simon <dylan@dylex.net>2008-10-17 16:56:02 +0000
commit212ba96a26b6590868d9724560cef8b2471697f5 (patch)
tree8e04435f20fd03109a864be440cecfe594bf934e /lib/Numeric/LinearAlgebra/Tests
parent01f85a50c25b47188ae9fe9675974e9435cf64fb (diff)
fast signum/abs Vector instance
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests/Instances.hs6
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{- |
4Module : Numeric.LinearAlgebra.Tests.Instances 4Module : 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
73newtype (Her a) = Her (Matrix a) deriving Show 73newtype (Her a) = Her (Matrix a) deriving Show
74instance (Field a, Arbitrary a) => Arbitrary (Her a) where 74instance (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)
108newtype (PosDef a) = PosDef (Matrix a) deriving Show 108newtype (PosDef a) = PosDef (Matrix a) deriving Show
109instance (Field a, Arbitrary a) => Arbitrary (PosDef a) where 109instance (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