diff options
Diffstat (limited to 'packages/base/src/Internal/Vectorized.hs')
-rw-r--r-- | packages/base/src/Internal/Vectorized.hs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/packages/base/src/Internal/Vectorized.hs b/packages/base/src/Internal/Vectorized.hs index ff51494..5c89ac9 100644 --- a/packages/base/src/Internal/Vectorized.hs +++ b/packages/base/src/Internal/Vectorized.hs | |||
@@ -94,11 +94,9 @@ sumQ = sumg c_sumQ | |||
94 | sumC :: Vector (Complex Double) -> Complex Double | 94 | sumC :: Vector (Complex Double) -> Complex Double |
95 | sumC = sumg c_sumC | 95 | sumC = sumg c_sumC |
96 | 96 | ||
97 | -- | sum of elements | 97 | sumI m = sumg (c_sumI m) |
98 | sumI :: Vector CInt -> CInt | ||
99 | sumI = sumg c_sumI | ||
100 | 98 | ||
101 | sumL = sumg c_sumL | 99 | sumL m = sumg (c_sumL m) |
102 | 100 | ||
103 | sumg f x = unsafePerformIO $ do | 101 | sumg f x = unsafePerformIO $ do |
104 | r <- createVector 1 | 102 | r <- createVector 1 |
@@ -111,8 +109,8 @@ foreign import ccall unsafe "sumF" c_sumF :: TVV Float | |||
111 | foreign import ccall unsafe "sumR" c_sumR :: TVV Double | 109 | foreign import ccall unsafe "sumR" c_sumR :: TVV Double |
112 | foreign import ccall unsafe "sumQ" c_sumQ :: TVV (Complex Float) | 110 | foreign import ccall unsafe "sumQ" c_sumQ :: TVV (Complex Float) |
113 | foreign import ccall unsafe "sumC" c_sumC :: TVV (Complex Double) | 111 | foreign import ccall unsafe "sumC" c_sumC :: TVV (Complex Double) |
114 | foreign import ccall unsafe "sumI" c_sumI :: TVV CInt | 112 | foreign import ccall unsafe "sumI" c_sumI :: I -> TVV I |
115 | foreign import ccall unsafe "sumL" c_sumL :: TVV Z | 113 | foreign import ccall unsafe "sumL" c_sumL :: Z -> TVV Z |
116 | 114 | ||
117 | -- | product of elements | 115 | -- | product of elements |
118 | prodF :: Vector Float -> Float | 116 | prodF :: Vector Float -> Float |
@@ -130,11 +128,10 @@ prodQ = prodg c_prodQ | |||
130 | prodC :: Vector (Complex Double) -> Complex Double | 128 | prodC :: Vector (Complex Double) -> Complex Double |
131 | prodC = prodg c_prodC | 129 | prodC = prodg c_prodC |
132 | 130 | ||
133 | -- | product of elements | ||
134 | prodI :: Vector CInt -> CInt | ||
135 | prodI = prodg c_prodI | ||
136 | 131 | ||
137 | prodL = prodg c_prodL | 132 | prodI = prodg . c_prodI |
133 | |||
134 | prodL = prodg . c_prodL | ||
138 | 135 | ||
139 | prodg f x = unsafePerformIO $ do | 136 | prodg f x = unsafePerformIO $ do |
140 | r <- createVector 1 | 137 | r <- createVector 1 |
@@ -146,8 +143,8 @@ foreign import ccall unsafe "prodF" c_prodF :: TVV Float | |||
146 | foreign import ccall unsafe "prodR" c_prodR :: TVV Double | 143 | foreign import ccall unsafe "prodR" c_prodR :: TVV Double |
147 | foreign import ccall unsafe "prodQ" c_prodQ :: TVV (Complex Float) | 144 | foreign import ccall unsafe "prodQ" c_prodQ :: TVV (Complex Float) |
148 | foreign import ccall unsafe "prodC" c_prodC :: TVV (Complex Double) | 145 | foreign import ccall unsafe "prodC" c_prodC :: TVV (Complex Double) |
149 | foreign import ccall unsafe "prodI" c_prodI :: TVV (CInt) | 146 | foreign import ccall unsafe "prodI" c_prodI :: I -> TVV I |
150 | foreign import ccall unsafe "prodL" c_prodL :: TVV Z | 147 | foreign import ccall unsafe "prodL" c_prodL :: Z -> TVV Z |
151 | 148 | ||
152 | ------------------------------------------------------------------ | 149 | ------------------------------------------------------------------ |
153 | 150 | ||