diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Instances.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Instances.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Numeric/LinearAlgebra/Instances.hs b/lib/Numeric/LinearAlgebra/Instances.hs index 334ccff..79a8990 100644 --- a/lib/Numeric/LinearAlgebra/Instances.hs +++ b/lib/Numeric/LinearAlgebra/Instances.hs | |||
@@ -22,7 +22,6 @@ module Numeric.LinearAlgebra.Instances( | |||
22 | import Numeric.LinearAlgebra.Linear | 22 | import Numeric.LinearAlgebra.Linear |
23 | import Numeric.GSL.Vector | 23 | import Numeric.GSL.Vector |
24 | import Data.Packed.Matrix | 24 | import Data.Packed.Matrix |
25 | import Data.Packed.Vector | ||
26 | import Complex | 25 | import Complex |
27 | import Data.List(transpose,intersperse) | 26 | import Data.List(transpose,intersperse) |
28 | import Foreign(Storable) | 27 | import Foreign(Storable) |
@@ -49,11 +48,11 @@ instance (Show a, Storable a) => (Show (Vector a)) where | |||
49 | ------------------------------------------------------------------ | 48 | ------------------------------------------------------------------ |
50 | 49 | ||
51 | instance (Element a, Read a) => Read (Matrix a) where | 50 | instance (Element a, Read a) => Read (Matrix a) where |
52 | readsPrec _ s = [((rows><cols) . read $ listnums, rest)] | 51 | readsPrec _ s = [((rs><cs) . read $ listnums, rest)] |
53 | where (thing,rest) = breakAt ']' s | 52 | where (thing,rest) = breakAt ']' s |
54 | (dims,listnums) = breakAt ')' thing | 53 | (dims,listnums) = breakAt ')' thing |
55 | cols = read . init . fst. breakAt ')' . snd . breakAt '<' $ dims | 54 | cs = read . init . fst. breakAt ')' . snd . breakAt '<' $ dims |
56 | rows = read . snd . breakAt '(' .init . fst . breakAt '>' $ dims | 55 | rs = read . snd . breakAt '(' .init . fst . breakAt '>' $ dims |
57 | 56 | ||
58 | instance (Element a, Read a) => Read (Vector a) where | 57 | instance (Element a, Read a) => Read (Vector a) where |
59 | readsPrec _ s = [((d |>) . read $ listnums, rest)] | 58 | readsPrec _ s = [((d |>) . read $ listnums, rest)] |