summaryrefslogtreecommitdiff
path: root/packages/base/src/Data/Packed/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Data/Packed/Vector.hs')
-rw-r--r--packages/base/src/Data/Packed/Vector.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/base/src/Data/Packed/Vector.hs b/packages/base/src/Data/Packed/Vector.hs
index b5a4318..653a257 100644
--- a/packages/base/src/Data/Packed/Vector.hs
+++ b/packages/base/src/Data/Packed/Vector.hs
@@ -18,7 +18,7 @@
18 18
19module Data.Packed.Vector ( 19module Data.Packed.Vector (
20 Vector, 20 Vector,
21 fromList, (|>), toList, buildVector, 21 fromList, (|>), toList, buildVector, constant,
22 dim, (@>), 22 dim, (@>),
23 subVector, takesV, vjoin, join, 23 subVector, takesV, vjoin, join,
24 mapVector, mapVectorWithIndex, zipVector, zipVectorWith, unzipVector, unzipVectorWith, 24 mapVector, mapVectorWithIndex, zipVector, zipVectorWith, unzipVector, unzipVectorWith,
@@ -27,6 +27,7 @@ module Data.Packed.Vector (
27) where 27) where
28 28
29import Data.Packed.Internal.Vector 29import Data.Packed.Internal.Vector
30import Data.Packed.Internal.Matrix
30import Foreign.Storable 31import Foreign.Storable
31 32
32------------------------------------------------------------------- 33-------------------------------------------------------------------
@@ -94,3 +95,13 @@ unzipVector = unzipVectorWith id
94join :: Storable t => [Vector t] -> Vector t 95join :: Storable t => [Vector t] -> Vector t
95join = vjoin 96join = vjoin
96 97
98{- | creates a vector with a given number of equal components:
99
100@> constant 2 7
1017 |> [2.0,2.0,2.0,2.0,2.0,2.0,2.0]@
102-}
103constant :: Element a => a -> Int -> Vector a
104-- constant x n = runSTVector (newVector x n)
105constant = constantD-- about 2x faster
106
107