Function streemap::ordered_pivot_by_middle [−][src]
pub fn ordered_pivot_by_middle<N, T, S, R>(
rect: Rect<N>,
items: &mut [T],
f_item_size: S,
f_item_set_rect: R
) where
N: NumAssignOps + NumOps + PartialOrd + Zero + One + Copy + Sum,
S: Fn(&T) -> N,
R: FnMut(&mut T, Rect<N>),
Distribute items
inside rect
by splitting it recursively around pivot by middle in 4 areas
f_item_size
provide the size of an itemf_item_set_rect
receive the item distributed Rect. Called once for each item and in a stable order.
Complexity: O(2⨯items.len()⨯log_4(items.len()))