diff --git a/docs/src/free_associative_algebra.md b/docs/src/free_associative_algebra.md index 840a850d9..a4d5f3d7e 100644 --- a/docs/src/free_associative_algebra.md +++ b/docs/src/free_associative_algebra.md @@ -100,7 +100,7 @@ multivariate polynomial interface are provided. ```julia symbols(S::FreeAssAlgebra) -nvars(f::FreeAssAlgebra) +number_of_variables(f::FreeAssAlgebra) gens(S::FreeAssAlgebra) gen(S::FreeAssAlgebra, i::Int) is_gen(x::FreeAssAlgElem) diff --git a/docs/src/laurent_mpolynomial.md b/docs/src/laurent_mpolynomial.md index b0bf51dc9..0ca5bc959 100644 --- a/docs/src/laurent_mpolynomial.md +++ b/docs/src/laurent_mpolynomial.md @@ -61,7 +61,7 @@ finish(M::LaurentMPolyBuildCtx) ```julia symbols(S::LaurentMPolyRing) -nvars(f::LaurentMPolyRing) +number_of_variables(f::LaurentMPolyRing) gens(S::LaurentMPolyRing) gen(S::LaurentMPolyRing, i::Int) is_gen(x::LaurentMPolyRingElem) diff --git a/docs/src/laurent_polynomial.md b/docs/src/laurent_polynomial.md index f6f5bdcb7..eabf400c8 100644 --- a/docs/src/laurent_polynomial.md +++ b/docs/src/laurent_polynomial.md @@ -51,7 +51,7 @@ julia> symbols(R) 1-element Vector{Symbol}: :x -julia> nvars(R) +julia> number_of_variables(R) 1 julia> f = x^-2 + 2x diff --git a/docs/src/mpoly_interface.md b/docs/src/mpoly_interface.md index 41351d3c8..3402ed115 100644 --- a/docs/src/mpoly_interface.md +++ b/docs/src/mpoly_interface.md @@ -120,7 +120,7 @@ ring. Note that these are `Symbol`s not `String`s, though their string values wi usually be used when printing polynomials. ```julia -nvars(f::MyMPolyRing{T}) where T <: RingElem +number_of_variables(f::MyMPolyRing{T}) where T <: RingElem ``` Return the number of variables of the polynomial ring. diff --git a/docs/src/mpolynomial.md b/docs/src/mpolynomial.md index 467c21985..8a43a4988 100644 --- a/docs/src/mpolynomial.md +++ b/docs/src/mpolynomial.md @@ -225,7 +225,7 @@ All basic functions from the Multivariate Polynomial interface are provided. ```julia symbols(S::MPolyRing) -nvars(f::MPolyRing) +number_of_variables(f::MPolyRing) gens(S::MPolyRing) gen(S::MPolyRing, i::Int) ``` @@ -458,7 +458,7 @@ julia> n = length(f) julia> is_gen(y) true -julia> nvars(S) == 2 +julia> number_of_variables(S) == 2 true julia> d = total_degree(f) diff --git a/docs/src/mseries.md b/docs/src/mseries.md index c2d912106..2e22f4716 100644 --- a/docs/src/mseries.md +++ b/docs/src/mseries.md @@ -226,7 +226,7 @@ for absolute series over any commutative ring. The following are provided for weighted and unweighted series: ```@docs -nvars(::Generic.AbsMSeriesRing) +number_of_variables(::Generic.AbsMSeriesRing) ``` ```@docs diff --git a/src/AbstractAlgebra.jl b/src/AbstractAlgebra.jl index d4c4bec4b..0967a23aa 100644 --- a/src/AbstractAlgebra.jl +++ b/src/AbstractAlgebra.jl @@ -338,12 +338,15 @@ function number_of_columns end const number_of_generators = GroupsCore.ngens # replace once GroupsCore is excised #function number_of_generators end function number_of_rows end +function number_of_variables end export number_of_columns export number_of_generators export number_of_rows +export number_of_variables @alias ncols number_of_columns @alias ngens number_of_generators @alias nrows number_of_rows +@alias nvars number_of_variables ############################################################################### # Macros for fancy printing. to use, enable attribute storage for your struct, @@ -1049,7 +1052,6 @@ export normalise export nullspace export num_coeff export number_field -export nvars export O export one export order diff --git a/src/Generic.jl b/src/Generic.jl index cdc24880a..aa6660eda 100644 --- a/src/Generic.jl +++ b/src/Generic.jl @@ -210,7 +210,7 @@ import ..AbstractAlgebra: NCRing import ..AbstractAlgebra: NCRingElem import ..AbstractAlgebra: number_of_rows import ..AbstractAlgebra: numerator -import ..AbstractAlgebra: nvars +import ..AbstractAlgebra: number_of_variables import ..AbstractAlgebra: O import ..AbstractAlgebra: order import ..AbstractAlgebra: parent_type diff --git a/src/MPoly.jl b/src/MPoly.jl index f4fd7d866..6349b8622 100644 --- a/src/MPoly.jl +++ b/src/MPoly.jl @@ -84,7 +84,7 @@ end Return the number of variables in `R`. """ -number_of_generators(R::MPolyRing) = nvars(R) +number_of_generators(R::MPolyRing) = number_of_variables(R) @doc raw""" vars(p::MPolyRingElem{T}) where {T <: RingElement} diff --git a/src/Poly.jl b/src/Poly.jl index 61e5de039..c0d40f771 100644 --- a/src/Poly.jl +++ b/src/Poly.jl @@ -45,11 +45,11 @@ this is returned as an array of `Symbol` not `String`. symbols(a::PolyRing) = [a.S] @doc raw""" - nvars(a::PolyRing) + number_of_variables(a::PolyRing) Return the number of variables of the polynomial ring, which is 1. """ -nvars(a::PolyRing) = 1 +number_of_variables(a::PolyRing) = 1 function check_parent(a::PolynomialElem, b::PolynomialElem, throw::Bool = true) c = parent(a) != parent(b) diff --git a/src/generic/AbsMSeries.jl b/src/generic/AbsMSeries.jl index 0ed168f05..6b60611e5 100644 --- a/src/generic/AbsMSeries.jl +++ b/src/generic/AbsMSeries.jl @@ -62,11 +62,11 @@ Return the number of nonzero terms in the series $a$. length(a::AbsMSeries) = length(poly(a)) @doc raw""" - nvars(R::AbsMSeriesRing) + number_of_variables(R::AbsMSeriesRing) Return the number of variables in the series ring. """ -nvars(R::AbsMSeriesRing) = nvars(poly_ring(R)) +number_of_variables(R::AbsMSeriesRing) = number_of_variables(poly_ring(R)) number_of_generators(R::AbsMSeriesRing) = number_of_generators(poly_ring(R)) diff --git a/src/generic/FreeAssAlgebra.jl b/src/generic/FreeAssAlgebra.jl index fefb82526..4369e65b2 100644 --- a/src/generic/FreeAssAlgebra.jl +++ b/src/generic/FreeAssAlgebra.jl @@ -32,7 +32,7 @@ function symbols(a::FreeAssAlgebra) return a.S end -function nvars(a::FreeAssAlgebra) +function number_of_variables(a::FreeAssAlgebra) return length(a.S) end @@ -88,7 +88,7 @@ function isone(a::FreeAssAlgElem{T}) where T end function number_of_generators(a::FreeAssAlgebra{T}) where T - return nvars(a) + return number_of_variables(a) end function gen(a::FreeAssAlgebra{T}, i::Int) where T diff --git a/src/generic/LaurentPoly.jl b/src/generic/LaurentPoly.jl index e95a92d28..87edfbab6 100644 --- a/src/generic/LaurentPoly.jl +++ b/src/generic/LaurentPoly.jl @@ -25,7 +25,7 @@ var(R::LaurentPolyWrapRing) = var(R.polyring) symbols(R::LaurentPolyWrapRing) = symbols(R.polyring) -nvars(R::LaurentPolyWrapRing) = nvars(R.polyring) +number_of_variables(R::LaurentPolyWrapRing) = number_of_variables(R.polyring) characteristic(R::LaurentPolyWrapRing) = characteristic(R.polyring) diff --git a/src/generic/MPoly.jl b/src/generic/MPoly.jl index fe9f705fe..b66082074 100644 --- a/src/generic/MPoly.jl +++ b/src/generic/MPoly.jl @@ -29,11 +29,11 @@ polynomial ring. symbols(a::MPolyRing) = a.S @doc raw""" - nvars(x::MPolyRing) + number_of_variables(x::MPolyRing) Return the number of variables of the polynomial ring. """ -nvars(a::MPolyRing) = a.num_vars +number_of_variables(a::MPolyRing) = a.num_vars number_of_generators(a::MPolyRing) = a.num_vars diff --git a/src/generic/UnivPoly.jl b/src/generic/UnivPoly.jl index 00e485535..d18b6da05 100644 --- a/src/generic/UnivPoly.jl +++ b/src/generic/UnivPoly.jl @@ -34,7 +34,7 @@ function mpoly_ring(S::UniversalPolyRing{T, U}) where {T <: RingElement, U <: Ab return S.mpoly_ring::Generic.MPolyRing{T} end -nvars(S::UniversalPolyRing) = length(S.S) +number_of_variables(S::UniversalPolyRing) = length(S.S) symbols(S::UniversalPolyRing) = S.S