Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generic/FactoredFraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ end
#
###############################################################################

function Base.deepcopy_internal(a::FactoredFracFieldElem{T}, dict::IdDict) where T <: RingElement
function deepcopy_internal(a::FactoredFracFieldElem{T}, dict::IdDict) where T <: RingElement
return FactoredFracFieldElem{T}(deepcopy_internal(a.unit, dict),
deepcopy_internal(a.terms, dict),
a.parent)
Expand Down
2 changes: 1 addition & 1 deletion src/generic/FreeAssociativeAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
#
###############################################################################

function Base.deepcopy_internal(a::FreeAssociativeAlgebraElem{T}, dict::IdDict) where T <: RingElement
function deepcopy_internal(a::FreeAssociativeAlgebraElem{T}, dict::IdDict) where T <: RingElement
return FreeAssociativeAlgebraElem{T}(
a.parent,
deepcopy_internal(a.coeffs, dict),
Expand Down
25 changes: 11 additions & 14 deletions src/generic/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Return a list of generators of the ideal `I` in reduced form and canonicalised.
"""
gens(I::Ideal{T}) where T <: RingElement = I.gens

function deepcopy_internal(I::Ideal, dict::IdDict)
elms = [deepcopy_internal(x, dict) for x in I.gens]
return Ideal(base_ring(I), elms)
end

###############################################################################
#
# Heap and nodes
Expand Down Expand Up @@ -2136,26 +2141,18 @@ function intersect(I::Ideal{T}, J::Ideal{T}) where T <: RingElement
R = base_ring(I)
G1 = gens(I)
G2 = gens(J)
if isempty(G1)
return deepcopy(I)
end
if isempty(G2)
return deepcopy(J)
end
return Ideal(R, lcm(G1[1], G2[1]))
isempty(G1) && return deepcopy(I)
isempty(G2) && return deepcopy(J)
return Ideal(R, lcm(only(G1), only(G2)))
end

function intersect(I::Ideal{T}, J::Ideal{T}) where {U <: FieldElement, T <: AbstractAlgebra.PolyRingElem{U}}
R = base_ring(I)
G1 = gens(I)
G2 = gens(J)
if isempty(G1)
return deepcopy(I)
end
if isempty(G2)
return deepcopy(J)
end
return Ideal(R, lcm(G1[1], G2[1]))
isempty(G1) && return deepcopy(I)
isempty(G2) && return deepcopy(J)
return Ideal(R, lcm(only(G1), only(G2)))
end

function intersect(I::Ideal{T}, J::Ideal{T}) where {U <: RingElement, T <: AbstractAlgebra.PolyRingElem{U}}
Expand Down
2 changes: 1 addition & 1 deletion src/generic/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ isone(x::MPoly) = is_trivial(parent(x)) || (x.length == 1 && monomial_iszero(x.e

is_constant(x::MPoly) = x.length == 0 || (x.length == 1 && monomial_iszero(x.exps, 1, size(x.exps, 1)))

function Base.deepcopy_internal(a::MPoly{T}, dict::IdDict) where {T <: RingElement}
function deepcopy_internal(a::MPoly{T}, dict::IdDict) where {T <: RingElement}
Re = deepcopy_internal(a.exps, dict)
Rc = Vector{T}(undef, a.length)
for i = 1:a.length
Expand Down
2 changes: 1 addition & 1 deletion src/generic/SparsePoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ base_ring(R::SparsePolyRing{T}) where {T <: RingElement} = R.base_ring::parent_t

parent(a::SparsePoly) = a.parent

function Base.deepcopy_internal(a::SparsePoly{T}, dict::IdDict) where {T <: RingElement}
function deepcopy_internal(a::SparsePoly{T}, dict::IdDict) where {T <: RingElement}
Re = Base.deepcopy_internal(a.exps, dict)
Rc = Vector{T}(undef, a.length)
for i = 1:a.length
Expand Down
Loading