Function streemap::ordered_pivot_by_size[][src]

pub fn ordered_pivot_by_size<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 size in 4 areas

  • f_item_size provide the size of an item
  • f_item_set_rect receive the item distributed Rect. Called once for each item and in a stable order.

Complexity: O(items.len()^2)