summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Vector.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2012-03-13 15:23:30 +0100
committerAlberto Ruiz <aruiz@um.es>2012-03-13 15:23:30 +0100
commitb959655b75da207fd7ac1c785a6ea9924d70d5a6 (patch)
tree0031778af5633100993d8447a5cbe021b1d3066f /lib/Data/Packed/Internal/Vector.hs
parentc5fcca336f7d1ad6235d411268d8ff946bbe7f0c (diff)
parent0904bbd0befa48e98858def1b6d036c5b2f00bf1 (diff)
Merge branch 'unsafe' into develop
Diffstat (limited to 'lib/Data/Packed/Internal/Vector.hs')
-rw-r--r--lib/Data/Packed/Internal/Vector.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index 936479d..d3b80ff 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -308,8 +308,8 @@ double2FloatV v = unsafePerformIO $ do
308 return r 308 return r
309 309
310 310
311foreign import ccall "float2double" c_float2double:: TFV 311foreign import ccall unsafe "float2double" c_float2double:: TFV
312foreign import ccall "double2float" c_double2float:: TVF 312foreign import ccall unsafe "double2float" c_double2float:: TVF
313 313
314--------------------------------------------------------------- 314---------------------------------------------------------------
315 315
@@ -325,8 +325,8 @@ stepD v = unsafePerformIO $ do
325 app2 c_stepD vec v vec r "stepD" 325 app2 c_stepD vec v vec r "stepD"
326 return r 326 return r
327 327
328foreign import ccall "stepF" c_stepF :: TFF 328foreign import ccall unsafe "stepF" c_stepF :: TFF
329foreign import ccall "stepD" c_stepD :: TVV 329foreign import ccall unsafe "stepD" c_stepD :: TVV
330 330
331--------------------------------------------------------------- 331---------------------------------------------------------------
332 332
@@ -342,8 +342,8 @@ condD x y l e g = unsafePerformIO $ do
342 app6 c_condD vec x vec y vec l vec e vec g vec r "condD" 342 app6 c_condD vec x vec y vec l vec e vec g vec r "condD"
343 return r 343 return r
344 344
345foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF 345foreign import ccall unsafe "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF
346foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV 346foreign import ccall unsafe "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV
347 347
348-------------------------------------------------------------------------------- 348--------------------------------------------------------------------------------
349 349
@@ -354,11 +354,11 @@ conjugateAux fun x = unsafePerformIO $ do
354 354
355conjugateQ :: Vector (Complex Float) -> Vector (Complex Float) 355conjugateQ :: Vector (Complex Float) -> Vector (Complex Float)
356conjugateQ = conjugateAux c_conjugateQ 356conjugateQ = conjugateAux c_conjugateQ
357foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV 357foreign import ccall unsafe "conjugateQ" c_conjugateQ :: TQVQV
358 358
359conjugateC :: Vector (Complex Double) -> Vector (Complex Double) 359conjugateC :: Vector (Complex Double) -> Vector (Complex Double)
360conjugateC = conjugateAux c_conjugateC 360conjugateC = conjugateAux c_conjugateC
361foreign import ccall "conjugateC" c_conjugateC :: TCVCV 361foreign import ccall unsafe "conjugateC" c_conjugateC :: TCVCV
362 362
363-------------------------------------------------------------------------------- 363--------------------------------------------------------------------------------
364 364
@@ -547,7 +547,7 @@ fscanfVector filename n = do
547 free charname 547 free charname
548 return res 548 return res
549 549
550foreign import ccall "vector_fscanf" gsl_vector_fscanf:: Ptr CChar -> TV 550foreign import ccall unsafe "vector_fscanf" gsl_vector_fscanf:: Ptr CChar -> TV
551 551
552-- | Saves the elements of a vector, with a given format (%f, %e, %g), to an ASCII file. 552-- | Saves the elements of a vector, with a given format (%f, %e, %g), to an ASCII file.
553fprintfVector :: FilePath -> String -> Vector Double -> IO () 553fprintfVector :: FilePath -> String -> Vector Double -> IO ()
@@ -558,7 +558,7 @@ fprintfVector filename fmt v = do
558 free charname 558 free charname
559 free charfmt 559 free charfmt
560 560
561foreign import ccall "vector_fprintf" gsl_vector_fprintf :: Ptr CChar -> Ptr CChar -> TV 561foreign import ccall unsafe "vector_fprintf" gsl_vector_fprintf :: Ptr CChar -> Ptr CChar -> TV
562 562
563-- | Loads a vector from a binary file (the number of elements must be known in advance). 563-- | Loads a vector from a binary file (the number of elements must be known in advance).
564freadVector :: FilePath -> Int -> IO (Vector Double) 564freadVector :: FilePath -> Int -> IO (Vector Double)
@@ -569,7 +569,7 @@ freadVector filename n = do
569 free charname 569 free charname
570 return res 570 return res
571 571
572foreign import ccall "vector_fread" gsl_vector_fread:: Ptr CChar -> TV 572foreign import ccall unsafe "vector_fread" gsl_vector_fread:: Ptr CChar -> TV
573 573
574-- | Saves the elements of a vector to a binary file. 574-- | Saves the elements of a vector to a binary file.
575fwriteVector :: FilePath -> Vector Double -> IO () 575fwriteVector :: FilePath -> Vector Double -> IO ()
@@ -578,5 +578,5 @@ fwriteVector filename v = do
578 app1 (gsl_vector_fwrite charname) vec v "gsl_vector_fwrite" 578 app1 (gsl_vector_fwrite charname) vec v "gsl_vector_fwrite"
579 free charname 579 free charname
580 580
581foreign import ccall "vector_fwrite" gsl_vector_fwrite :: Ptr CChar -> TV 581foreign import ccall unsafe "vector_fwrite" gsl_vector_fwrite :: Ptr CChar -> TV
582 582