From 0ff13d993b880739295de343bca62f06fac5ca0c Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 12 Sep 2007 19:09:47 +0000 Subject: documentation --- lib/Data/Packed/Vector.hs | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'lib/Data/Packed/Vector.hs') diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index 867b77b..9818d58 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs @@ -13,33 +13,17 @@ ----------------------------------------------------------------------------- module Data.Packed.Vector ( - Vector(dim), Field, - fromList, toList, - (@>), + Vector, + fromList, (|>), toList, + dim, (@>), subVector, join, - constant, - toComplex, comp, - conj, - dot, - linspace, + constant, linspace, + liftVector, liftVector2 ) where import Data.Packed.Internal import Complex ---import GSL.Vector - --- | creates a complex vector from vectors with real and imaginary parts -toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) -toComplex (r,i) = asComplex $ cdat $ fromColumns [r,i] - --- | obtains the complex conjugate of a complex vector -conj :: Vector (Complex Double) -> Vector (Complex Double) -conj v = asComplex $ cdat $ reshape 2 (asReal v) `mulC` diag (fromList [1,-1]) - where mulC = multiply RowMajor - -comp :: Vector Double -> Vector (Complex Double) -comp v = toComplex (v,constant 0 (dim v)) {- | Creates a real vector containing a range of values: @@ -47,12 +31,5 @@ comp v = toComplex (v,constant 0 (dim v)) 5 |> [-3.0,-0.5,2.0,4.5,7.0]@ -} linspace :: Int -> (Double, Double) -> Vector Double -linspace n (a,b) = fromList [a::Double,a+delta .. b] +linspace n (a,b) = fromList [a, a+delta .. b] where delta = (b-a)/(fromIntegral n -1) - - -dot :: (Field t) => Vector t -> Vector t -> t -dot u v = dat (multiply RowMajor r c) `at` 0 - where r = matrixFromVector RowMajor (dim u) u - c = matrixFromVector RowMajor 1 v - -- cgit v1.2.3