Skip to content

Commit

Permalink
Add dummy hash functions for arb types (#1954)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Dec 5, 2024
1 parent 578b513 commit 2d12643
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/arb/Complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ function isequal(x::ComplexFieldElem, y::ComplexFieldElem)
return Bool(r)
end

function Base.hash(x::ComplexFieldElem, h::UInt)
# TODO: improve me
return h
end

function ==(x::ComplexFieldElem, y::ComplexFieldElem)
r = @ccall libflint.acb_eq(x::Ref{ComplexFieldElem}, y::Ref{ComplexFieldElem})::Cint
return Bool(r)
Expand Down
5 changes: 5 additions & 0 deletions src/arb/Real.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ function isequal(x::RealFieldElem, y::RealFieldElem)
return Bool(r)
end

function Base.hash(x::RealFieldElem, h::UInt)
# TODO: improve me
return h
end

function ==(x::RealFieldElem, y::RealFieldElem)
return Bool(@ccall libflint.arb_eq(x::Ref{RealFieldElem}, y::Ref{RealFieldElem})::Cint)
end
Expand Down
5 changes: 5 additions & 0 deletions src/arb/acb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ function isequal(x::AcbFieldElem, y::AcbFieldElem)
return Bool(r)
end

function Base.hash(x::AcbFieldElem, h::UInt)
# TODO: improve me
return h
end

function ==(x::AcbFieldElem, y::AcbFieldElem)
r = @ccall libflint.acb_eq(x::Ref{AcbFieldElem}, y::Ref{AcbFieldElem})::Cint
return Bool(r)
Expand Down
5 changes: 5 additions & 0 deletions src/arb/arb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ function isequal(x::ArbFieldElem, y::ArbFieldElem)
return Bool(r)
end

function Base.hash(x::ArbFieldElem, h::UInt)
# TODO: improve me
return h
end

function ==(x::ArbFieldElem, y::ArbFieldElem)
return Bool(@ccall libflint.arb_eq(x::Ref{ArbFieldElem}, y::Ref{ArbFieldElem})::Cint)
end
Expand Down

0 comments on commit 2d12643

Please sign in to comment.