def mat_dims_equal(a, b, full_check=False):
    """
    Checks whether two matrices have equal dimensions

    Parameters
    ----------
    a: list[list]
        A matrix
    b: list[list]
        A matrix
    full_check: bool, optional
        If False (default) then the check on the second dimension (number
        of columns) is done on the first rows only, that is a[0]==b[0] and
        it's assumed that all the others have the same size. If True then
        all the rows are compared.

    Returns
    -------
    bool
        True if the two matrices have equal dimensions, False otherwise.

    """
    if not full_check:
        return len(a) == len(b) and len(a[0]) == len(b[0])
    else:
        return len(a) == len(b) and all(
               map(lambda r1, r2: len(r1) == len(r2), a, b))
        # if not len(a) == len(b):
        #     return False
        # cols_equal = True
        # for n in range(len(a)):
        #     cols_equal &= len(a[n]) == len(b[n])
        # return cols_equal