Functions for generating and checking Monge arrays.
The functions here are mostly meant to be used for testing correctness of the SMAWK implementation.