Skip to content

Commit

Permalink
Avoid factoring zero (oscar-system#3104)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Dec 13, 2023
1 parent 6d999d6 commit 13c3fc3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ end

# removes factors that are in the semigroup generated by Sgens
function clean(f::RingElem, R::MPolyRing, Sgens::Vector{<:RingElem})
is_zero(f) && return f # TODO: move to the right place
fFactors = factor(f)
cleanf_arr = [k^e for (k, e) in fFactors if !(k in Sgens) || is_unit(k)]
length(cleanf_arr) > 0 ? prod(cleanf_arr) : unit(fFactors)
Expand Down

0 comments on commit 13c3fc3

Please sign in to comment.