diff options
Diffstat (limited to 'packages/base/src/Data/Packed')
-rw-r--r-- | packages/base/src/Data/Packed/Numeric.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/base/src/Data/Packed/Numeric.hs b/packages/base/src/Data/Packed/Numeric.hs index e324ab6..e90c612 100644 --- a/packages/base/src/Data/Packed/Numeric.hs +++ b/packages/base/src/Data/Packed/Numeric.hs | |||
@@ -90,7 +90,8 @@ Logarithmic spacing can be defined as follows: | |||
90 | @logspace n (a,b) = 10 ** linspace n (a,b)@ | 90 | @logspace n (a,b) = 10 ** linspace n (a,b)@ |
91 | -} | 91 | -} |
92 | linspace :: (Container Vector e) => Int -> (e, e) -> Vector e | 92 | linspace :: (Container Vector e) => Int -> (e, e) -> Vector e |
93 | linspace 0 (a,b) = fromList[(a+b)/2] | 93 | linspace 0 _ = fromList[] |
94 | linspace 1 (a,b) = fromList[(a+b)/2] | ||
94 | linspace n (a,b) = addConstant a $ scale s $ fromList $ map fromIntegral [0 .. n-1] | 95 | linspace n (a,b) = addConstant a $ scale s $ fromList $ map fromIntegral [0 .. n-1] |
95 | where s = (b-a)/fromIntegral (n-1) | 96 | where s = (b-a)/fromIntegral (n-1) |
96 | 97 | ||