Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 27, 2024
1 parent 623e0e2 commit 2b6e4ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/Certificate/ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

abstract type AbstractIdealCertificate <: AbstractCertificate end

function _reduced_basis(basis::MB.SubBasis, gram_bases::AbstractVector{<:MB.SubBasis}, weights)
monos = Set(basis.monomials)
function _reduced_basis(basis::MB.SubBasis{B,M}, gram_bases::AbstractVector{<:MB.SubBasis}, weights) where {B,M}
full = MB.FullBasis{B,M}()
p = MB._algebra_element(ones(Int, length(basis)), B)
for (gram, weight) in zip(gram_bases, weights)
w = MB.convert_basis(full, weight)
for j in eachindex(gram)
for i in 1:j
s = gram[i] * gram[j]
for w in MP.monomials(weight)
push!(monos, w * mono)
s = MB.convert_basis(full, gram[i] * gram[j])
for w_mono in SA.supp(w)
for mono in SA.supp(w_mono * s)
union!(monos, mono.monomial)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/certificate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function certificate_api(certificate::Certificate.AbstractIdealCertificate)
MP.coefficients(poly),
MB.SubBasis{MB.Monomial}(MP.monomials(poly)),
domain,
) isa MP.AbstractPolynomial
) isa Tuple
_basis_check(
Certificate.gram_basis(certificate, poly),
Certificate.gram_basis_type(typeof(certificate), MP.monomial_type(x)),
Expand Down

0 comments on commit 2b6e4ea

Please sign in to comment.