diff options
-rw-r--r-- | hmatrix.cabal | 7 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Common.hs | 10 |
2 files changed, 5 insertions, 12 deletions
diff --git a/hmatrix.cabal b/hmatrix.cabal index b9c0e78..049036c 100644 --- a/hmatrix.cabal +++ b/hmatrix.cabal | |||
@@ -1,5 +1,5 @@ | |||
1 | Name: hmatrix | 1 | Name: hmatrix |
2 | Version: 0.2.0.0 | 2 | Version: 0.2.0.1 |
3 | License: GPL | 3 | License: GPL |
4 | License-file: LICENSE | 4 | License-file: LICENSE |
5 | Author: Alberto Ruiz | 5 | Author: Alberto Ruiz |
@@ -16,15 +16,16 @@ Category: Numerical, Math | |||
16 | tested-with: GHC ==6.6.1, GHC ==6.8.1, GHC ==6.8.2 | 16 | tested-with: GHC ==6.6.1, GHC ==6.8.1, GHC ==6.8.2 |
17 | 17 | ||
18 | cabal-version: >=1.2 | 18 | cabal-version: >=1.2 |
19 | build-type: Simple | ||
19 | 20 | ||
20 | flag splitBase | 21 | flag splitBase |
21 | description: Choose the new smaller, split-up base package. | 22 | description: Choose the new smaller, split-up base package. |
22 | 23 | ||
23 | library | 24 | library |
24 | if flag(splitBase) | 25 | if flag(splitBase) |
25 | build-depends: base >= 3, array | 26 | build-depends: base >= 3, array, storable-complex |
26 | else | 27 | else |
27 | build-depends: base < 3 | 28 | build-depends: base < 3, storable-complex |
28 | 29 | ||
29 | ghc-options: -O | 30 | ghc-options: -O |
30 | 31 | ||
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 5ac4f5a..baeb5bc 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs | |||
@@ -22,16 +22,8 @@ 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 | 26 | ||
26 | ---------------------------------------------------------------------- | ||
27 | instance (Storable a, RealFloat a) => Storable (Complex a) where -- | ||
28 | alignment x = alignment (realPart x) -- | ||
29 | sizeOf x = 2 * sizeOf (realPart x) -- | ||
30 | peek p = do -- | ||
31 | [re,im] <- peekArray 2 (castPtr p) -- | ||
32 | return (re :+ im) -- | ||
33 | poke p (a :+ b) = pokeArray (castPtr p) [a,b] -- | ||
34 | ---------------------------------------------------------------------- | ||
35 | 27 | ||
36 | -- | @debug x = trace (show x) x@ | 28 | -- | @debug x = trace (show x) x@ |
37 | debug :: (Show a) => a -> a | 29 | debug :: (Show a) => a -> a |