diff options
author | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-07-02 10:42:54 +0000 |
---|---|---|
committer | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-07-02 10:42:54 +0000 |
commit | dd054da0524abdb14d013c9f9f43272515b77b6e (patch) | |
tree | bd61cf48e912d74eab1c46080354d5fc795d2496 /lib/Data/Packed | |
parent | fc6e8a553c99f50768b49c8612f800edef790d93 (diff) |
fixed-zero-chunk-size-in-binary-vector
Diffstat (limited to 'lib/Data/Packed')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index 7264528..4f25b6f 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs | |||
@@ -43,7 +43,8 @@ chunk = 5000 | |||
43 | 43 | ||
44 | chunks :: Int -> [Int] | 44 | chunks :: Int -> [Int] |
45 | chunks d = let c = d `div` chunk | 45 | chunks d = let c = d `div` chunk |
46 | in ((d-c*chunk):(replicate c chunk)) | 46 | m = d `mod` chunk |
47 | in if m /= 0 then reverse (m:(replicate c chunk)) else (replicate c chunk) | ||
47 | 48 | ||
48 | putVector v = do | 49 | putVector v = do |
49 | let d = dim v | 50 | let d = dim v |