Skip to content

Commit

Permalink
Add missing ring interface function for AlgClosure (#3113)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Dec 15, 2023
1 parent 4bbbef4 commit 694f594
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Rings/AlgClosureFp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ end
elem_type(::Type{AlgClosure{T}}) where T = AlgClosureElem{T}
parent_type(::Type{AlgClosureElem{T}}) where T = AlgClosure{T}

Oscar.canonical_unit(a::AlgClosureElem) = is_zero(a) ? one(a) : a

function show(io::IO, a::AlgClosureElem)
print(io, data(a))
end
Expand Down Expand Up @@ -325,6 +327,7 @@ function has_preimage(mp::MapFromFunc{T, AlgClosure{S}}, elm::AlgClosureElem{S})
return true, preimage(mp, elm)
end


end # AlgClosureFp

import .AlgClosureFp:
Expand Down
4 changes: 4 additions & 0 deletions test/Rings/AlgClosureFp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,8 @@ end
a = K(gen(F1))
@test K(L(a)) == a
end

R = algebraic_closure(GF(3,1))
Kt, t = rational_function_field(R, "t")
@test sprint(show, t) isa String
end

0 comments on commit 694f594

Please sign in to comment.