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.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index 27ba6a3..867b77b 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -27,7 +27,7 @@ module Data.Packed.Vector (
27 27
28import Data.Packed.Internal 28import Data.Packed.Internal
29import Complex 29import Complex
30import GSL.Vector 30--import GSL.Vector
31 31
32-- | creates a complex vector from vectors with real and imaginary parts 32-- | creates a complex vector from vectors with real and imaginary parts
33toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) 33toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double)
@@ -50,7 +50,9 @@ linspace :: Int -> (Double, Double) -> Vector Double
50linspace n (a,b) = fromList [a::Double,a+delta .. b] 50linspace n (a,b) = fromList [a::Double,a+delta .. b]
51 where delta = (b-a)/(fromIntegral n -1) 51 where delta = (b-a)/(fromIntegral n -1)
52 52
53-- | Reads a vector position. 53
54(@>) :: Field t => Vector t -> Int -> t 54dot :: (Field t) => Vector t -> Vector t -> t
55infixl 9 @> 55dot u v = dat (multiply RowMajor r c) `at` 0
56(@>) = at 56 where r = matrixFromVector RowMajor (dim u) u
57 c = matrixFromVector RowMajor 1 v
58