diff options
Diffstat (limited to 'lib/Numeric/GSL/Vector.hs')
-rw-r--r-- | lib/Numeric/GSL/Vector.hs | 58 |
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 | ||
112 | foreign import ccall safe "gsl-aux.h sumF" c_sumF :: TFF | 112 | foreign import ccall unsafe "gsl-aux.h sumF" c_sumF :: TFF |
113 | foreign import ccall safe "gsl-aux.h sumR" c_sumR :: TVV | 113 | foreign import ccall unsafe "gsl-aux.h sumR" c_sumR :: TVV |
114 | foreign import ccall safe "gsl-aux.h sumQ" c_sumQ :: TQVQV | 114 | foreign import ccall unsafe "gsl-aux.h sumQ" c_sumQ :: TQVQV |
115 | foreign import ccall safe "gsl-aux.h sumC" c_sumC :: TCVCV | 115 | foreign import ccall unsafe "gsl-aux.h sumC" c_sumC :: TCVCV |
116 | 116 | ||
117 | -- | product of elements | 117 | -- | product of elements |
118 | prodF :: Vector Float -> Float | 118 | prodF :: 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 | ||
145 | foreign import ccall safe "gsl-aux.h prodF" c_prodF :: TFF | 145 | foreign import ccall unsafe "gsl-aux.h prodF" c_prodF :: TFF |
146 | foreign import ccall safe "gsl-aux.h prodR" c_prodR :: TVV | 146 | foreign import ccall unsafe "gsl-aux.h prodR" c_prodR :: TVV |
147 | foreign import ccall safe "gsl-aux.h prodQ" c_prodQ :: TQVQV | 147 | foreign import ccall unsafe "gsl-aux.h prodQ" c_prodQ :: TQVQV |
148 | foreign import ccall safe "gsl-aux.h prodC" c_prodC :: TCVCV | 148 | foreign import ccall unsafe "gsl-aux.h prodC" c_prodC :: TCVCV |
149 | 149 | ||
150 | -- | dot product | 150 | -- | dot product |
151 | dotF :: Vector Float -> Vector Float -> Float | 151 | dotF :: 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 | ||
178 | foreign import ccall safe "gsl-aux.h dotF" c_dotF :: TFFF | 178 | foreign import ccall unsafe "gsl-aux.h dotF" c_dotF :: TFFF |
179 | foreign import ccall safe "gsl-aux.h dotR" c_dotR :: TVVV | 179 | foreign import ccall unsafe "gsl-aux.h dotR" c_dotR :: TVVV |
180 | foreign import ccall safe "gsl-aux.h dotQ" c_dotQ :: TQVQVQV | 180 | foreign import ccall unsafe "gsl-aux.h dotQ" c_dotQ :: TQVQVQV |
181 | foreign import ccall safe "gsl-aux.h dotC" c_dotC :: TCVCVCV | 181 | foreign 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 | |||
210 | toScalarR :: FunCodeS -> Vector Double -> Double | 210 | toScalarR :: FunCodeS -> Vector Double -> Double |
211 | toScalarR oper = toScalarAux c_toScalarR (fromei oper) | 211 | toScalarR oper = toScalarAux c_toScalarR (fromei oper) |
212 | 212 | ||
213 | foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV | 213 | foreign 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. |
216 | toScalarF :: FunCodeS -> Vector Float -> Float | 216 | toScalarF :: FunCodeS -> Vector Float -> Float |
217 | toScalarF oper = toScalarAux c_toScalarF (fromei oper) | 217 | toScalarF oper = toScalarAux c_toScalarF (fromei oper) |
218 | 218 | ||
219 | foreign import ccall safe "gsl-aux.h toScalarF" c_toScalarF :: CInt -> TFF | 219 | foreign 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 |
222 | toScalarC :: FunCodeS -> Vector (Complex Double) -> Double | 222 | toScalarC :: FunCodeS -> Vector (Complex Double) -> Double |
223 | toScalarC oper = toScalarAux c_toScalarC (fromei oper) | 223 | toScalarC oper = toScalarAux c_toScalarC (fromei oper) |
224 | 224 | ||
225 | foreign import ccall safe "gsl-aux.h toScalarC" c_toScalarC :: CInt -> TCVV | 225 | foreign 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 |
228 | toScalarQ :: FunCodeS -> Vector (Complex Float) -> Float | 228 | toScalarQ :: FunCodeS -> Vector (Complex Float) -> Float |
229 | toScalarQ oper = toScalarAux c_toScalarQ (fromei oper) | 229 | toScalarQ oper = toScalarAux c_toScalarQ (fromei oper) |
230 | 230 | ||
231 | foreign import ccall safe "gsl-aux.h toScalarQ" c_toScalarQ :: CInt -> TQVF | 231 | foreign 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 | |||
236 | vectorMapR :: FunCodeV -> Vector Double -> Vector Double | 236 | vectorMapR :: FunCodeV -> Vector Double -> Vector Double |
237 | vectorMapR = vectorMapAux c_vectorMapR | 237 | vectorMapR = vectorMapAux c_vectorMapR |
238 | 238 | ||
239 | foreign import ccall safe "gsl-aux.h mapR" c_vectorMapR :: CInt -> TVV | 239 | foreign 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 |
242 | vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) | 242 | vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) |
243 | vectorMapC oper = vectorMapAux c_vectorMapC (fromei oper) | 243 | vectorMapC oper = vectorMapAux c_vectorMapC (fromei oper) |
244 | 244 | ||
245 | foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: CInt -> TCVCV | 245 | foreign 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 |
248 | vectorMapF :: FunCodeV -> Vector Float -> Vector Float | 248 | vectorMapF :: FunCodeV -> Vector Float -> Vector Float |
249 | vectorMapF = vectorMapAux c_vectorMapF | 249 | vectorMapF = vectorMapAux c_vectorMapF |
250 | 250 | ||
251 | foreign import ccall safe "gsl-aux.h mapF" c_vectorMapF :: CInt -> TFF | 251 | foreign 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 |
254 | vectorMapQ :: FunCodeV -> Vector (Complex Float) -> Vector (Complex Float) | 254 | vectorMapQ :: FunCodeV -> Vector (Complex Float) -> Vector (Complex Float) |
255 | vectorMapQ = vectorMapAux c_vectorMapQ | 255 | vectorMapQ = vectorMapAux c_vectorMapQ |
256 | 256 | ||
257 | foreign import ccall safe "gsl-aux.h mapQ" c_vectorMapQ :: CInt -> TQVQV | 257 | foreign 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 | |||
262 | vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double | 262 | vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double |
263 | vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromei oper) | 263 | vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromei oper) |
264 | 264 | ||
265 | foreign import ccall safe "gsl-aux.h mapValR" c_vectorMapValR :: CInt -> Ptr Double -> TVV | 265 | foreign 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 |
268 | vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) | 268 | vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) |
269 | vectorMapValC = vectorMapValAux c_vectorMapValC | 269 | vectorMapValC = vectorMapValAux c_vectorMapValC |
270 | 270 | ||
271 | foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: CInt -> Ptr (Complex Double) -> TCVCV | 271 | foreign 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 |
274 | vectorMapValF :: FunCodeSV -> Float -> Vector Float -> Vector Float | 274 | vectorMapValF :: FunCodeSV -> Float -> Vector Float -> Vector Float |
275 | vectorMapValF oper = vectorMapValAux c_vectorMapValF (fromei oper) | 275 | vectorMapValF oper = vectorMapValAux c_vectorMapValF (fromei oper) |
276 | 276 | ||
277 | foreign import ccall safe "gsl-aux.h mapValF" c_vectorMapValF :: CInt -> Ptr Float -> TFF | 277 | foreign 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 |
280 | vectorMapValQ :: FunCodeSV -> Complex Float -> Vector (Complex Float) -> Vector (Complex Float) | 280 | vectorMapValQ :: FunCodeSV -> Complex Float -> Vector (Complex Float) -> Vector (Complex Float) |
281 | vectorMapValQ oper = vectorMapValAux c_vectorMapValQ (fromei oper) | 281 | vectorMapValQ oper = vectorMapValAux c_vectorMapValQ (fromei oper) |
282 | 282 | ||
283 | foreign import ccall safe "gsl-aux.h mapValQ" c_vectorMapValQ :: CInt -> Ptr (Complex Float) -> TQVQV | 283 | foreign 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 | |||
288 | vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double | 288 | vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double |
289 | vectorZipR = vectorZipAux c_vectorZipR | 289 | vectorZipR = vectorZipAux c_vectorZipR |
290 | 290 | ||
291 | foreign import ccall safe "gsl-aux.h zipR" c_vectorZipR :: CInt -> TVVV | 291 | foreign 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 |
294 | vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) | 294 | vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) |
295 | vectorZipC = vectorZipAux c_vectorZipC | 295 | vectorZipC = vectorZipAux c_vectorZipC |
296 | 296 | ||
297 | foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: CInt -> TCVCVCV | 297 | foreign 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 |
300 | vectorZipF :: FunCodeVV -> Vector Float -> Vector Float -> Vector Float | 300 | vectorZipF :: FunCodeVV -> Vector Float -> Vector Float -> Vector Float |
301 | vectorZipF = vectorZipAux c_vectorZipF | 301 | vectorZipF = vectorZipAux c_vectorZipF |
302 | 302 | ||
303 | foreign import ccall safe "gsl-aux.h zipF" c_vectorZipF :: CInt -> TFFF | 303 | foreign 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 |
306 | vectorZipQ :: FunCodeVV -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) | 306 | vectorZipQ :: FunCodeVV -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) |
307 | vectorZipQ = vectorZipAux c_vectorZipQ | 307 | vectorZipQ = vectorZipAux c_vectorZipQ |
308 | 308 | ||
309 | foreign import ccall safe "gsl-aux.h zipQ" c_vectorZipQ :: CInt -> TQVQVQV | 309 | foreign 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 | ||
327 | foreign import ccall safe "random_vector" c_random_vector :: CInt -> CInt -> TV | 327 | foreign import ccall unsafe "random_vector" c_random_vector :: CInt -> CInt -> TV |