diff options
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 10 |
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 ( | |||
33 | import Data.Packed.Internal | 33 | import Data.Packed.Internal |
34 | import Numeric.GSL.Vector | 34 | import Numeric.GSL.Vector |
35 | -- import Data.Packed.ST | 35 | -- import Data.Packed.ST |
36 | 36 | import Numeric.LinearAlgebra.Linear | |
37 | 37 | ||
38 | import Data.Binary | 38 | import Data.Binary |
39 | import Foreign.Storable | 39 | import 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 | -} |
84 | linspace :: Int -> (Double, Double) -> Vector Double | 84 | linspace :: (Enum e, Linear Vector e, Element e) => Int -> (e, e) -> Vector e |
85 | linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1] | 85 | linspace 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 | {- |
91 | vectorFMax :: Vector Float -> Float | 89 | vectorFMax :: Vector Float -> Float |