summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Vector.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-09-14 11:06:57 +0000
committerAlberto Ruiz <aruiz@um.es>2007-09-14 11:06:57 +0000
commit9e2f7fb0ca902665b430a96f77959522976a97f9 (patch)
treec2f258fe28df79a645f3908655b46fbaf89ecf16 /lib/Data/Packed/Vector.hs
parent620d5008ea9a931a91907cd0c902bb64f005121f (diff)
code refactoring
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r--lib/Data/Packed/Vector.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index 9818d58..3fc625c 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -18,12 +18,13 @@ module Data.Packed.Vector (
18 dim, (@>), 18 dim, (@>),
19 subVector, join, 19 subVector, join,
20 constant, linspace, 20 constant, linspace,
21 21 vectorMax, vectorMin, vectorMaxIndex, vectorMinIndex,
22 liftVector, liftVector2 22 liftVector, liftVector2
23) where 23) where
24 24
25import Data.Packed.Internal 25import Data.Packed.Internal
26import Complex 26import Complex
27import GSL.Vector
27 28
28{- | Creates a real vector containing a range of values: 29{- | Creates a real vector containing a range of values:
29 30
@@ -33,3 +34,15 @@ import Complex
33linspace :: Int -> (Double, Double) -> Vector Double 34linspace :: Int -> (Double, Double) -> Vector Double
34linspace n (a,b) = fromList [a, a+delta .. b] 35linspace n (a,b) = fromList [a, a+delta .. b]
35 where delta = (b-a)/(fromIntegral n -1) 36 where delta = (b-a)/(fromIntegral n -1)
37
38vectorMax :: Vector Double -> Double
39vectorMax = toScalarR Max
40
41vectorMin :: Vector Double -> Double
42vectorMin = toScalarR Min
43
44vectorMaxIndex :: Vector Double -> Int
45vectorMaxIndex = round . toScalarR MaxIdx
46
47vectorMinIndex :: Vector Double -> Int
48vectorMinIndex = round . toScalarR MinIdx