priority-matrix
The Rust crate implements the matrix data structure that supports per-row, per-column and whole-matrix maximum key queries.
Example
The code below is an example to query the key with the maximum weight either in the matrix, in a row or in a column. The complete example can be found in peek.rs.
let matrix: =
.into_iter
.collect;
// Get the maximum entry
let entry = matrix.peek.unwrap;
assert_eq!;
// Get the maximum entry in a row
let entry = matrix.peek_from_row.unwrap;
assert_eq!;
// Get the maximum entry in a column
let entry = matrix.peek_from_column.unwrap;
assert_eq!;
License
This project is distributed under MIT license. Please read the license file.