Skip to content

Commit

Permalink
TropicalGeometry: allow point_vector as input for initial
Browse files Browse the repository at this point in the history
  • Loading branch information
YueRen committed Aug 19, 2024
1 parent 6b48af3 commit d7b35c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/TropicalGeometry/initial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::Vector{<:Union{QQ
return finish(initialForm)
end

function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::PointVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; perturbation::Union{Nothing,Vector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}}=nothing)
return initial(f,nu,Vector(w); perturbation=perturbation)
end

function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::Vector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; perturbation::Union{Nothing,RayVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}}=nothing)
return initial(f,nu,w; perturbation=Vector(perturbation))
end

function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::PointVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; perturbation::Union{Nothing,RayVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}}=nothing)
return initial(f,nu,Vector(w); perturbation=Vector(perturbation))
end


@doc raw"""
Expand Down Expand Up @@ -114,3 +125,7 @@ function initial(I::MPolyIdeal, nu::TropicalSemiringMap, w::Vector{<:Union{QQFie
G = (skip_groebner_basis_computation ? gens(G) : groebner_basis(I,nu,w))
return ideal(initial.(G,Ref(nu),Ref(w)))
end

function initial(I::MPolyIdeal, nu::TropicalSemiringMap, w::PointVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; skip_groebner_basis_computation::Bool=false)
return initial(I,nu,Vector(w); skip_groebner_basis_computation=skip_groebner_basis_computation)
end
2 changes: 1 addition & 1 deletion test/TropicalGeometry/initial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
nuMin = tropical_semiring_map(QQ,2)
nuMax = tropical_semiring_map(QQ,2,max)
S,(x,y) = GF(2)["x","y"]
@test initial(f,nuMin,w) == x^2+y^2 # padic, min
@test initial(f,nuMin,point_vector(w)) == x^2+y^2 # padic, min
@test initial(f,nuMax,w) == x^2+y^2+x+y # tadic, max

K,t = rational_function_field(GF(2),"t")
Expand Down

0 comments on commit d7b35c0

Please sign in to comment.