From faeaf6d261b760e628c1e63551d822d16876c0cc Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 22 Oct 2008 12:59:18 +0000 Subject: -Wall --- lib/Data/Packed/Convert.hs | 3 +-- lib/Data/Packed/Internal/Common.hs | 2 +- lib/Data/Packed/Internal/Matrix.hs | 2 -- lib/Data/Packed/ST.hs | 10 ++++------ 4 files changed, 6 insertions(+), 11 deletions(-) (limited to 'lib/Data/Packed') 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 import Foreign import Control.Monad.ST import Data.Array.ST -import Data.Array.IArray import Data.Array.Unboxed -- | Creates a StorableArray indexed from 0 to dim -1. @@ -88,7 +87,7 @@ vectorFromMArray x = fmap vectorFromArray (unsafeFreeze' x) matrixFromArray :: UArray (Int, Int) Double -> Matrix Double matrixFromArray m = reshape c . fromList . elems $ m where ((r1,c1),(r2,c2)) = bounds m - r = r2-r1+1 + _r = r2-r1+1 c = c2-c1+1 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) import Debug.Trace import Foreign.C.String(peekCString) import Foreign.C.Types -import Foreign.Storable.Complex +import Foreign.Storable.Complex() -- | @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 import Foreign hiding (xor) import Complex -import Control.Monad(when) import Foreign.C.String import Foreign.C.Types -import Data.List(transpose) ----------------------------------------------------------------- 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 ( ) where import Data.Packed.Internal -import Data.Array.Storable import Control.Monad.ST -import Data.Array.ST import Foreign {-# INLINE ioReadV #-} @@ -97,13 +95,13 @@ newVector v = unsafeThawVector . constant v {-# INLINE ioReadM #-} ioReadM :: Storable t => Matrix t -> Int -> Int -> IO t -ioReadM (MC nr nc cv) r c = ioReadV cv (r*nc+c) -ioReadM (MF nr nc fv) r c = ioReadV fv (c*nr+r) +ioReadM (MC _ nc cv) r c = ioReadV cv (r*nc+c) +ioReadM (MF nr _ fv) r c = ioReadV fv (c*nr+r) {-# INLINE ioWriteM #-} ioWriteM :: Storable t => Matrix t -> Int -> Int -> t -> IO () -ioWriteM (MC nr nc cv) r c val = ioWriteV cv (r*nc+c) val -ioWriteM (MF nr nc fv) r c val = ioWriteV fv (c*nr+r) val +ioWriteM (MC _ nc cv) r c val = ioWriteV cv (r*nc+c) val +ioWriteM (MF nr _ fv) r c val = ioWriteV fv (c*nr+r) val newtype STMatrix s t = STMatrix (Matrix t) -- cgit v1.2.3