Function smawk::is_monge [−][src]
pub fn is_monge<T: Copy + PartialOrd + NumOps>(matrix: &Array2<T>) -> bool
Verify that a matrix is a Monge matrix.
A Monge matrix (or array) is a matrix where the following inequality holds:
M[i, j] + M[i', j'] <= M[i, j'] + M[i', j] for all i < i', j < j'
The inequality says that the sum of the main diagonal is less than the sum of the antidiagonal. Checking this condition is done by checking n ✕ m submatrices, so the running time is O(mn).