summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/Vector.hs')
-rw-r--r--lib/Numeric/GSL/Vector.hs58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/Numeric/GSL/Vector.hs b/lib/Numeric/GSL/Vector.hs
index b8c6d04..db34041 100644
--- a/lib/Numeric/GSL/Vector.hs
+++ b/lib/Numeric/GSL/Vector.hs
@@ -109,10 +109,10 @@ sumC x = unsafePerformIO $ do
109 app2 c_sumC vec x vec r "sumC" 109 app2 c_sumC vec x vec r "sumC"
110 return $ r @> 0 110 return $ r @> 0
111 111
112foreign import ccall safe "gsl-aux.h sumF" c_sumF :: TFF 112foreign import ccall unsafe "gsl-aux.h sumF" c_sumF :: TFF
113foreign import ccall safe "gsl-aux.h sumR" c_sumR :: TVV 113foreign import ccall unsafe "gsl-aux.h sumR" c_sumR :: TVV
114foreign import ccall safe "gsl-aux.h sumQ" c_sumQ :: TQVQV 114foreign import ccall unsafe "gsl-aux.h sumQ" c_sumQ :: TQVQV
115foreign import ccall safe "gsl-aux.h sumC" c_sumC :: TCVCV 115foreign import ccall unsafe "gsl-aux.h sumC" c_sumC :: TCVCV
116 116
117-- | product of elements 117-- | product of elements
118prodF :: Vector Float -> Float 118prodF :: Vector Float -> Float
@@ -142,10 +142,10 @@ prodC x = unsafePerformIO $ do
142 app2 c_prodC vec x vec r "prodC" 142 app2 c_prodC vec x vec r "prodC"
143 return $ r @> 0 143 return $ r @> 0
144 144
145foreign import ccall safe "gsl-aux.h prodF" c_prodF :: TFF 145foreign import ccall unsafe "gsl-aux.h prodF" c_prodF :: TFF
146foreign import ccall safe "gsl-aux.h prodR" c_prodR :: TVV 146foreign import ccall unsafe "gsl-aux.h prodR" c_prodR :: TVV
147foreign import ccall safe "gsl-aux.h prodQ" c_prodQ :: TQVQV 147foreign import ccall unsafe "gsl-aux.h prodQ" c_prodQ :: TQVQV
148foreign import ccall safe "gsl-aux.h prodC" c_prodC :: TCVCV 148foreign import ccall unsafe "gsl-aux.h prodC" c_prodC :: TCVCV
149 149
150-- | dot product 150-- | dot product
151dotF :: Vector Float -> Vector Float -> Float 151dotF :: Vector Float -> Vector Float -> Float
@@ -175,10 +175,10 @@ dotC x y = unsafePerformIO $ do
175 app3 c_dotC vec x vec y vec r "dotC" 175 app3 c_dotC vec x vec y vec r "dotC"
176 return $ r @> 0 176 return $ r @> 0
177 177
178foreign import ccall safe "gsl-aux.h dotF" c_dotF :: TFFF 178foreign import ccall unsafe "gsl-aux.h dotF" c_dotF :: TFFF
179foreign import ccall safe "gsl-aux.h dotR" c_dotR :: TVVV 179foreign import ccall unsafe "gsl-aux.h dotR" c_dotR :: TVVV
180foreign import ccall safe "gsl-aux.h dotQ" c_dotQ :: TQVQVQV 180foreign import ccall unsafe "gsl-aux.h dotQ" c_dotQ :: TQVQVQV
181foreign import ccall safe "gsl-aux.h dotC" c_dotC :: TCVCVCV 181foreign import ccall unsafe "gsl-aux.h dotC" c_dotC :: TCVCVCV
182 182
183------------------------------------------------------------------ 183------------------------------------------------------------------
184 184
@@ -210,25 +210,25 @@ vectorZipAux fun code u v = unsafePerformIO $ do
210toScalarR :: FunCodeS -> Vector Double -> Double 210toScalarR :: FunCodeS -> Vector Double -> Double
211toScalarR oper = toScalarAux c_toScalarR (fromei oper) 211toScalarR oper = toScalarAux c_toScalarR (fromei oper)
212 212
213foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV 213foreign import ccall unsafe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV
214 214
215-- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc. 215-- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.
216toScalarF :: FunCodeS -> Vector Float -> Float 216toScalarF :: FunCodeS -> Vector Float -> Float
217toScalarF oper = toScalarAux c_toScalarF (fromei oper) 217toScalarF oper = toScalarAux c_toScalarF (fromei oper)
218 218
219foreign import ccall safe "gsl-aux.h toScalarF" c_toScalarF :: CInt -> TFF 219foreign import ccall unsafe "gsl-aux.h toScalarF" c_toScalarF :: CInt -> TFF
220 220
221-- | obtains different functions of a vector: only norm1, norm2 221-- | obtains different functions of a vector: only norm1, norm2
222toScalarC :: FunCodeS -> Vector (Complex Double) -> Double 222toScalarC :: FunCodeS -> Vector (Complex Double) -> Double
223toScalarC oper = toScalarAux c_toScalarC (fromei oper) 223toScalarC oper = toScalarAux c_toScalarC (fromei oper)
224 224
225foreign import ccall safe "gsl-aux.h toScalarC" c_toScalarC :: CInt -> TCVV 225foreign import ccall unsafe "gsl-aux.h toScalarC" c_toScalarC :: CInt -> TCVV
226 226
227-- | obtains different functions of a vector: only norm1, norm2 227-- | obtains different functions of a vector: only norm1, norm2
228toScalarQ :: FunCodeS -> Vector (Complex Float) -> Float 228toScalarQ :: FunCodeS -> Vector (Complex Float) -> Float
229toScalarQ oper = toScalarAux c_toScalarQ (fromei oper) 229toScalarQ oper = toScalarAux c_toScalarQ (fromei oper)
230 230
231foreign import ccall safe "gsl-aux.h toScalarQ" c_toScalarQ :: CInt -> TQVF 231foreign import ccall unsafe "gsl-aux.h toScalarQ" c_toScalarQ :: CInt -> TQVF
232 232
233------------------------------------------------------------------ 233------------------------------------------------------------------
234 234
@@ -236,25 +236,25 @@ foreign import ccall safe "gsl-aux.h toScalarQ" c_toScalarQ :: CInt -> TQVF
236vectorMapR :: FunCodeV -> Vector Double -> Vector Double 236vectorMapR :: FunCodeV -> Vector Double -> Vector Double
237vectorMapR = vectorMapAux c_vectorMapR 237vectorMapR = vectorMapAux c_vectorMapR
238 238
239foreign import ccall safe "gsl-aux.h mapR" c_vectorMapR :: CInt -> TVV 239foreign import ccall unsafe "gsl-aux.h mapR" c_vectorMapR :: CInt -> TVV
240 240
241-- | map of complex vectors with given function 241-- | map of complex vectors with given function
242vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) 242vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double)
243vectorMapC oper = vectorMapAux c_vectorMapC (fromei oper) 243vectorMapC oper = vectorMapAux c_vectorMapC (fromei oper)
244 244
245foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: CInt -> TCVCV 245foreign import ccall unsafe "gsl-aux.h mapC" c_vectorMapC :: CInt -> TCVCV
246 246
247-- | map of real vectors with given function 247-- | map of real vectors with given function
248vectorMapF :: FunCodeV -> Vector Float -> Vector Float 248vectorMapF :: FunCodeV -> Vector Float -> Vector Float
249vectorMapF = vectorMapAux c_vectorMapF 249vectorMapF = vectorMapAux c_vectorMapF
250 250
251foreign import ccall safe "gsl-aux.h mapF" c_vectorMapF :: CInt -> TFF 251foreign import ccall unsafe "gsl-aux.h mapF" c_vectorMapF :: CInt -> TFF
252 252
253-- | map of real vectors with given function 253-- | map of real vectors with given function
254vectorMapQ :: FunCodeV -> Vector (Complex Float) -> Vector (Complex Float) 254vectorMapQ :: FunCodeV -> Vector (Complex Float) -> Vector (Complex Float)
255vectorMapQ = vectorMapAux c_vectorMapQ 255vectorMapQ = vectorMapAux c_vectorMapQ
256 256
257foreign import ccall safe "gsl-aux.h mapQ" c_vectorMapQ :: CInt -> TQVQV 257foreign import ccall unsafe "gsl-aux.h mapQ" c_vectorMapQ :: CInt -> TQVQV
258 258
259------------------------------------------------------------------- 259-------------------------------------------------------------------
260 260
@@ -262,25 +262,25 @@ foreign import ccall safe "gsl-aux.h mapQ" c_vectorMapQ :: CInt -> TQVQV
262vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double 262vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double
263vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromei oper) 263vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromei oper)
264 264
265foreign import ccall safe "gsl-aux.h mapValR" c_vectorMapValR :: CInt -> Ptr Double -> TVV 265foreign import ccall unsafe "gsl-aux.h mapValR" c_vectorMapValR :: CInt -> Ptr Double -> TVV
266 266
267-- | map of complex vectors with given function 267-- | map of complex vectors with given function
268vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) 268vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double)
269vectorMapValC = vectorMapValAux c_vectorMapValC 269vectorMapValC = vectorMapValAux c_vectorMapValC
270 270
271foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: CInt -> Ptr (Complex Double) -> TCVCV 271foreign import ccall unsafe "gsl-aux.h mapValC" c_vectorMapValC :: CInt -> Ptr (Complex Double) -> TCVCV
272 272
273-- | map of real vectors with given function 273-- | map of real vectors with given function
274vectorMapValF :: FunCodeSV -> Float -> Vector Float -> Vector Float 274vectorMapValF :: FunCodeSV -> Float -> Vector Float -> Vector Float
275vectorMapValF oper = vectorMapValAux c_vectorMapValF (fromei oper) 275vectorMapValF oper = vectorMapValAux c_vectorMapValF (fromei oper)
276 276
277foreign import ccall safe "gsl-aux.h mapValF" c_vectorMapValF :: CInt -> Ptr Float -> TFF 277foreign import ccall unsafe "gsl-aux.h mapValF" c_vectorMapValF :: CInt -> Ptr Float -> TFF
278 278
279-- | map of complex vectors with given function 279-- | map of complex vectors with given function
280vectorMapValQ :: FunCodeSV -> Complex Float -> Vector (Complex Float) -> Vector (Complex Float) 280vectorMapValQ :: FunCodeSV -> Complex Float -> Vector (Complex Float) -> Vector (Complex Float)
281vectorMapValQ oper = vectorMapValAux c_vectorMapValQ (fromei oper) 281vectorMapValQ oper = vectorMapValAux c_vectorMapValQ (fromei oper)
282 282
283foreign import ccall safe "gsl-aux.h mapValQ" c_vectorMapValQ :: CInt -> Ptr (Complex Float) -> TQVQV 283foreign import ccall unsafe "gsl-aux.h mapValQ" c_vectorMapValQ :: CInt -> Ptr (Complex Float) -> TQVQV
284 284
285------------------------------------------------------------------- 285-------------------------------------------------------------------
286 286
@@ -288,25 +288,25 @@ foreign import ccall safe "gsl-aux.h mapValQ" c_vectorMapValQ :: CInt -> Ptr (Co
288vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double 288vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double
289vectorZipR = vectorZipAux c_vectorZipR 289vectorZipR = vectorZipAux c_vectorZipR
290 290
291foreign import ccall safe "gsl-aux.h zipR" c_vectorZipR :: CInt -> TVVV 291foreign import ccall unsafe "gsl-aux.h zipR" c_vectorZipR :: CInt -> TVVV
292 292
293-- | elementwise operation on complex vectors 293-- | elementwise operation on complex vectors
294vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) 294vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)
295vectorZipC = vectorZipAux c_vectorZipC 295vectorZipC = vectorZipAux c_vectorZipC
296 296
297foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: CInt -> TCVCVCV 297foreign import ccall unsafe "gsl-aux.h zipC" c_vectorZipC :: CInt -> TCVCVCV
298 298
299-- | elementwise operation on real vectors 299-- | elementwise operation on real vectors
300vectorZipF :: FunCodeVV -> Vector Float -> Vector Float -> Vector Float 300vectorZipF :: FunCodeVV -> Vector Float -> Vector Float -> Vector Float
301vectorZipF = vectorZipAux c_vectorZipF 301vectorZipF = vectorZipAux c_vectorZipF
302 302
303foreign import ccall safe "gsl-aux.h zipF" c_vectorZipF :: CInt -> TFFF 303foreign import ccall unsafe "gsl-aux.h zipF" c_vectorZipF :: CInt -> TFFF
304 304
305-- | elementwise operation on complex vectors 305-- | elementwise operation on complex vectors
306vectorZipQ :: FunCodeVV -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) 306vectorZipQ :: FunCodeVV -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)
307vectorZipQ = vectorZipAux c_vectorZipQ 307vectorZipQ = vectorZipAux c_vectorZipQ
308 308
309foreign import ccall safe "gsl-aux.h zipQ" c_vectorZipQ :: CInt -> TQVQVQV 309foreign import ccall unsafe "gsl-aux.h zipQ" c_vectorZipQ :: CInt -> TQVQVQV
310 310
311----------------------------------------------------------------------- 311-----------------------------------------------------------------------
312 312
@@ -324,4 +324,4 @@ randomVector seed dist n = unsafePerformIO $ do
324 app1 (c_random_vector (fi seed) ((fi.fromEnum) dist)) vec r "randomVector" 324 app1 (c_random_vector (fi seed) ((fi.fromEnum) dist)) vec r "randomVector"
325 return r 325 return r
326 326
327foreign import ccall safe "random_vector" c_random_vector :: CInt -> CInt -> TV 327foreign import ccall unsafe "random_vector" c_random_vector :: CInt -> CInt -> TV