summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Instances.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Instances.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Instances.hs7
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(
22import Numeric.LinearAlgebra.Linear 22import Numeric.LinearAlgebra.Linear
23import Numeric.GSL.Vector 23import Numeric.GSL.Vector
24import Data.Packed.Matrix 24import Data.Packed.Matrix
25import Data.Packed.Vector
26import Complex 25import Complex
27import Data.List(transpose,intersperse) 26import Data.List(transpose,intersperse)
28import Foreign(Storable) 27import Foreign(Storable)
@@ -49,11 +48,11 @@ instance (Show a, Storable a) => (Show (Vector a)) where
49------------------------------------------------------------------ 48------------------------------------------------------------------
50 49
51instance (Element a, Read a) => Read (Matrix a) where 50instance (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
58instance (Element a, Read a) => Read (Vector a) where 57instance (Element a, Read a) => Read (Vector a) where
59 readsPrec _ s = [((d |>) . read $ listnums, rest)] 58 readsPrec _ s = [((d |>) . read $ listnums, rest)]