diff options
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/Packed/Convert.hs | 3 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Common.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/ST.hs | 10 |
4 files changed, 6 insertions, 11 deletions
diff --git a/lib/Data/Packed/Convert.hs b/lib/Data/Packed/Convert.hs index 206fa06..8f0eef6 100644 --- a/lib/Data/Packed/Convert.hs +++ b/lib/Data/Packed/Convert.hs | |||
@@ -29,7 +29,6 @@ import Data.Array.Storable | |||
29 | import Foreign | 29 | import Foreign |
30 | import Control.Monad.ST | 30 | import Control.Monad.ST |
31 | import Data.Array.ST | 31 | import Data.Array.ST |
32 | import Data.Array.IArray | ||
33 | import Data.Array.Unboxed | 32 | import Data.Array.Unboxed |
34 | 33 | ||
35 | -- | Creates a StorableArray indexed from 0 to dim -1. | 34 | -- | Creates a StorableArray indexed from 0 to dim -1. |
@@ -88,7 +87,7 @@ vectorFromMArray x = fmap vectorFromArray (unsafeFreeze' x) | |||
88 | matrixFromArray :: UArray (Int, Int) Double -> Matrix Double | 87 | matrixFromArray :: UArray (Int, Int) Double -> Matrix Double |
89 | matrixFromArray m = reshape c . fromList . elems $ m | 88 | matrixFromArray m = reshape c . fromList . elems $ m |
90 | where ((r1,c1),(r2,c2)) = bounds m | 89 | where ((r1,c1),(r2,c2)) = bounds m |
91 | r = r2-r1+1 | 90 | _r = r2-r1+1 |
92 | c = c2-c1+1 | 91 | c = c2-c1+1 |
93 | 92 | ||
94 | arrayFromMatrix :: Matrix Double -> UArray (Int, Int) Double | 93 | arrayFromMatrix :: Matrix Double -> UArray (Int, Int) Double |
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index baeb5bc..3609bc2 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs | |||
@@ -22,7 +22,7 @@ import Control.Monad(when) | |||
22 | import Debug.Trace | 22 | import Debug.Trace |
23 | import Foreign.C.String(peekCString) | 23 | import Foreign.C.String(peekCString) |
24 | import Foreign.C.Types | 24 | import Foreign.C.Types |
25 | import Foreign.Storable.Complex | 25 | import Foreign.Storable.Complex() |
26 | 26 | ||
27 | 27 | ||
28 | -- | @debug x = trace (show x) x@ | 28 | -- | @debug x = trace (show x) x@ |
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 45a3955..63f0a8d 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -22,10 +22,8 @@ import Data.Packed.Internal.Vector | |||
22 | 22 | ||
23 | import Foreign hiding (xor) | 23 | import Foreign hiding (xor) |
24 | import Complex | 24 | import Complex |
25 | import Control.Monad(when) | ||
26 | import Foreign.C.String | 25 | import Foreign.C.String |
27 | import Foreign.C.Types | 26 | import Foreign.C.Types |
28 | import Data.List(transpose) | ||
29 | 27 | ||
30 | ----------------------------------------------------------------- | 28 | ----------------------------------------------------------------- |
31 | 29 | ||
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs index ed0a05e..91b7968 100644 --- a/lib/Data/Packed/ST.hs +++ b/lib/Data/Packed/ST.hs | |||
@@ -30,9 +30,7 @@ module Data.Packed.ST ( | |||
30 | ) where | 30 | ) where |
31 | 31 | ||
32 | import Data.Packed.Internal | 32 | import Data.Packed.Internal |
33 | import Data.Array.Storable | ||
34 | import Control.Monad.ST | 33 | import Control.Monad.ST |
35 | import Data.Array.ST | ||
36 | import Foreign | 34 | import Foreign |
37 | 35 | ||
38 | {-# INLINE ioReadV #-} | 36 | {-# INLINE ioReadV #-} |
@@ -97,13 +95,13 @@ newVector v = unsafeThawVector . constant v | |||
97 | 95 | ||
98 | {-# INLINE ioReadM #-} | 96 | {-# INLINE ioReadM #-} |
99 | ioReadM :: Storable t => Matrix t -> Int -> Int -> IO t | 97 | ioReadM :: Storable t => Matrix t -> Int -> Int -> IO t |
100 | ioReadM (MC nr nc cv) r c = ioReadV cv (r*nc+c) | 98 | ioReadM (MC _ nc cv) r c = ioReadV cv (r*nc+c) |
101 | ioReadM (MF nr nc fv) r c = ioReadV fv (c*nr+r) | 99 | ioReadM (MF nr _ fv) r c = ioReadV fv (c*nr+r) |
102 | 100 | ||
103 | {-# INLINE ioWriteM #-} | 101 | {-# INLINE ioWriteM #-} |
104 | ioWriteM :: Storable t => Matrix t -> Int -> Int -> t -> IO () | 102 | ioWriteM :: Storable t => Matrix t -> Int -> Int -> t -> IO () |
105 | ioWriteM (MC nr nc cv) r c val = ioWriteV cv (r*nc+c) val | 103 | ioWriteM (MC _ nc cv) r c val = ioWriteV cv (r*nc+c) val |
106 | ioWriteM (MF nr nc fv) r c val = ioWriteV fv (c*nr+r) val | 104 | ioWriteM (MF nr _ fv) r c val = ioWriteV fv (c*nr+r) val |
107 | 105 | ||
108 | newtype STMatrix s t = STMatrix (Matrix t) | 106 | newtype STMatrix s t = STMatrix (Matrix t) |
109 | 107 | ||