diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-10-21 07:53:59 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-10-21 07:53:59 +0000 |
commit | 98b21c5ddcbc9fbfddd5dbec646916f016b43e6d (patch) | |
tree | bb7a8d27f833cb5dff93fb1489fc8a73a4b3201e /lib/Data/Packed/Vector.hs | |
parent | bed52f7c21afe7da9bc0a7fe52b748dbeda74610 (diff) |
option -f-binary (for testing ghc7)
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index 8b1e813..f90f8e4 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs | |||
@@ -1,13 +1,13 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | 1 | {-# LANGUAGE FlexibleContexts #-} |
2 | {-# LANGUAGE CPP #-} | ||
2 | ----------------------------------------------------------------------------- | 3 | ----------------------------------------------------------------------------- |
3 | -- | | 4 | -- | |
4 | -- Module : Data.Packed.Vector | 5 | -- Module : Data.Packed.Vector |
5 | -- Copyright : (c) Alberto Ruiz 2007 | 6 | -- Copyright : (c) Alberto Ruiz 2007-10 |
6 | -- License : GPL-style | 7 | -- License : GPL |
7 | -- | 8 | -- |
8 | -- Maintainer : Alberto Ruiz <aruiz@um.es> | 9 | -- Maintainer : Alberto Ruiz <aruiz@um.es> |
9 | -- Stability : provisional | 10 | -- Stability : provisional |
10 | -- Portability : portable | ||
11 | -- | 11 | -- |
12 | -- 1D arrays suitable for numeric computations using external libraries. | 12 | -- 1D arrays suitable for numeric computations using external libraries. |
13 | -- | 13 | -- |
@@ -26,12 +26,15 @@ module Data.Packed.Vector ( | |||
26 | ) where | 26 | ) where |
27 | 27 | ||
28 | import Data.Packed.Internal.Vector | 28 | import Data.Packed.Internal.Vector |
29 | import Data.Binary | ||
30 | import Foreign.Storable | 29 | import Foreign.Storable |
31 | import Control.Monad(replicateM) | ||
32 | 30 | ||
33 | ------------------------------------------------------------------- | 31 | ------------------------------------------------------------------- |
34 | 32 | ||
33 | #ifdef BINARY | ||
34 | |||
35 | import Data.Binary | ||
36 | import Control.Monad(replicateM) | ||
37 | |||
35 | -- a 64K cache, with a Double taking 13 bytes in Bytestring, | 38 | -- a 64K cache, with a Double taking 13 bytes in Bytestring, |
36 | -- implies a chunk size of 5041 | 39 | -- implies a chunk size of 5041 |
37 | chunk :: Int | 40 | chunk :: Int |
@@ -60,6 +63,8 @@ instance (Binary a, Storable a) => Binary (Vector a) where | |||
60 | vs <- mapM getVector $ chunks d | 63 | vs <- mapM getVector $ chunks d |
61 | return $! join vs | 64 | return $! join vs |
62 | 65 | ||
66 | #endif | ||
67 | |||
63 | ------------------------------------------------------------------- | 68 | ------------------------------------------------------------------- |
64 | 69 | ||
65 | {- | creates a Vector of the specified length using the supplied function to | 70 | {- | creates a Vector of the specified length using the supplied function to |