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 8b022d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/TropicalGeometry/initial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ x + y + 1
```
"""
function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::Vector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; perturbation::Union{Nothing,Vector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}}=nothing)
function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::AbstractVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; perturbation::Union{Nothing,AbstractVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}}=nothing)

###
# Evaluate the tropicalization of f and all its terms at w,
Expand Down Expand Up @@ -110,7 +110,7 @@ Ideal generated by
-2*x^2*y + 3*y^3
```
"""
function initial(I::MPolyIdeal, nu::TropicalSemiringMap, w::Vector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; skip_groebner_basis_computation::Bool=false)
function initial(I::MPolyIdeal, nu::TropicalSemiringMap, w::AbstractVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; skip_groebner_basis_computation::Bool=false)
G = (skip_groebner_basis_computation ? gens(G) : groebner_basis(I,nu,w))
return ideal(initial.(G,Ref(nu),Ref(w)))
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 8b022d0

Please sign in to comment.