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.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index f6b3fc6..66aa71d 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -19,6 +19,7 @@ module Data.Packed.Vector (
19 subVector, takesV, join, 19 subVector, takesV, join,
20 constant, linspace, 20 constant, linspace,
21 vecdisp, 21 vecdisp,
22 vectorFMax, vectorFMin, vectorFMaxIndex, vectorFMinIndex,
22 vectorMax, vectorMin, vectorMaxIndex, vectorMinIndex, 23 vectorMax, vectorMin, vectorMaxIndex, vectorMinIndex,
23 mapVector, zipVector, 24 mapVector, zipVector,
24 fscanfVector, fprintfVector, freadVector, fwriteVector, 25 fscanfVector, fprintfVector, freadVector, fwriteVector,
@@ -63,6 +64,18 @@ linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1]
63 add = vectorMapValR AddConstant 64 add = vectorMapValR AddConstant
64 s = (b-a)/fromIntegral (n-1) 65 s = (b-a)/fromIntegral (n-1)
65 66
67vectorFMax :: Vector Float -> Float
68vectorFMax = toScalarF Max
69
70vectorFMin :: Vector Float -> Float
71vectorFMin = toScalarF Min
72
73vectorFMaxIndex :: Vector Float -> Int
74vectorFMaxIndex = round . toScalarF MaxIdx
75
76vectorFMinIndex :: Vector Float -> Int
77vectorFMinIndex = round . toScalarF MinIdx
78
66vectorMax :: Vector Double -> Double 79vectorMax :: Vector Double -> Double
67vectorMax = toScalarR Max 80vectorMax = toScalarR Max
68 81