Skip to content

Commit 8dc33d7

Browse files
Rename dense_poly_type to poly_type (#2202)
Co-authored-by: Lars Göttgens <lars.goettgens@gmail.com>
1 parent 7abc40d commit 8dc33d7

File tree

10 files changed

+51
-47
lines changed

10 files changed

+51
-47
lines changed

docs/src/poly_interface.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ polynomial ring. This is provided for uniformity with the multivariate interface
136136
there is more than one variable and hence an array of symbols.
137137

138138
```julia
139-
dense_poly_type(::Type{T}) where T <: RingElement
139+
poly_type(::Type{T}) where T <: RingElement
140140
```
141141

142142
Return the type of a polynomial whose coefficients have the given type. In our
@@ -150,7 +150,7 @@ polynomial_ring_only(R::Ring, s::Symbol; cached::Bool=true)
150150
```
151151

152152
The default implementation figures out the appropriate polynomial ring type via
153-
`dense_poly_type` and calls its constructor with `R, s, cached` as arguments.
153+
`poly_type` and calls its constructor with `R, s, cached` as arguments.
154154
In our example, this would be
155155

156156
```julia

src/Deprecations.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# renamed in 0.45.1
1313
@alias FactoredFractionField factored_fraction_field
1414

15+
#renamed in 0.47.4
16+
@alias dense_poly_type poly_type
17+
@alias dense_poly_ring_type poly_ring_type
18+
1519
###############################################################################
1620
#
1721
# Deprecated bindings

src/MPoly.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ coefficient_ring(R::MPolyRing) = base_ring(R)
2424
The type of multivariate polynomials with coefficients of type `T` respectively `elem_type(S)`.
2525
Falls back to `Generic.MPoly{T}`.
2626
27-
See also [`mpoly_ring_type`](@ref), [`dense_poly_type`](@ref) and [`dense_poly_ring_type`](@ref).
27+
See also [`mpoly_ring_type`](@ref), [`poly_type`](@ref) and [`poly_ring_type`](@ref).
2828
2929
# Examples
3030
```jldoctest
@@ -55,7 +55,7 @@ mpoly_type(::Type{T}) where T = throw(ArgumentError("Type `$T` must be subtype o
5555
The type of multivariate polynomial rings with coefficients of type `T`
5656
respectively `elem_type(S)`. Implemented via [`mpoly_type`](@ref).
5757
58-
See also [`dense_poly_type`](@ref) and [`dense_poly_ring_type`](@ref).
58+
See also [`poly_type`](@ref) and [`poly_ring_type`](@ref).
5959
6060
# Examples
6161
```jldoctest

src/NCPoly.jl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,63 +20,63 @@ function is_exact_type(a::Type{T}) where {S <: NCRingElem, T <: NCPolyRingElem{S
2020
end
2121

2222
@doc raw"""
23-
dense_poly_type(::Type{T}) where T<:NCRingElement
24-
dense_poly_type(::T) where T<:NCRingElement
25-
dense_poly_type(::Type{S}) where S<:NCRing
26-
dense_poly_type(::S) where S<:NCRing
23+
poly_type(::Type{T}) where T<:NCRingElement
24+
poly_type(::T) where T<:NCRingElement
25+
poly_type(::Type{S}) where S<:NCRing
26+
poly_type(::S) where S<:NCRing
2727
2828
The type of univariate polynomials with coefficients of type `T` respectively `elem_type(S)`.
2929
Falls back to `Generic.NCPoly{T}` respectively `Generic.Poly{T}`.
3030
31-
See also [`dense_poly_ring_type`](@ref), [`mpoly_type`](@ref) and [`mpoly_ring_type`](@ref).
31+
See also [`poly_ring_type`](@ref), [`mpoly_type`](@ref) and [`mpoly_ring_type`](@ref).
3232
3333
# Examples
3434
```jldoctest
35-
julia> dense_poly_type(AbstractAlgebra.ZZ(1))
35+
julia> poly_type(AbstractAlgebra.ZZ(1))
3636
AbstractAlgebra.Generic.Poly{BigInt}
3737
38-
julia> dense_poly_type(elem_type(AbstractAlgebra.ZZ))
38+
julia> poly_type(elem_type(AbstractAlgebra.ZZ))
3939
AbstractAlgebra.Generic.Poly{BigInt}
4040
41-
julia> dense_poly_type(AbstractAlgebra.ZZ)
41+
julia> poly_type(AbstractAlgebra.ZZ)
4242
AbstractAlgebra.Generic.Poly{BigInt}
4343
44-
julia> dense_poly_type(typeof(AbstractAlgebra.ZZ))
44+
julia> poly_type(typeof(AbstractAlgebra.ZZ))
4545
AbstractAlgebra.Generic.Poly{BigInt}
4646
```
4747
"""
48-
dense_poly_type(::Type{T}) where T<:NCRingElement = Generic.NCPoly{T}
49-
dense_poly_type(::Type{S}) where S<:NCRing = dense_poly_type(elem_type(S))
50-
dense_poly_type(x) = dense_poly_type(typeof(x)) # to stop this method from eternally recursing on itself, we better add ...
51-
dense_poly_type(::Type{T}) where T = throw(ArgumentError("Type `$T` must be subtype of `NCRingElement`."))
48+
poly_type(::Type{T}) where T<:NCRingElement = Generic.NCPoly{T}
49+
poly_type(::Type{S}) where S<:NCRing = poly_type(elem_type(S))
50+
poly_type(x) = poly_type(typeof(x)) # to stop this method from eternally recursing on itself, we better add ...
51+
poly_type(::Type{T}) where T = throw(ArgumentError("Type `$T` must be subtype of `NCRingElement`."))
5252

5353
@doc raw"""
54-
dense_poly_ring_type(::Type{T}) where T<:NCRingElement
55-
dense_poly_ring_type(::T) where T<:NCRingElement
56-
dense_poly_ring_type(::Type{S}) where S<:NCRing
57-
dense_poly_ring_type(::S) where S<:NCRing
54+
poly_ring_type(::Type{T}) where T<:NCRingElement
55+
poly_ring_type(::T) where T<:NCRingElement
56+
poly_ring_type(::Type{S}) where S<:NCRing
57+
poly_ring_type(::S) where S<:NCRing
5858
5959
The type of univariate polynomial rings with coefficients of type `T` respectively
60-
`elem_type(S)`. Implemented via [`dense_poly_type`](@ref).
60+
`elem_type(S)`. Implemented via [`poly_type`](@ref).
6161
6262
See also [`mpoly_type`](@ref) and [`mpoly_ring_type`](@ref).
6363
6464
# Examples
6565
```jldoctest
66-
julia> dense_poly_ring_type(AbstractAlgebra.ZZ(1))
66+
julia> poly_ring_type(AbstractAlgebra.ZZ(1))
6767
AbstractAlgebra.Generic.PolyRing{BigInt}
6868
69-
julia> dense_poly_ring_type(elem_type(AbstractAlgebra.ZZ))
69+
julia> poly_ring_type(elem_type(AbstractAlgebra.ZZ))
7070
AbstractAlgebra.Generic.PolyRing{BigInt}
7171
72-
julia> dense_poly_ring_type(AbstractAlgebra.ZZ)
72+
julia> poly_ring_type(AbstractAlgebra.ZZ)
7373
AbstractAlgebra.Generic.PolyRing{BigInt}
7474
75-
julia> dense_poly_ring_type(typeof(AbstractAlgebra.ZZ))
75+
julia> poly_ring_type(typeof(AbstractAlgebra.ZZ))
7676
AbstractAlgebra.Generic.PolyRing{BigInt}
7777
```
7878
"""
79-
dense_poly_ring_type(x) = parent_type(dense_poly_type(x))
79+
poly_ring_type(x) = parent_type(poly_type(x))
8080

8181
@doc raw"""
8282
var(a::NCPolyRing)
@@ -779,7 +779,7 @@ Like [`polynomial_ring(R::NCRing, s::Symbol)`](@ref) but return only the
779779
polynomial ring.
780780
"""
781781
polynomial_ring_only(R::T, s::Symbol; cached::Bool=true) where T<:NCRing =
782-
dense_poly_ring_type(T)(R, s, cached)
782+
poly_ring_type(T)(R, s, cached)
783783

784784
# Simplified constructor
785785

src/Poly.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ base_ring_type(::Type{<:PolyRing{T}}) where T<:RingElement = parent_type(T)
1515
coefficient_ring_type(T::Type{<:PolyRing}) = base_ring_type(T)
1616
coefficient_ring(R::PolyRing) = base_ring(R)
1717

18-
dense_poly_type(::Type{T}) where T<:RingElement = Generic.Poly{T}
18+
poly_type(::Type{T}) where T<:RingElement = Generic.Poly{T}
1919

2020
function is_domain_type(::Type{T}) where {S <: RingElement, T <: PolyRingElem{S}}
2121
return is_domain_type(S)

src/exports.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ export degree
180180
export degrees
181181
export denest
182182
export dense_matrix_type
183-
export dense_poly_ring_type
184-
export dense_poly_type
185183
export derivative
186184
export det
187185
export det_popov
@@ -471,6 +469,8 @@ export pol_length
471469
export polcoeff
472470
export poly
473471
export poly_ring
472+
export poly_ring_type
473+
export poly_type
474474
export polynomial
475475
export polynomial_ring
476476
export polynomial_to_power_sums

src/generic/FunctionField.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ parent_type(::Type{FunctionFieldElem{T}}) where T <: FieldElement = FunctionFiel
526526
elem_type(::Type{FunctionField{T}}) where T <: FieldElement = FunctionFieldElem{T}
527527

528528
function base_ring_type(::Type{FunctionField{T}}) where T <: FieldElement
529-
U = dense_poly_type(T)
529+
U = poly_type(T)
530530
return RationalFunctionField{T, U}
531531
end
532532

@@ -581,19 +581,19 @@ defining_polynomial(R::FunctionField) = R.pol
581581
modulus(R::FunctionField) = defining_polynomial(R)
582582

583583
function power_precomp(R::FunctionField{T}, n::Int) where T <: FieldElement
584-
return R.powers[n + 1]::Poly{dense_poly_type(T)}
584+
return R.powers[n + 1]::Poly{poly_type(T)}
585585
end
586586

587587
function power_precomp_den(R::FunctionField{T}, n::Int) where T <: FieldElement
588-
return R.powers_den[n + 1]::dense_poly_type(T)
588+
return R.powers_den[n + 1]::poly_type(T)
589589
end
590590

591591
function trace_precomp(R::FunctionField{T}, n::Int) where T <: FieldElement
592-
return R.traces[n + 1]::dense_poly_type(T)
592+
return R.traces[n + 1]::poly_type(T)
593593
end
594594

595595
function trace_precomp_den(R::FunctionField{T}) where T <: FieldElement
596-
return R.traces_den::dense_poly_type(T)
596+
return R.traces_den::poly_type(T)
597597
end
598598

599599
@doc raw"""
@@ -610,13 +610,13 @@ interface.
610610
function Base.numerator(R::FunctionField{T},
611611
canonicalise::Bool=true) where T <: FieldElement
612612
# only used for type assert, so no need to canonicalise
613-
return R.num::Poly{dense_poly_type(T)}
613+
return R.num::Poly{poly_type(T)}
614614
end
615615

616616
function Base.denominator(R::FunctionField{T},
617617
canonicalise::Bool=true) where T <: FieldElement
618618
# only used for type assert, so no need to canonicalise
619-
return R.den::dense_poly_type(T)
619+
return R.den::poly_type(T)
620620
end
621621

622622
@doc raw"""
@@ -630,8 +630,8 @@ If `canonicalise` is set to `true` the fraction is first canonicalised.
630630
"""
631631
function Base.numerator(a::FunctionFieldElem{T},
632632
canonicalise::Bool=true) where T <: FieldElement
633-
anum = a.num::Poly{dense_poly_type(T)}
634-
aden = a.den::dense_poly_type(T)
633+
anum = a.num::Poly{poly_type(T)}
634+
aden = a.den::poly_type(T)
635635
if canonicalise
636636
u = canonical_unit(aden)
637637
return divexact(anum, u)
@@ -642,7 +642,7 @@ end
642642

643643
function Base.denominator(a::FunctionFieldElem{T},
644644
canonicalise::Bool=true) where T <: FieldElement
645-
aden = a.den::dense_poly_type(T)
645+
aden = a.den::poly_type(T)
646646
if canonicalise
647647
u = canonical_unit(aden)
648648
return divexact(aden, u)
@@ -1248,7 +1248,7 @@ promote_rule(::Type{FunctionFieldElem{T}}, ::Type{FunctionFieldElem{T}}) where T
12481248
function promote_rule(::Type{FunctionFieldElem{T}}, ::Type{V}) where
12491249
{T <: FieldElement, V <: RingElem}
12501250
# The base ring element type of FunctionFieldElem{T} is RationalFunctionFieldElem{T, U}, not T
1251-
U = dense_poly_type(T)
1251+
U = poly_type(T)
12521252
promote_rule(RationalFunctionFieldElem{T, U}, V) == RationalFunctionFieldElem{T, U} ? FunctionFieldElem{T} : Union{}
12531253
end
12541254

src/generic/PolyRingHom.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ end
7171

7272
function temp_ring(f::PolyRingAnyMap{<:Any, <: Any, <: Map})
7373
if isdefined(f, :temp_ring)
74-
return f.temp_ring::dense_poly_ring_type(codomain(_coefficient_map(f)))
74+
return f.temp_ring::poly_ring_type(codomain(_coefficient_map(f)))
7575
end
7676

7777
S, = polynomial_ring(codomain(_coefficient_map(f)), cached = false)

test/generic/NCPoly-test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ end
431431

432432
@testset "Generic.NCPoly.exceptions" begin
433433
@test_throws MethodError polynomial_ring(Char, :x)
434-
@test_throws Exception dense_poly_ring_type(Char)
435-
@test_throws ArgumentError dense_poly_type(Char)
434+
@test_throws Exception poly_ring_type(Char)
435+
@test_throws ArgumentError poly_type(Char)
436436
end
437437

438438
@testset "Generic.NCPoly.map_coefficients" begin

test/generic/Poly-test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# algos differ, and 7 can often stand in for 5/6 if the algorithm supports it.
1818

1919
@testset "Generic.Poly.types" begin
20-
@test dense_poly_type(BigInt) == Generic.Poly{BigInt}
21-
@test dense_poly_type(Rational{BigInt}) == Generic.Poly{Rational{BigInt}}
20+
@test poly_type(BigInt) == Generic.Poly{BigInt}
21+
@test poly_type(Rational{BigInt}) == Generic.Poly{Rational{BigInt}}
2222
end
2323

2424
@testset "Generic.Poly.constructors" begin

0 commit comments

Comments
 (0)