uvector-algorithms-0.2: Efficient algorithms for uvector unboxed arraysSource codeContentsIndex
Data.Array.Vector.Algorithms.Insertion
PortabilityPortable
StabilityExperimental
MaintainerDan Doel
Description
A simple insertion sort. Though it's O(n^2), its iterative nature can be beneficial for small arrays. It is used to sort small segments of an array by some of the more heavy-duty, recursive algorithms.
Synopsis
sort :: (UA e, Ord e) => MUArr e s -> ST s ()
sortBy :: UA e => Comparison e -> MUArr e s -> ST s ()
sortByBounds :: UA e => Comparison e -> MUArr e s -> Int -> Int -> ST s ()
sortByBounds' :: UA e => Comparison e -> MUArr e s -> Int -> Int -> Int -> ST s ()
type Comparison e = e -> e -> Ordering
Documentation
sort :: (UA e, Ord e) => MUArr e s -> ST s ()Source
Sorts an entire array using the default comparison for the type
sortBy :: UA e => Comparison e -> MUArr e s -> ST s ()Source
Sorts an entire array using a given comparison
sortByBounds :: UA e => Comparison e -> MUArr e s -> Int -> Int -> ST s ()Source
Sorts the portion of an array delimited by [l,u)
sortByBounds' :: UA e => Comparison e -> MUArr e s -> Int -> Int -> Int -> ST s ()Source
Sorts the portion of the array delimited by [l,u) under the assumption that [l,m) is already sorted.
type Comparison e = e -> e -> OrderingSource
A type of comparisons between two values of a given type.
Produced by Haddock version 2.4.2