diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-12-28 12:30:18 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-12-28 12:30:18 +0000 |
commit | 853b46c522fa48a2c476fbfd0771a0da7aa9efc0 (patch) | |
tree | 468b345425a6793f9ed2efd5225d455fcff5e8cd /lib/Data/Packed/Internal | |
parent | b6a2f4e1dc25c5f36586af22c6f6096c526d09aa (diff) |
step, find, assoc
Diffstat (limited to 'lib/Data/Packed/Internal')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index ba68909..70bbae2 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -22,6 +22,7 @@ module Data.Packed.Internal.Vector ( | |||
22 | foldVector, foldVectorG, foldLoop, foldVectorWithIndex, | 22 | foldVector, foldVectorG, foldLoop, foldVectorWithIndex, |
23 | createVector, vec, | 23 | createVector, vec, |
24 | asComplex, asReal, float2DoubleV, double2FloatV, | 24 | asComplex, asReal, float2DoubleV, double2FloatV, |
25 | stepF, stepD, | ||
25 | fwriteVector, freadVector, fprintfVector, fscanfVector, | 26 | fwriteVector, freadVector, fprintfVector, fscanfVector, |
26 | cloneVector, | 27 | cloneVector, |
27 | unsafeToForeignPtr, | 28 | unsafeToForeignPtr, |
@@ -292,6 +293,23 @@ double2FloatV v = unsafePerformIO $ do | |||
292 | foreign import ccall "float2double" c_float2double:: TFV | 293 | foreign import ccall "float2double" c_float2double:: TFV |
293 | foreign import ccall "double2float" c_double2float:: TVF | 294 | foreign import ccall "double2float" c_double2float:: TVF |
294 | 295 | ||
296 | --------------------------------------------------------------- | ||
297 | |||
298 | stepF :: Vector Float -> Vector Float | ||
299 | stepF v = unsafePerformIO $ do | ||
300 | r <- createVector (dim v) | ||
301 | app2 c_stepF vec v vec r "stepF" | ||
302 | return r | ||
303 | |||
304 | stepD :: Vector Double -> Vector Double | ||
305 | stepD v = unsafePerformIO $ do | ||
306 | r <- createVector (dim v) | ||
307 | app2 c_stepD vec v vec r "stepD" | ||
308 | return r | ||
309 | |||
310 | foreign import ccall "stepF" c_stepF :: TFF | ||
311 | foreign import ccall "stepD" c_stepD :: TVV | ||
312 | |||
295 | ---------------------------------------------------------------- | 313 | ---------------------------------------------------------------- |
296 | 314 | ||
297 | cloneVector :: Storable t => Vector t -> IO (Vector t) | 315 | cloneVector :: Storable t => Vector t -> IO (Vector t) |