diff options
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index 457da71..ed0e49c 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs | |||
@@ -32,6 +32,10 @@ import Numeric.GSL.Vector | |||
32 | 32 | ||
33 | @\> linspace 5 (-3,7) | 33 | @\> linspace 5 (-3,7) |
34 | 5 |> [-3.0,-0.5,2.0,4.5,7.0]@ | 34 | 5 |> [-3.0,-0.5,2.0,4.5,7.0]@ |
35 | |||
36 | Logarithmic spacing can be defined as follows: | ||
37 | |||
38 | @logspace n (a,b) = 10 ** linspace n (a,b)@ | ||
35 | -} | 39 | -} |
36 | linspace :: Int -> (Double, Double) -> Vector Double | 40 | linspace :: Int -> (Double, Double) -> Vector Double |
37 | linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1] | 41 | linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1] |