diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-10-29 18:21:06 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-10-29 18:21:06 +0000 |
commit | 2facdf74f267ff81645336528a50696f61bb8670 (patch) | |
tree | dd5049c2d0cb1b1c4cd919af77a305b9025fe8dd /lib/Data/Packed/Vector.hs | |
parent | fd73d3eb9d671bd5be23024d4cc5eeb7b5fdeb58 (diff) |
fixed terrible toList bug
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index 4c331ef..60fa7c1 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs | |||
@@ -32,8 +32,10 @@ import Numeric.GSL.Vector | |||
32 | 5 |> [-3.0,-0.5,2.0,4.5,7.0]@ | 32 | 5 |> [-3.0,-0.5,2.0,4.5,7.0]@ |
33 | -} | 33 | -} |
34 | linspace :: Int -> (Double, Double) -> Vector Double | 34 | linspace :: Int -> (Double, Double) -> Vector Double |
35 | linspace n (a,b) = fromList [a, a+delta .. b] | 35 | linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1] |
36 | where delta = (b-a)/(fromIntegral n -1) | 36 | where scale = vectorMapValR Scale |
37 | add = vectorMapValR AddConstant | ||
38 | s = (b-a)/fromIntegral (n-1) | ||
37 | 39 | ||
38 | vectorMax :: Vector Double -> Double | 40 | vectorMax :: Vector Double -> Double |
39 | vectorMax = toScalarR Max | 41 | vectorMax = toScalarR Max |