Skip to content

Commit

Permalink
TropicalGeometry: removing unused optional perturbation input
Browse files Browse the repository at this point in the history
  • Loading branch information
YueRen committed Aug 19, 2024
1 parent 18b65a7 commit 92289bc
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/TropicalGeometry/initial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
################################################################################

@doc raw"""
initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::Vector; perturbation::Vector=[])
initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::Vector)
Return the initial form of `f` with respect to the tropical semiring map `nu` and weight vector `w`.
Expand Down Expand Up @@ -46,8 +46,7 @@ x + y + 1
```
"""
function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::AbstractVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}; perturbation::Union{Nothing,AbstractVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}}}=nothing)

function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::AbstractVector{<:Union{QQFieldElem,ZZRingElem,Rational,Integer}})
###
# Evaluate the tropicalization of f and all its terms at w,
# mark the terms which attain the evaluated value
Expand All @@ -60,15 +59,6 @@ function initial(f::MPolyRingElem, nu::TropicalSemiringMap, w::AbstractVector{<:
coeffs = coeffs[termsAttainingValue]
expvs = expvs[termsAttainingValue]

# if perturbation passed, further filter the marked terms
if !isnothing(perturbation)
tropTermsEvaluated = [tropical_semiring(nu)(dot(w,alpha)) for (c,alpha) in zip(coeffs,expvs)]
tropPolyEvaluated = sum(tropTermsEvaluated)
termsAttainingValue = findall(isequal(tropPolyEvaluated),tropTermsEvaluated)
coeffs = coeffs[termsAttainingValue]
expvs = expvs[termsAttainingValue]
end

###
# Construct the initial form
###
Expand Down

0 comments on commit 92289bc

Please sign in to comment.