Skip to content

Commit

Permalink
Add is_known_to_be_radical.
Browse files Browse the repository at this point in the history
  • Loading branch information
HechtiDerLachs committed Sep 24, 2024
1 parent 34ac7ef commit 223c836
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Rings/mpoly-ideals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ Ideal generated by
```
"""
@attr MPolyIdeal{T} function radical(I::MPolyIdeal{T}) where {T <: MPolyRingElem}
is_known_to_be_radical(I) && return I
# Calling `elimpart` (within `simplify`) turns out to significantly speed things up in many cases.
R = base_ring(I)
Q, pr = quo(R, I)
Expand Down Expand Up @@ -611,6 +612,7 @@ function radical(
I::MPolyIdeal{T};
factor_generators::Bool=true
) where {U<:Union{AbsSimpleNumFieldElem, <:Hecke.RelSimpleNumFieldElem}, T<:MPolyRingElem{U}}
is_known_to_be_radical(I) && return I
get_attribute!(I, :radical) do
is_one(I) && return I
R = base_ring(I)
Expand Down Expand Up @@ -660,6 +662,13 @@ Computes the radical.
return is_subset(radical(I), I)
end

function is_known_to_be_radical(I::Ideal)
has_attribute(I, :is_radical) && get_attribute(I, :is_radical) === true && return true
has_attribute(I, :is_prime) && get_attribute(I, :is_prime) === true && return true
return false
end


#######################################################
@doc raw"""
primary_decomposition(I::MPolyIdeal; algorithm = :GTZ, cache=true)
Expand Down

0 comments on commit 223c836

Please sign in to comment.