From 853b46c522fa48a2c476fbfd0771a0da7aa9efc0 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Tue, 28 Dec 2010 12:30:18 +0000 Subject: step, find, assoc --- lib/Data/Packed/Internal/Vector.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/Data/Packed/Internal/Vector.hs') 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 ( foldVector, foldVectorG, foldLoop, foldVectorWithIndex, createVector, vec, asComplex, asReal, float2DoubleV, double2FloatV, + stepF, stepD, fwriteVector, freadVector, fprintfVector, fscanfVector, cloneVector, unsafeToForeignPtr, @@ -292,6 +293,23 @@ double2FloatV v = unsafePerformIO $ do foreign import ccall "float2double" c_float2double:: TFV foreign import ccall "double2float" c_double2float:: TVF +--------------------------------------------------------------- + +stepF :: Vector Float -> Vector Float +stepF v = unsafePerformIO $ do + r <- createVector (dim v) + app2 c_stepF vec v vec r "stepF" + return r + +stepD :: Vector Double -> Vector Double +stepD v = unsafePerformIO $ do + r <- createVector (dim v) + app2 c_stepD vec v vec r "stepD" + return r + +foreign import ccall "stepF" c_stepF :: TFF +foreign import ccall "stepD" c_stepD :: TVV + ---------------------------------------------------------------- cloneVector :: Storable t => Vector t -> IO (Vector t) -- cgit v1.2.3