diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-11-23 13:25:42 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-11-23 13:25:42 +0000 |
commit | 30fdf02aff2ac1c4da2bb9292fc08cc8330580d0 (patch) | |
tree | 82b062214626c20922959c82581decb3df2ba5ec /lib/Data/Packed/Internal/Matrix.hs | |
parent | 48139eb50c9052406839ee8375e378374e973207 (diff) |
removed many -Wall warnings
Diffstat (limited to 'lib/Data/Packed/Internal/Matrix.hs')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 0519603..4cc94b7 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -22,7 +22,6 @@ import Data.Packed.Internal.Vector | |||
22 | import Foreign hiding (xor) | 22 | import Foreign hiding (xor) |
23 | import Complex | 23 | import Complex |
24 | import Control.Monad(when) | 24 | import Control.Monad(when) |
25 | import Data.Maybe(fromJust) | ||
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) | 27 | import Data.List(transpose) |
@@ -83,14 +82,14 @@ mat = withMatrix | |||
83 | 82 | ||
84 | withMatrix MC {rows = r, cols = c, cdat = d } f = | 83 | withMatrix MC {rows = r, cols = c, cdat = d } f = |
85 | withForeignPtr (fptr d) $ \p -> do | 84 | withForeignPtr (fptr d) $ \p -> do |
86 | let m f = do | 85 | let m g = do |
87 | f r c p | 86 | g r c p |
88 | f m | 87 | f m |
89 | 88 | ||
90 | withMatrix MF {rows = r, cols = c, fdat = d } f = | 89 | withMatrix MF {rows = r, cols = c, fdat = d } f = |
91 | withForeignPtr (fptr d) $ \p -> do | 90 | withForeignPtr (fptr d) $ \p -> do |
92 | let m f = do | 91 | let m g = do |
93 | f r c p | 92 | g r c p |
94 | f m | 93 | f m |
95 | 94 | ||
96 | {- | Creates a vector by concatenation of rows | 95 | {- | Creates a vector by concatenation of rows |
@@ -262,8 +261,8 @@ foreign import ccall safe "auxi.h transC" | |||
262 | 261 | ||
263 | ------------------------------------------------------------------ | 262 | ------------------------------------------------------------------ |
264 | 263 | ||
265 | gmatC MF {rows = r, cols = c, fdat = d} p f = f 1 c r p | 264 | gmatC MF { rows = r, cols = c } p f = f 1 c r p |
266 | gmatC MC {rows = r, cols = c, cdat = d} p f = f 0 r c p | 265 | gmatC MC { rows = r, cols = c } p f = f 0 r c p |
267 | 266 | ||
268 | dtt MC { cdat = d } = d | 267 | dtt MC { cdat = d } = d |
269 | dtt MF { fdat = d } = d | 268 | dtt MF { fdat = d } = d |
@@ -273,8 +272,8 @@ multiplyAux fun a b = unsafePerformIO $ do | |||
273 | show (rows a,cols a) ++ " x " ++ show (rows b, cols b) | 272 | show (rows a,cols a) ++ " x " ++ show (rows b, cols b) |
274 | r <- createMatrix RowMajor (rows a) (cols b) | 273 | r <- createMatrix RowMajor (rows a) (cols b) |
275 | withForeignPtr (fptr (dtt a)) $ \pa -> withForeignPtr (fptr (dtt b)) $ \pb -> | 274 | withForeignPtr (fptr (dtt a)) $ \pa -> withForeignPtr (fptr (dtt b)) $ \pb -> |
276 | withMatrix r $ \r -> | 275 | withMatrix r $ \r' -> |
277 | fun // gmatC a pa // gmatC b pb // r // check "multiplyAux" | 276 | fun // gmatC a pa // gmatC b pb // r' // check "multiplyAux" |
278 | return r | 277 | return r |
279 | 278 | ||
280 | multiplyR = multiplyAux cmultiplyR | 279 | multiplyR = multiplyAux cmultiplyR |
@@ -421,7 +420,7 @@ diagG v = matrixFromVector RowMajor c $ fromList $ [ l!!(i-1) * delta k i | k <- | |||
421 | | otherwise = 0 | 420 | | otherwise = 0 |
422 | -} | 421 | -} |
423 | 422 | ||
424 | transdataG c1 d c2 = fromList . concat . transpose . partit c1 . toList $ d | 423 | transdataG c1 d _ = fromList . concat . transpose . partit c1 . toList $ d |
425 | 424 | ||
426 | dotL a b = sum (zipWith (*) a b) | 425 | dotL a b = sum (zipWith (*) a b) |
427 | 426 | ||