summaryrefslogtreecommitdiff
path: root/packages/base/src/Data/Packed
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Data/Packed')
-rw-r--r--packages/base/src/Data/Packed/Numeric.hs3
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-}
92linspace :: (Container Vector e) => Int -> (e, e) -> Vector e 92linspace :: (Container Vector e) => Int -> (e, e) -> Vector e
93linspace 0 (a,b) = fromList[(a+b)/2] 93linspace 0 _ = fromList[]
94linspace 1 (a,b) = fromList[(a+b)/2]
94linspace n (a,b) = addConstant a $ scale s $ fromList $ map fromIntegral [0 .. n-1] 95linspace 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