| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Algorithm.SlideMin
Description
Sliding minimum window.
Synopsis
- slideCmpIndicesOn :: (Vector v a, Ord b) => (a -> b) -> Int -> v a -> Vector Int
- slideMinIndices :: Int -> Vector Int -> Vector Int
- slideMaxIndices :: Int -> Vector Int -> Vector Int
- lookBackIndicesOn :: (Vector v a, Ord b) => (a -> b) -> v a -> Vector Int
- lookBackLowerIndices :: Vector Int -> Vector Int
- lookBackHigherIndices :: Vector Int -> Vector Int
Documentation
slideCmpIndicesOn :: (Vector v a, Ord b) => (a -> b) -> Int -> v a -> Vector Int #
\(O(N)\) (1) in https://qiita.com/kuuso1/items/318d42cd089a49eeb332
slideMinIndices :: Int -> Vector Int -> Vector Int #
\(O(N)\) Returns indices of minimum values in the windows with the specified length.
>>>slideMinIndices 3 (U.fromList [0 .. 5])[0,1,2,3]>>>slideMinIndices 3 (U.fromList [5, 4 .. 0])[2,3,4,5]
slideMaxIndices :: Int -> Vector Int -> Vector Int #
\(O(N)\) Returns indices of maximum values in the windows with the specified length.
Example
indices: 0 1 2 3 4 5
values: 0 1 2 3 4 5 max value indices:
[---] 2
[---] 3
[---] 4
[---] 5
>>>slideMaxIndices 3 (U.fromList [0 .. 5])[2,3,4,5]>>>slideMaxIndices 3 (U.fromList [5, 4 .. 0])[0,1,2,3]
lookBackIndicesOn :: (Vector v a, Ord b) => (a -> b) -> v a -> Vector Int #
\(O(N)\) (2) https://qiita.com/kuuso1/items/318d42cd089a49eeb332
lookBackLowerIndices :: Vector Int -> Vector Int #
\(O(N)\) Solution to the histogram problem. Find the nearest lower building for each i..