Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require non-zero coefficient ring in power series ring #1860

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/RelSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,10 @@ object `S` will be cached so that supplying the same base ring, string and
precision in future will return the same parent object and generator. If
caching of the parent object is not required, `cached` can be set to `false`.
"""
power_series_ring(R::Ring, prec::Int, s::VarName; cached::Bool=true, model::Symbol=:capped_relative) =
Generic.power_series_ring(R, prec, Symbol(s); cached, model)
function power_series_ring(R::Ring, prec::Int, s::VarName; cached::Bool=true, model::Symbol=:capped_relative)
@req !is_trivial(R) "Zero rings are currently not supported as coefficient ring."
return Generic.power_series_ring(R, prec, Symbol(s); cached, model)
end

function AbsPowerSeriesRing(R::Ring, prec::Int)
T = elem_type(R)
Expand Down
4 changes: 4 additions & 0 deletions src/generic/AbsMSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ end

function power_series_ring(R::AbstractAlgebra.Ring, prec::Vector{Int},
s::Vector{Symbol}; cached::Bool=true, model=:capped_absolute)

@req !is_trivial(R) "Zero rings are currently not supported as coefficient ring."
U = elem_type(R)

S, _ = AbstractAlgebra.polynomial_ring(R, s)
Expand All @@ -724,6 +726,8 @@ end
function power_series_ring(R::AbstractAlgebra.Ring, prec::Int,
s::Vector{Symbol}; weights::Union{Vector{Int}, Nothing}=nothing,
cached::Bool=true, model=:capped_absolute)

@req !is_trivial(R) "Zero rings are currently not supported as coefficient ring."
U = elem_type(R)

S, _ = AbstractAlgebra.polynomial_ring(R, s)
Expand Down
1 change: 1 addition & 0 deletions src/generic/RelSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ end
###############################################################################

function power_series_ring(R::AbstractAlgebra.Ring, prec::Int, s::VarName; cached::Bool=true, model::Symbol=:capped_relative)
@req !is_trivial(R) "Zero rings are currently not supported as coefficient ring."
T = elem_type(R)

if model == :capped_relative
Expand Down
Loading