Trait toodee::SortOps

source ·
pub trait SortOps<T>: TooDeeOpsMut<T> {
    // Provided methods
    fn sort_row_ord<F>(&mut self, row: usize)
       where T: Ord { ... }
    fn sort_unstable_row_ord<F>(&mut self, row: usize)
       where T: Ord { ... }
    fn sort_by_row<F>(&mut self, row: usize, compare: F)
       where F: FnMut(&T, &T) -> Ordering { ... }
    fn sort_unstable_by_row<F>(&mut self, row: usize, compare: F)
       where F: FnMut(&T, &T) -> Ordering { ... }
    fn sort_by_row_key<B, F>(&mut self, row: usize, f: F)
       where B: Ord,
             F: FnMut(&T) -> B { ... }
    fn sort_unstable_by_row_key<B, F>(&mut self, row: usize, f: F)
       where B: Ord,
             F: FnMut(&T) -> B { ... }
    fn sort_col_ord<F>(&mut self, col: usize)
       where T: Ord { ... }
    fn sort_by_col<F>(&mut self, col: usize, compare: F)
       where F: FnMut(&T, &T) -> Ordering { ... }
    fn sort_unstable_by_col<F>(&mut self, col: usize, compare: F)
       where F: FnMut(&T, &T) -> Ordering { ... }
    fn sort_by_col_key<B, F>(&mut self, col: usize, f: F)
       where B: Ord,
             F: FnMut(&T) -> B { ... }
    fn sort_unstable_by_col_key<B, F>(&mut self, col: usize, f: F)
       where B: Ord,
             F: FnMut(&T) -> B { ... }
}
Expand description

Provides sorting capabilities to two-dimensional arrays. Sorting of the rows and columns is performed in-place, and care is taken to minimise row/col swaps. This is achieved by sorting the row/col and original index pair, then repositioning the rows/columns once the new ordering has been determined.

Provided Methods§

source

fn sort_row_ord<F>(&mut self, row: usize)where T: Ord,

Sort the entire two-dimensional array by comparing elements on a specific row, using the natural ordering. This sort is stable.

source

fn sort_unstable_row_ord<F>(&mut self, row: usize)where T: Ord,

Sort the entire two-dimensional array by comparing elements on a specific row, using the natural ordering. This sort is unstable.

source

fn sort_by_row<F>(&mut self, row: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on a specific row using the provided compare function. This sort is stable.

source

fn sort_unstable_by_row<F>(&mut self, row: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on a specific row using the provided compare function. This sort is unstable.

source

fn sort_by_row_key<B, F>(&mut self, row: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific row using a key extraction function. This sort is stable.

source

fn sort_unstable_by_row_key<B, F>(&mut self, row: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific row using a key extraction function. This sort is unstable.

source

fn sort_col_ord<F>(&mut self, col: usize)where T: Ord,

Sort the entire two-dimensional array by comparing elements on a specific column using the natural ordering. This sort is stable.

source

fn sort_by_col<F>(&mut self, col: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on in a specific column. This sort is stable.

source

fn sort_unstable_by_col<F>(&mut self, col: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on in a specific column. This sort is unstable.

source

fn sort_by_col_key<B, F>(&mut self, col: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific column using a key extraction function. This sort is stable.

source

fn sort_unstable_by_col_key<B, F>(&mut self, col: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific column using a key extraction function. This sort is unstable.

Implementors§

source§

impl<T, O> SortOps<T> for Owhere O: TooDeeOpsMut<T>,