summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Vector.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-06-22 10:21:15 +0000
committerAlberto Ruiz <aruiz@um.es>2007-06-22 10:21:15 +0000
commit989bdf7e88c13500bd1986dcde36f6cc4f467efb (patch)
treeb30ff0dd52e2b6c2adb1dfe8759d03234f65c684 /lib/Data/Packed/Internal/Vector.hs
parentaa14e6615533e7bd5e2b15acdc3ec76afbe1aac4 (diff)
reverting to the old signatures for aux C functions
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-rw-r--r--lib/Data/Packed/Internal/Vector.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index 125df1e..8848062 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -21,8 +21,9 @@ import Complex
21import Control.Monad(when) 21import Control.Monad(when)
22 22
23type Vc t s = Int -> Ptr t -> s 23type Vc t s = Int -> Ptr t -> s
24infixr 5 :> 24-- not yet admitted by my haddock version
25type t :> s = Vc t s 25-- infixr 5 :>
26-- type t :> s = Vc t s
26 27
27vec :: Vector t -> (Vc t s) -> s 28vec :: Vector t -> (Vc t s) -> s
28vec v f = f (dim v) (ptr v) 29vec v f = f (dim v) (ptr v)
@@ -118,10 +119,10 @@ constantAux fun n x = unsafePerformIO $ do
118 return v 119 return v
119 120
120foreign import ccall safe "aux.h constantR" 121foreign import ccall safe "aux.h constantR"
121 cconstantR :: Ptr Double -> Double :> IO Int 122 cconstantR :: Ptr Double -> TV -- Double :> IO Int
122 123
123foreign import ccall safe "aux.h constantC" 124foreign import ccall safe "aux.h constantC"
124 cconstantC :: Ptr (Complex Double) -> Complex Double :> IO Int 125 cconstantC :: Ptr (Complex Double) -> TCV -- Complex Double :> IO Int
125 126
126constant :: Field a => Int -> a -> Vector a 127constant :: Field a => Int -> a -> Vector a
127constant n x | isReal id x = scast $ constantR n (scast x) 128constant n x | isReal id x = scast $ constantR n (scast x)