Skip to content

Commit

Permalink
Add hash(::Union{ZZIdl, ZZFracIdl})
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Nov 29, 2024
1 parent 65b40d3 commit f6cf0f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/NumField/QQ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ struct ZZFracIdl <: NumFieldOrderFractionalIdeal
end
end

Base.hash(x::ZZIdl, h::UInt) = hash(gen(x), h)

order(::ZZIdl) = ZZ

order(::ZZFracIdl) = ZZ
Expand Down Expand Up @@ -93,10 +91,18 @@ function ==(I::ZZIdl, J::ZZIdl)
return I.gen == J.gen
end

function Base.hash(I::ZZIdl, h::UInt)
return hash(I.gen, h)
end

function ==(I::ZZFracIdl, J::ZZFracIdl)
return I.gen == J.gen
end

function Base.hash(I::ZZFracIdl, h::UInt)
return hash(I.gen, h)
end

# access
gen(I::ZZIdl) = I.gen

Expand Down

0 comments on commit f6cf0f2

Please sign in to comment.