docs: def cmp_mat(a, b):
      """
      Sorts two matrices returning a positive or zero value
      """
      c = 0
      for x, y in zip(a.flat, b.flat):
          c = cmp(abs(x), abs(y))
          if c != 0:
              return c
      return c