Skip to content

Commit

Permalink
nvars
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Jan 18, 2024
1 parent cd86e74 commit 60a8952
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/src/free_associative_algebra.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/laurent_mpolynomial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/laurent_polynomial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/src/mpoly_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/mpolynomial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/mseries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/AbstractAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1049,7 +1052,6 @@ export normalise
export nullspace
export num_coeff
export number_field
export nvars
export O
export one
export order
Expand Down
2 changes: 1 addition & 1 deletion src/Generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions src/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/generic/AbsMSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions src/generic/FreeAssAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/generic/LaurentPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/generic/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/generic/UnivPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 60a8952

Please sign in to comment.