summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Instances.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-10-22 12:59:18 +0000
committerAlberto Ruiz <aruiz@um.es>2008-10-22 12:59:18 +0000
commitfaeaf6d261b760e628c1e63551d822d16876c0cc (patch)
tree45e3e2d1460d72e1fd037e19d4470963b75cc00e /lib/Numeric/LinearAlgebra/Instances.hs
parent9d9b1274a522e1bf0c5dea210765a0368ebb74a5 (diff)
-Wall
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)]