summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r--lib/Data/Packed/Vector.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index b87372f..760f724 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -33,7 +33,7 @@ module Data.Packed.Vector (
33import Data.Packed.Internal 33import Data.Packed.Internal
34import Numeric.GSL.Vector 34import Numeric.GSL.Vector
35-- import Data.Packed.ST 35-- import Data.Packed.ST
36 36import Numeric.LinearAlgebra.Linear
37 37
38import Data.Binary 38import Data.Binary
39import Foreign.Storable 39import Foreign.Storable
@@ -81,11 +81,9 @@ Logarithmic spacing can be defined as follows:
81 81
82@logspace n (a,b) = 10 ** linspace n (a,b)@ 82@logspace n (a,b) = 10 ** linspace n (a,b)@
83-} 83-}
84linspace :: Int -> (Double, Double) -> Vector Double 84linspace :: (Enum e, Linear Vector e, Element e) => Int -> (e, e) -> Vector e
85linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1] 85linspace n (a,b) = addConstant a $ scale s $ fromList [0 .. fromIntegral n-1]
86 where scale = vectorMapValR Scale 86 where s = (b-a)/fromIntegral (n-1)
87 add = vectorMapValR AddConstant
88 s = (b-a)/fromIntegral (n-1)
89 87
90{- 88{-
91vectorFMax :: Vector Float -> Float 89vectorFMax :: Vector Float -> Float