summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r--lib/Data/Packed/Vector.hs15
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
28import Data.Packed.Internal.Vector 28import Data.Packed.Internal.Vector
29import Data.Binary
30import Foreign.Storable 29import Foreign.Storable
31import Control.Monad(replicateM)
32 30
33------------------------------------------------------------------- 31-------------------------------------------------------------------
34 32
33#ifdef BINARY
34
35import Data.Binary
36import 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
37chunk :: Int 40chunk :: 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