Skip to content

Commit 6ff7b95

Browse files
committed
hash for Equation
1 parent da7b31d commit 6ff7b95

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/equations.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct Equation
1313
rhs::Expression
1414
end
1515
Base.:(==)(a::Equation, b::Equation) = isequal((a.lhs, a.rhs), (b.lhs, b.rhs))
16+
Base.hash(a::Equation, salt::UInt) = hash(a.lhs, hash(a.rhs, salt))
1617

1718
"""
1819
$(TYPEDSIGNATURES)

test/operation_overloads.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ aa = a; # old a
1515

1616
@test isequal(get_variables(a+aa+1), [a])
1717

18+
@test hash(a+b ~ c+d) == hash(a+b ~ c+d)
19+
1820
# test some matrix operations don't throw errors
1921
X = [a b;c d]
2022
det(X)

0 commit comments

Comments
 (0)