예제 #1
0
파일: symbolic.py 프로젝트: KrisJe/loopy
def is_expression_equal(a, b):
    if a == b:
        return True

    if isinstance(a, p.Expression) or isinstance(b, p.Expression):
        if a is None or b is None:
            return False

        maybe_zero = a - b
        from pymbolic import distribute

        d_result = distribute(maybe_zero)
        return d_result == 0

    else:
        return False
예제 #2
0
파일: symbolic.py 프로젝트: cmsquared/loopy
def is_expression_equal(a, b):
    if a == b:
        return True

    from pymbolic.primitives import Expression
    if isinstance(a, Expression) or isinstance(b, Expression):
        if a is None or b is None:
            return False

        maybe_zero = a - b
        from pymbolic import distribute

        d_result = distribute(maybe_zero)
        return d_result == 0

    else:
        return False