Skip to content

Commit

Permalink
Add promotion for ideal
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 24, 2024
1 parent ff8a74f commit 66dcc13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function Base.convert(
end

ideal(set::FixedVariablesSet, args...) = set.ideal
function MA.promote_operation(::typeof(ideal), ::Type{FixedVariablesSet{V,T,M}}) where {V,T,M}
return FixedVariablesIdeal{V,T,M}
end
MP.variables(set::FixedVariablesSet) = MP.variables(set.ideal)
function MP.monomial_type(::Type{FixedVariablesSet{V,T,M}}) where {V,T,M}
return M
Expand Down
3 changes: 3 additions & 0 deletions src/variety.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ function projective_algebraic_set(p::Vector, args...)
end

ideal(V::AlgebraicSet) = V.I
function MA.promote_operation(::typeof(ideal), ::Type{<:AlgebraicSet{T,P,A}}) where {T,P,A}
return PolynomialIdeal{T,P,A}
end

MP.variables(V::AlgebraicSet) = MP.variables(V.I)
MP.monomial_type(::Type{<:AlgebraicSet{T,P}}) where {T,P} = MP.monomial_type(P)
Expand Down

0 comments on commit 66dcc13

Please sign in to comment.