summaryrefslogtreecommitdiff
path: root/packages/base/src/Data/Packed/Vector.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2014-05-08 12:18:56 +0200
committerAlberto Ruiz <aruiz@um.es>2014-05-08 12:18:56 +0200
commit561a6c0e21bb77c21114ccbbd86d3af5ddb5a3f1 (patch)
treed49b67d75d63938229f2d5cbed5c49d06dc02bcf /packages/base/src/Data/Packed/Vector.hs
parent5992d92357cfd911c8f2e9f5faaa4fd8a323fd9a (diff)
Conversion, LAPACK -> base
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