summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Vector.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-10-29 18:21:06 +0000
committerAlberto Ruiz <aruiz@um.es>2007-10-29 18:21:06 +0000
commit2facdf74f267ff81645336528a50696f61bb8670 (patch)
treedd5049c2d0cb1b1c4cd919af77a305b9025fe8dd /lib/Data/Packed/Vector.hs
parentfd73d3eb9d671bd5be23024d4cc5eeb7b5fdeb58 (diff)
fixed terrible toList bug
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r--lib/Data/Packed/Vector.hs6
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
325 |> [-3.0,-0.5,2.0,4.5,7.0]@ 325 |> [-3.0,-0.5,2.0,4.5,7.0]@
33-} 33-}
34linspace :: Int -> (Double, Double) -> Vector Double 34linspace :: Int -> (Double, Double) -> Vector Double
35linspace n (a,b) = fromList [a, a+delta .. b] 35linspace 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
38vectorMax :: Vector Double -> Double 40vectorMax :: Vector Double -> Double
39vectorMax = toScalarR Max 41vectorMax = toScalarR Max