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.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index 6415c5c..0bbbc34 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -24,6 +24,7 @@ module Data.Packed.Vector (
24 24
25import Data.Packed.Internal 25import Data.Packed.Internal
26import Numeric.GSL.Vector 26import Numeric.GSL.Vector
27import Data.Packed.ST
27 28
28{- | Creates a real vector containing a range of values: 29{- | Creates a real vector containing a range of values:
29 30
@@ -47,3 +48,11 @@ vectorMaxIndex = round . toScalarR MaxIdx
47 48
48vectorMinIndex :: Vector Double -> Int 49vectorMinIndex :: Vector Double -> Int
49vectorMinIndex = round . toScalarR MinIdx 50vectorMinIndex = round . toScalarR MinIdx
51
52{- | creates a vector with a given number of equal components:
53
54@> constant 2 7
557 |> [2.0,2.0,2.0,2.0,2.0,2.0,2.0]@
56-}
57constant :: Element a => a -> Int -> Vector a
58constant x n = runSTVector (newVector x n)