From e503945c666dc28f1a806ba1a2deaa587a836200 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 30 Dec 2010 18:07:39 +0000 Subject: cond --- lib/Data/Packed/Internal/Vector.hs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/Data/Packed') diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 70bbae2..b68d16a 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs @@ -22,7 +22,7 @@ module Data.Packed.Internal.Vector ( foldVector, foldVectorG, foldLoop, foldVectorWithIndex, createVector, vec, asComplex, asReal, float2DoubleV, double2FloatV, - stepF, stepD, + stepF, stepD, condF, condD, fwriteVector, freadVector, fprintfVector, fscanfVector, cloneVector, unsafeToForeignPtr, @@ -310,6 +310,23 @@ stepD v = unsafePerformIO $ do foreign import ccall "stepF" c_stepF :: TFF foreign import ccall "stepD" c_stepD :: TVV +--------------------------------------------------------------- + +condF :: Vector Float -> Vector Float -> Vector Float -> Vector Float -> Vector Float -> Vector Float +condF x y l e g = unsafePerformIO $ do + r <- createVector (dim x) + app6 c_condF vec x vec y vec l vec e vec g vec r "condF" + return r + +condD :: Vector Double -> Vector Double -> Vector Double -> Vector Double -> Vector Double -> Vector Double +condD x y l e g = unsafePerformIO $ do + r <- createVector (dim x) + app6 c_condD vec x vec y vec l vec e vec g vec r "condD" + return r + +foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF +foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV + ---------------------------------------------------------------- cloneVector :: Storable t => Vector t -> IO (Vector t) -- cgit v1.2.3