summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Vectorized.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Vectorized.hs')
-rw-r--r--packages/base/src/Internal/Vectorized.hs21
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
94sumC :: Vector (Complex Double) -> Complex Double 94sumC :: Vector (Complex Double) -> Complex Double
95sumC = sumg c_sumC 95sumC = sumg c_sumC
96 96
97-- | sum of elements 97sumI m = sumg (c_sumI m)
98sumI :: Vector CInt -> CInt
99sumI = sumg c_sumI
100 98
101sumL = sumg c_sumL 99sumL m = sumg (c_sumL m)
102 100
103sumg f x = unsafePerformIO $ do 101sumg 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
111foreign import ccall unsafe "sumR" c_sumR :: TVV Double 109foreign import ccall unsafe "sumR" c_sumR :: TVV Double
112foreign import ccall unsafe "sumQ" c_sumQ :: TVV (Complex Float) 110foreign import ccall unsafe "sumQ" c_sumQ :: TVV (Complex Float)
113foreign import ccall unsafe "sumC" c_sumC :: TVV (Complex Double) 111foreign import ccall unsafe "sumC" c_sumC :: TVV (Complex Double)
114foreign import ccall unsafe "sumI" c_sumI :: TVV CInt 112foreign import ccall unsafe "sumI" c_sumI :: I -> TVV I
115foreign import ccall unsafe "sumL" c_sumL :: TVV Z 113foreign import ccall unsafe "sumL" c_sumL :: Z -> TVV Z
116 114
117-- | product of elements 115-- | product of elements
118prodF :: Vector Float -> Float 116prodF :: Vector Float -> Float
@@ -130,11 +128,10 @@ prodQ = prodg c_prodQ
130prodC :: Vector (Complex Double) -> Complex Double 128prodC :: Vector (Complex Double) -> Complex Double
131prodC = prodg c_prodC 129prodC = prodg c_prodC
132 130
133-- | product of elements
134prodI :: Vector CInt -> CInt
135prodI = prodg c_prodI
136 131
137prodL = prodg c_prodL 132prodI = prodg . c_prodI
133
134prodL = prodg . c_prodL
138 135
139prodg f x = unsafePerformIO $ do 136prodg 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
146foreign import ccall unsafe "prodR" c_prodR :: TVV Double 143foreign import ccall unsafe "prodR" c_prodR :: TVV Double
147foreign import ccall unsafe "prodQ" c_prodQ :: TVV (Complex Float) 144foreign import ccall unsafe "prodQ" c_prodQ :: TVV (Complex Float)
148foreign import ccall unsafe "prodC" c_prodC :: TVV (Complex Double) 145foreign import ccall unsafe "prodC" c_prodC :: TVV (Complex Double)
149foreign import ccall unsafe "prodI" c_prodI :: TVV (CInt) 146foreign import ccall unsafe "prodI" c_prodI :: I -> TVV I
150foreign import ccall unsafe "prodL" c_prodL :: TVV Z 147foreign import ccall unsafe "prodL" c_prodL :: Z -> TVV Z
151 148
152------------------------------------------------------------------ 149------------------------------------------------------------------
153 150