This helper function validates that an input matrix, L, is of the
the appropriate form to be interpreted by the other functions. In particular
it should be square matrix of 1's and 0's with all 0's along its
diagonal. If any of the above conditions is not met, this function will
throw an error.