@@ -21,10 +21,17 @@ coefficient_ring(R::MPolyRing) = base_ring(R)
2121 mpoly_type(::Type{S}) where S<:Ring
2222 mpoly_type(::S) where S<:Ring
2323
24- The type of multivariate polynomials with coefficients of type `T` respectively `elem_type(S)`.
25- Falls back to `Generic.MPoly{T}`.
24+ Return the type of a (multivariate) polynomial whose coefficients have type `T` or
25+ type `elem_type(S)`.
26+ The type of the corresponding polynomial ring can be found via [`mpoly_ring_type`](@ref).
2627
27- See also [`mpoly_ring_type`](@ref), [`poly_type`](@ref) and [`poly_ring_type`](@ref).
28+ For univariate polynomials see [`poly_type`](@ref).
29+
30+ # Implementation
31+
32+ This function is already defined for generic multivariate polynomials (namely `Generic.MPoly{T}`),
33+ so _needs to be defined only for_ special polynomial rings, _e.g._ those defined by
34+ a C implementation.
2835
2936# Examples
3037```jldoctest
@@ -41,6 +48,8 @@ julia> mpoly_type(typeof(AbstractAlgebra.ZZ))
4148AbstractAlgebra.Generic.MPoly{BigInt}
4249```
4350"""
51+ mpoly_type
52+
4453mpoly_type (:: Type{T} ) where T<: RingElement = Generic. MPoly{T}
4554mpoly_type (:: Type{S} ) where S<: Ring = mpoly_type (elem_type (S))
4655mpoly_type (x) = mpoly_type (typeof (x)) # to stop this method from eternally recursing on itself, we better add ...
@@ -53,10 +62,18 @@ mpoly_type(T::Type{Union{}}) = throw(MethodError(mpoly_type, (T,)))
5362 mpoly_ring_type(::Type{S}) where S<:Ring
5463 mpoly_ring_type(::S) where S<:Ring
5564
56- The type of multivariate polynomial rings with coefficients of type `T`
57- respectively `elem_type(S)`. Implemented via [`mpoly_type`](@ref).
65+ Return the type of the parent of a (multivariate) polynomial whose coefficients
66+ have type `T` or type `elem_type(S)`.
67+ The type of the polynomials themselves can be found via [`mpoly_type`](@ref).
68+
69+ For univariate polynomials see [`poly_ring_type`](@ref).
70+
71+ # Implementation
72+
73+ This function is already defined for generic multivariate polynomials (namely `Generic.MPoly{T}`),
74+ so _needs to be defined only for_ special polynomial rings, _e.g._ those defined by
75+ a C implementation.
5876
59- See also [`poly_type`](@ref) and [`poly_ring_type`](@ref).
6077
6178# Examples
6279```jldoctest
0 commit comments