diff options
Diffstat (limited to 'lib/Data/Packed/Vector.hs')
-rw-r--r-- | lib/Data/Packed/Vector.hs | 13 |
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 | ||
67 | vectorFMax :: Vector Float -> Float | ||
68 | vectorFMax = toScalarF Max | ||
69 | |||
70 | vectorFMin :: Vector Float -> Float | ||
71 | vectorFMin = toScalarF Min | ||
72 | |||
73 | vectorFMaxIndex :: Vector Float -> Int | ||
74 | vectorFMaxIndex = round . toScalarF MaxIdx | ||
75 | |||
76 | vectorFMinIndex :: Vector Float -> Int | ||
77 | vectorFMinIndex = round . toScalarF MinIdx | ||
78 | |||
66 | vectorMax :: Vector Double -> Double | 79 | vectorMax :: Vector Double -> Double |
67 | vectorMax = toScalarR Max | 80 | vectorMax = toScalarR Max |
68 | 81 | ||