summaryrefslogtreecommitdiff
path: root/packages/base/src/Data/Packed
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2014-06-03 21:06:17 +0200
committerAlberto Ruiz <aruiz@um.es>2014-06-03 21:06:17 +0200
commit9a17969ad0ea9f940db6201a37b9aed19ad605df (patch)
treeccbf24f7fdcddc2d248b8deb0ca9b97a18fc94e4 /packages/base/src/Data/Packed
parent2734dd1ddc6b31aba6377ef969a33967babca519 (diff)
fix linspace, expose udot, complex static, wip
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