toy-lib-0.1.0.0
Safe HaskellSafe-Inferred
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')

bindex :: (HasCallStack, Vector v a, Ord a) => v a -> a -> Int #

\(O(\log N)\) Binary search-based indexing.

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]]

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

\(O(N f)\)

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

\(O(N f)\)