check whether the matrix format is valid
True - rigorous check, O(N) operations : default False - basic check, O(1) operations