summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL')
-rw-r--r--lib/Numeric/GSL/Vector.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Numeric/GSL/Vector.hs b/lib/Numeric/GSL/Vector.hs
index db34041..6204b8e 100644
--- a/lib/Numeric/GSL/Vector.hs
+++ b/lib/Numeric/GSL/Vector.hs
@@ -33,6 +33,7 @@ import Foreign.Marshal.Array(newArray)
33import Foreign.Ptr(Ptr) 33import Foreign.Ptr(Ptr)
34import Foreign.C.Types 34import Foreign.C.Types
35import System.IO.Unsafe(unsafePerformIO) 35import System.IO.Unsafe(unsafePerformIO)
36import Control.Monad(when)
36 37
37fromei x = fromIntegral (fromEnum x) :: CInt 38fromei x = fromIntegral (fromEnum x) :: CInt
38 39
@@ -201,7 +202,7 @@ vectorMapValAux fun code val v = unsafePerformIO $ do
201 202
202vectorZipAux fun code u v = unsafePerformIO $ do 203vectorZipAux fun code u v = unsafePerformIO $ do
203 r <- createVector (dim u) 204 r <- createVector (dim u)
204 app3 (fun (fromei code)) vec u vec v vec r "vectorZipAux" 205 when (dim u > 0) $ app3 (fun (fromei code)) vec u vec v vec r "vectorZipAux"
205 return r 206 return r
206 207
207--------------------------------------------------------------------- 208---------------------------------------------------------------------