Skip to content

Commit

Permalink
add number_of_generators for UniversalPolyRing (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoongNoonien committed Sep 20, 2024
1 parent e4a2ccf commit fd3af98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/univpolynomial.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ Universal Polynomial Ring over Integers
julia> x = gen(S, "x")
x
julia> number_of_generators(S)
1
julia> y, z = gens(S, ["y", "z"])
(y, z)
julia> number_of_generators(S)
3
```

## Universal polynomial functionality
Expand Down
2 changes: 2 additions & 0 deletions src/generic/UnivPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ end

number_of_variables(S::UniversalPolyRing) = length(S.S)

number_of_generators(S::UniversalPolyRing) = length(S.S)

symbols(S::UniversalPolyRing) = S.S

function vars(p::UnivPoly{T}) where {T}
Expand Down

0 comments on commit fd3af98

Please # to comment.