diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-05-08 12:18:56 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-05-08 12:18:56 +0200 |
commit | 561a6c0e21bb77c21114ccbbd86d3af5ddb5a3f1 (patch) | |
tree | d49b67d75d63938229f2d5cbed5c49d06dc02bcf /packages/base/src/Data/Packed/Vector.hs | |
parent | 5992d92357cfd911c8f2e9f5faaa4fd8a323fd9a (diff) |
Conversion, LAPACK -> base
Diffstat (limited to 'packages/base/src/Data/Packed/Vector.hs')
-rw-r--r-- | packages/base/src/Data/Packed/Vector.hs | 13 |
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 | ||
19 | module Data.Packed.Vector ( | 19 | module 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 | ||
29 | import Data.Packed.Internal.Vector | 29 | import Data.Packed.Internal.Vector |
30 | import Data.Packed.Internal.Matrix | ||
30 | import Foreign.Storable | 31 | import Foreign.Storable |
31 | 32 | ||
32 | ------------------------------------------------------------------- | 33 | ------------------------------------------------------------------- |
@@ -94,3 +95,13 @@ unzipVector = unzipVectorWith id | |||
94 | join :: Storable t => [Vector t] -> Vector t | 95 | join :: Storable t => [Vector t] -> Vector t |
95 | join = vjoin | 96 | join = vjoin |
96 | 97 | ||
98 | {- | creates a vector with a given number of equal components: | ||
99 | |||
100 | @> constant 2 7 | ||
101 | 7 |> [2.0,2.0,2.0,2.0,2.0,2.0,2.0]@ | ||
102 | -} | ||
103 | constant :: Element a => a -> Int -> Vector a | ||
104 | -- constant x n = runSTVector (newVector x n) | ||
105 | constant = constantD-- about 2x faster | ||
106 | |||
107 | |||