From 978e6d038239af50d70bae2c303f4e45b1879b7a Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 22 Jun 2007 17:33:17 +0000 Subject: refactoring --- lib/GSL/Vector.hs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'lib/GSL/Vector.hs') diff --git a/lib/GSL/Vector.hs b/lib/GSL/Vector.hs index fc80c16..a772b34 100644 --- a/lib/GSL/Vector.hs +++ b/lib/GSL/Vector.hs @@ -121,8 +121,7 @@ vectorZipAux fun code u v = unsafePerformIO $ do toScalarR :: FunCodeS -> Vector Double -> Double toScalarR oper = toScalarAux c_toScalarR (fromEnum oper) -foreign import ccall safe "gsl-aux.h toScalarR" - c_toScalarR :: Int -> TVV -- Double :> Double :> IO Int +foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: Int -> TVV ------------------------------------------------------------------ @@ -130,15 +129,13 @@ foreign import ccall safe "gsl-aux.h toScalarR" vectorMapR :: FunCodeV -> Vector Double -> Vector Double vectorMapR = vectorMapAux c_vectorMapR -foreign import ccall safe "gsl-aux.h mapR" - c_vectorMapR :: Int -> TVV -- Double :> Double :> IO Int +foreign import ccall safe "gsl-aux.h mapR" c_vectorMapR :: Int -> TVV -- | map of complex vectors with given function vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) vectorMapC oper = vectorMapAux c_vectorMapC (fromEnum oper) -foreign import ccall safe "gsl-aux.h mapC" - c_vectorMapC :: Int -> TCVCV -- Complex Double :> Complex Double :> IO Int +foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: Int -> TCVCV ------------------------------------------------------------------- @@ -146,15 +143,13 @@ foreign import ccall safe "gsl-aux.h mapC" vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromEnum oper) -foreign import ccall safe "gsl-aux.h mapValR" - c_vectorMapValR :: Int -> Ptr Double -> TVV -- Double :> Double :> IO Int +foreign import ccall safe "gsl-aux.h mapValR" c_vectorMapValR :: Int -> Ptr Double -> TVV -- | map of complex vectors with given function vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) vectorMapValC = vectorMapValAux c_vectorMapValC -foreign import ccall safe "gsl-aux.h mapValC" - c_vectorMapValC :: Int -> Ptr (Complex Double) -> TCVCV -- Complex Double :> Complex Double :> IO Int +foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: Int -> Ptr (Complex Double) -> TCVCV ------------------------------------------------------------------- @@ -162,14 +157,10 @@ foreign import ccall safe "gsl-aux.h mapValC" vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double vectorZipR = vectorZipAux c_vectorZipR -foreign import ccall safe "gsl-aux.h zipR" - c_vectorZipR :: Int -> TVVV -- Double :> Double :> Double :> IO Int +foreign import ccall safe "gsl-aux.h zipR" c_vectorZipR :: Int -> TVVV -- | elementwise operation on complex vectors vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) vectorZipC = vectorZipAux c_vectorZipC -foreign import ccall safe "gsl-aux.h zipC" - c_vectorZipC :: Int -> TCVCVCV -- Complex Double :> Complex Double :> Complex Double :> IO Int - - +foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: Int -> TCVCVCV -- cgit v1.2.3