Skip to content

Commit

Permalink
FinField: use concrete types for sub-/overfield morphisms to improve …
Browse files Browse the repository at this point in the history
…inferrability (#1961)
  • Loading branch information
benlorenz authored Dec 5, 2024
1 parent 3490994 commit e4e5751
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/embedding/embedding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
#
################################################################################

function overfields(k::FinField)
function overfields(k::T) where T <: FinField
if !isdefined(k, :overfields)
k.overfields = Dict{Int, Vector{FinFieldMorphism}}()
k.overfields = Dict{Int, Vector{FinFieldMorphism{T,T}}}()
end
return k.overfields
return k.overfields::Dict{Int, Vector{FinFieldMorphism{T,T}}}
end

function subfields(k::FinField)
function subfields(k::T) where T <: FinField
if !isdefined(k, :subfields)
k.subfields = Dict{Int, Vector{FinFieldMorphism}}()
k.subfields = Dict{Int, Vector{FinFieldMorphism{T,T}}}()
end
return k.subfields
return k.subfields::Dict{Int, Vector{FinFieldMorphism{T,T}}}
end


Expand Down
12 changes: 6 additions & 6 deletions src/flint/FlintTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1845,8 +1845,8 @@ See [`FqPolyRepField`](@ref) for $p$ being a [`ZZRingElem`](@ref). See [`fqPolyR
var :: Ptr{Nothing}
# end of flint struct

overfields :: Dict{Int, Vector{FinFieldMorphism}}
subfields :: Dict{Int, Vector{FinFieldMorphism}}
overfields :: Dict{Int, Vector{FinFieldMorphism{fqPolyRepField, fqPolyRepField}}}
subfields :: Dict{Int, Vector{FinFieldMorphism{fqPolyRepField, fqPolyRepField}}}

function fqPolyRepField(c::UInt, deg::Int, s::Symbol, cached::Bool = true; check::Bool = true)
check && !is_prime(c) &&
Expand Down Expand Up @@ -1973,8 +1973,8 @@ A finite field. The constructor automatically determines a fast implementation.

var::String

overfields::Dict{Int, Vector{FinFieldMorphism}}
subfields::Dict{Int, Vector{FinFieldMorphism}}
overfields::Dict{Int, Vector{FinFieldMorphism{FqField, FqField}}}
subfields::Dict{Int, Vector{FinFieldMorphism{FqField, FqField}}}

isstandard::Bool
# isstandard means, that defining_polynomial(F) === modulus(F)
Expand Down Expand Up @@ -2148,8 +2148,8 @@ See [`fqPolyRepField`](@ref) for $p$ being an [`Int`](@ref). See [`FqPolyRepFiel
var::Ptr{Nothing}
# end of flint struct

overfields :: Dict{Int, Vector{FinFieldMorphism}}
subfields :: Dict{Int, Vector{FinFieldMorphism}}
overfields :: Dict{Int, Vector{FinFieldMorphism{FqPolyRepField, FqPolyRepField}}}
subfields :: Dict{Int, Vector{FinFieldMorphism{FqPolyRepField, FqPolyRepField}}}

function FqPolyRepField(char::ZZRingElem, deg::Int, s::Symbol, cached::Bool = true; check::Bool = true)
check && !is_probable_prime(char) &&
Expand Down

0 comments on commit e4e5751

Please sign in to comment.