Skip to content

Commit

Permalink
Allow more inputs for gens(::UniversalPolyRing, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 26, 2024
1 parent db07af9 commit 23b3a5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/generic/UnivPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ function gen(S::UniversalPolyRing{T}, s::VarName) where {T <: RingElement}
return UnivPoly{T}(gen(mpoly_ring(S), i), S)
end

gens(S::UniversalPolyRing, v::Vector{<:VarName}) = tuple([gen(S, s) for s in v]...)
# @varnames_interface expects the
gens(S::UniversalPolyRing, varnames...) = _gens(S, varnames...)[2:end]
_gens(S::UniversalPolyRing, v::Vector{Symbol}) = nothing, [gen(S, s) for s in v]
@varnames_interface _gens(S::UniversalPolyRing, s)

function gen(S::UniversalPolyRing{T}, i::Int) where {T}
@boundscheck 1 <= i <= nvars(S) || throw(ArgumentError("generator index out of range"))
Expand Down

0 comments on commit 23b3a5a

Please sign in to comment.