diff options
Diffstat (limited to 'lib/Numeric/GSL')
-rw-r--r-- | lib/Numeric/GSL/Vector.hs | 3 |
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) | |||
33 | import Foreign.Ptr(Ptr) | 33 | import Foreign.Ptr(Ptr) |
34 | import Foreign.C.Types | 34 | import Foreign.C.Types |
35 | import System.IO.Unsafe(unsafePerformIO) | 35 | import System.IO.Unsafe(unsafePerformIO) |
36 | import Control.Monad(when) | ||
36 | 37 | ||
37 | fromei x = fromIntegral (fromEnum x) :: CInt | 38 | fromei x = fromIntegral (fromEnum x) :: CInt |
38 | 39 | ||
@@ -201,7 +202,7 @@ vectorMapValAux fun code val v = unsafePerformIO $ do | |||
201 | 202 | ||
202 | vectorZipAux fun code u v = unsafePerformIO $ do | 203 | vectorZipAux 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 | --------------------------------------------------------------------- |