Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Dec 24, 2024
1 parent 8bf13eb commit 588fa61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Certificate/newton_polytope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ Base.copy(s::SignChange) = s
Base.iszero(::SignChange) = false
MA.scaling_convert(::Type, s::SignChange) = s
Base.:*(s::SignChange, α::Real) = SignChange(s.sign * α, s.Δ)
Base.:*::Real, s::SignChange) = SignChange* s.sign, s.Δ)

struct SignCount
unknown::Int
Expand Down Expand Up @@ -710,7 +711,7 @@ function post_filter(
cache = zero(Float64, MB.algebra(MB.implicit_basis(SA.basis(poly))))
for (mono, v) in SA.nonzero_pairs(SA.coeffs(poly))
MA.operate!(
SA.UnsafeAddMul(*),
SA.UnsafeAdd(),
counter,
_term(SignChange(_sign(v), 1), SA.basis(poly)[mono]),
)
Expand Down
1 change: 1 addition & 0 deletions src/gram_matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function MP.similar_type(
return GramMatrix{S,B,US,MS}
end

SA.basis(g::GramMatrix) = g.basis
MB.implicit_basis(g::GramMatrix) = MB.implicit_basis(g.basis)

# When taking the promotion of a GramMatrix of JuMP.Variable with a Polynomial JuMP.Variable, it should be a Polynomial of AffExpr
Expand Down

0 comments on commit 588fa61

Please sign in to comment.