diff options
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 12 |
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 | ||
28 | import Data.Packed.Internal | 28 | import Data.Packed.Internal |
29 | import Complex | 29 | import Complex |
30 | import 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 |
33 | toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) | 33 | toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) |
@@ -50,7 +50,9 @@ linspace :: Int -> (Double, Double) -> Vector Double | |||
50 | linspace n (a,b) = fromList [a::Double,a+delta .. b] | 50 | linspace 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 | 54 | dot :: (Field t) => Vector t -> Vector t -> t |
55 | infixl 9 @> | 55 | dot 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 | |||