diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-06-13 16:35:02 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-06-13 16:35:02 +0000 |
commit | 713d4056abb2e786b4084e7e220d359b06dcaf1f (patch) | |
tree | 4535b87da8756ca89f07e46181891df2b90406dc /examples/tests.hs | |
parent | 8c5be977858723aac8b8f47f57ce98d82fe249b4 (diff) |
refactoring
Diffstat (limited to 'examples/tests.hs')
-rw-r--r-- | examples/tests.hs | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/tests.hs b/examples/tests.hs index b075704..9f0ae2a 100644 --- a/examples/tests.hs +++ b/examples/tests.hs | |||
@@ -4,7 +4,9 @@ | |||
4 | 4 | ||
5 | ----------------------------------------------------------------------------- | 5 | ----------------------------------------------------------------------------- |
6 | 6 | ||
7 | import Data.Packed.Internal.Vector | 7 | import Data.Packed.Internal |
8 | import Data.Packed.Vector | ||
9 | import Data.Packed.Matrix | ||
8 | import Data.Packed.Internal.Matrix | 10 | import Data.Packed.Internal.Matrix |
9 | import LAPACK | 11 | import LAPACK |
10 | import Test.QuickCheck | 12 | import Test.QuickCheck |
@@ -31,18 +33,6 @@ nullspaceProp tol m = cr > 0 ==> m <> nt ~~ zeros | |||
31 | 33 | ||
32 | -} | 34 | -} |
33 | 35 | ||
34 | r >< c = f where | ||
35 | f l | dim v == r*c = matrixFromVector RowMajor c v | ||
36 | | otherwise = error $ "inconsistent list size = " | ||
37 | ++show (dim v) ++"in ("++show r++"><"++show c++")" | ||
38 | where v = fromList l | ||
39 | |||
40 | r >|< c = f where | ||
41 | f l | dim v == r*c = matrixFromVector ColumnMajor c v | ||
42 | | otherwise = error $ "inconsistent list size = " | ||
43 | ++show (dim v) ++"in ("++show r++"><"++show c++")" | ||
44 | where v = fromList l | ||
45 | |||
46 | ac = (2><3) [1 .. 6::Double] | 36 | ac = (2><3) [1 .. 6::Double] |
47 | bc = (3><4) [7 .. 18::Double] | 37 | bc = (3><4) [7 .. 18::Double] |
48 | 38 | ||
@@ -82,8 +72,8 @@ cf = mulF af bc | |||
82 | r = mulC cc (trans cf) | 72 | r = mulC cc (trans cf) |
83 | 73 | ||
84 | rd = (2><2) | 74 | rd = (2><2) |
85 | [ 43492.0, 50572.0 | 75 | [ 27736.0, 65356.0 |
86 | , 102550.0, 119242.0 :: Double] | 76 | , 65356.0, 154006.0 ::Double] |
87 | 77 | ||
88 | instance (Arbitrary a, RealFloat a) => Arbitrary (Complex a) where | 78 | instance (Arbitrary a, RealFloat a) => Arbitrary (Complex a) where |
89 | arbitrary = do | 79 | arbitrary = do |