toy-lib
Safe HaskellNone
LanguageHaskell2010

Data.Vector.Extra

Synopsis

Documentation

compressU :: HasCallStack => Vector Int -> (Vector Int, Vector Int) #

\(O(N \log N)\) One dimensional index compression: xs -> (nubSortXs, xs')

chunksOfG :: Vector v a => Int -> v a -> Vector (v a) #

\(O(N)\) = Test >>> chunksOfG 3 $ U.fromList ([1, 2, 3, 4, 5, 6, 7] :: [Int]) [[1,2,3],[4,5,6],[7]]

windowsOfG :: Vector v a => Int -> v a -> Vector (v a) #

\(O(N)\) = Test >>> windowsOfG 3 $ U.fromList ([1, 2, 3, 4, 5, 6, 7] :: [Int]) [[1,2,3],[2,3,4],[3,4,5],[4,5,6],[5,6,7]]

constructMN :: forall a m. (PrimMonad m, Unbox a) => Int -> (Vector a -> m a) -> m (Vector a) #

\(O(N f)\) U.constructN with monadic actions.

constructrMN :: forall a m. (PrimMonad m, Unbox a) => Int -> (Vector a -> m a) -> m (Vector a) #

\(O(N f)\) U.constructrN with monadic actions.