From 2d12643783fab096f3860608f4cc3df774c417e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 5 Dec 2024 17:46:41 +0100 Subject: [PATCH] Add dummy hash functions for arb types (#1954) --- src/arb/Complex.jl | 5 +++++ src/arb/Real.jl | 5 +++++ src/arb/acb.jl | 5 +++++ src/arb/arb.jl | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/src/arb/Complex.jl b/src/arb/Complex.jl index cf3bd5d714..0e36d14904 100644 --- a/src/arb/Complex.jl +++ b/src/arb/Complex.jl @@ -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) diff --git a/src/arb/Real.jl b/src/arb/Real.jl index d41a7550ec..78cb34d630 100644 --- a/src/arb/Real.jl +++ b/src/arb/Real.jl @@ -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 diff --git a/src/arb/acb.jl b/src/arb/acb.jl index ed2f5a7639..bf7031d7a3 100644 --- a/src/arb/acb.jl +++ b/src/arb/acb.jl @@ -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) diff --git a/src/arb/arb.jl b/src/arb/arb.jl index 0a5123d461..c19af9a050 100644 --- a/src/arb/arb.jl +++ b/src/arb/arb.jl @@ -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