diff options
author | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-07-09 16:07:51 +0000 |
---|---|---|
committer | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-07-09 16:07:51 +0000 |
commit | c4531ceaa524b1f8a84dcdf3456d7a7b2831f902 (patch) | |
tree | 335a04f017ed8ff858336913939261d050672311 /lib/Data/Packed/Vector.hs | |
parent | 97e8a48be58fd53afccc7ae01ee6ec5805d5c1cd (diff) |
added unzipVectorWith
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index c5b8ba7..ad2ae10 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs | |||
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | ||
1 | ----------------------------------------------------------------------------- | 2 | ----------------------------------------------------------------------------- |
2 | -- | | 3 | -- | |
3 | -- Module : Data.Packed.Vector | 4 | -- Module : Data.Packed.Vector |
@@ -23,7 +24,7 @@ module Data.Packed.Vector ( | |||
23 | -- vectorFMax, vectorFMin, vectorFMaxIndex, vectorFMinIndex, | 24 | -- vectorFMax, vectorFMin, vectorFMaxIndex, vectorFMinIndex, |
24 | -- vectorMax, vectorMin, | 25 | -- vectorMax, vectorMin, |
25 | vectorMaxIndex, vectorMinIndex, | 26 | vectorMaxIndex, vectorMinIndex, |
26 | mapVector, zipVector, | 27 | mapVector, zipVector, unzipVector, unzipVectorWith, |
27 | fscanfVector, fprintfVector, freadVector, fwriteVector, | 28 | fscanfVector, fprintfVector, freadVector, fwriteVector, |
28 | foldLoop, foldVector, foldVectorG | 29 | foldLoop, foldVector, foldVectorG |
29 | ) where | 30 | ) where |
@@ -149,3 +150,7 @@ vecdisp f v | |||
149 | . unwords . lines . tail . dropWhile (not . (`elem` " \n")) | 150 | . unwords . lines . tail . dropWhile (not . (`elem` " \n")) |
150 | . f . trans . reshape 1 | 151 | . f . trans . reshape 1 |
151 | $ v | 152 | $ v |
153 | |||
154 | -- | unzip for Vectors | ||
155 | unzipVector :: (Storable a, Storable b, Storable (a,b)) => Vector (a,b) -> (Vector a,Vector b) | ||
156 | unzipVector = unzipVectorWith id id | ||