diff options
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-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) |