summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-rw-r--r--lib/Data/Packed/Internal/Vector.hs18
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
292foreign import ccall "float2double" c_float2double:: TFV 293foreign import ccall "float2double" c_float2double:: TFV
293foreign import ccall "double2float" c_double2float:: TVF 294foreign import ccall "double2float" c_double2float:: TVF
294 295
296---------------------------------------------------------------
297
298stepF :: Vector Float -> Vector Float
299stepF v = unsafePerformIO $ do
300 r <- createVector (dim v)
301 app2 c_stepF vec v vec r "stepF"
302 return r
303
304stepD :: Vector Double -> Vector Double
305stepD v = unsafePerformIO $ do
306 r <- createVector (dim v)
307 app2 c_stepD vec v vec r "stepD"
308 return r
309
310foreign import ccall "stepF" c_stepF :: TFF
311foreign import ccall "stepD" c_stepD :: TVV
312
295---------------------------------------------------------------- 313----------------------------------------------------------------
296 314
297cloneVector :: Storable t => Vector t -> IO (Vector t) 315cloneVector :: Storable t => Vector t -> IO (Vector t)