summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-12-28 12:30:18 +0000
committerAlberto Ruiz <aruiz@um.es>2010-12-28 12:30:18 +0000
commit853b46c522fa48a2c476fbfd0771a0da7aa9efc0 (patch)
tree468b345425a6793f9ed2efd5225d455fcff5e8cd /lib/Data/Packed/Internal
parentb6a2f4e1dc25c5f36586af22c6f6096c526d09aa (diff)
step, find, assoc
Diffstat (limited to 'lib/Data/Packed/Internal')
-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)