diff options
author | Alberto Ruiz <aruiz@um.es> | 2011-12-23 14:21:36 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2011-12-23 14:21:36 +0100 |
commit | d0eb68801e7c8de0996f6799db5ea691588467fa (patch) | |
tree | e72251dc5013e316b89402685626be44a5f253e8 /lib/Data | |
parent | 863fd69b44d6e65544973871043d89d1d6c50a9e (diff) |
ok also with ghc-7.0
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index f48c4b2..e85ba6e 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -23,6 +23,7 @@ module Data.Packed.Internal.Vector ( | |||
23 | createVector, vec, | 23 | createVector, vec, |
24 | asComplex, asReal, float2DoubleV, double2FloatV, | 24 | asComplex, asReal, float2DoubleV, double2FloatV, |
25 | stepF, stepD, condF, condD, | 25 | stepF, stepD, condF, condD, |
26 | conjugateQ, conjugateC, | ||
26 | fwriteVector, freadVector, fprintfVector, fscanfVector, | 27 | fwriteVector, freadVector, fprintfVector, fscanfVector, |
27 | cloneVector, | 28 | cloneVector, |
28 | unsafeToForeignPtr, | 29 | unsafeToForeignPtr, |
@@ -344,7 +345,22 @@ condD x y l e g = unsafePerformIO $ do | |||
344 | foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF | 345 | foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF |
345 | foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV | 346 | foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV |
346 | 347 | ||
347 | ---------------------------------------------------------------- | 348 | -------------------------------------------------------------------------------- |
349 | |||
350 | conjugateAux fun x = unsafePerformIO $ do | ||
351 | v <- createVector (dim x) | ||
352 | app2 fun vec x vec v "conjugateAux" | ||
353 | return v | ||
354 | |||
355 | conjugateQ :: Vector (Complex Float) -> Vector (Complex Float) | ||
356 | conjugateQ = conjugateAux c_conjugateQ | ||
357 | foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV | ||
358 | |||
359 | conjugateC :: Vector (Complex Double) -> Vector (Complex Double) | ||
360 | conjugateC = conjugateAux c_conjugateC | ||
361 | foreign import ccall "conjugateC" c_conjugateC :: TCVCV | ||
362 | |||
363 | -------------------------------------------------------------------------------- | ||
348 | 364 | ||
349 | cloneVector :: Storable t => Vector t -> IO (Vector t) | 365 | cloneVector :: Storable t => Vector t -> IO (Vector t) |
350 | cloneVector v = do | 366 | cloneVector v = do |