Closed blegat closed 4 days ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
c4f7e9a
) 85.10% compared to head (d33d510
) 85.32%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@blegat how to turn MonomialBasis{Monomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}, MonomialVector{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}}
into an actual vector?
also something is rather odd here:
basis = SumOfSquares.Certificate.gram_basis(cert.certificate, poly)
@info eltype(basis)
shows Any
?
Maybe we could define eltype
I think I didn't do it since it's not an AbstractVector
. By the way, an StarAlgebras.AbstractBasis
is also not an AbstractVector
so probably that will remain the case right ?
julia> basis = MonomialBasis(monomials([x, y], 2))
MonomialBasis([y², xy, x²])
julia> generators(basis)
3-element MonomialVector{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}:
y²
xy
x²
julia> generators(basis) isa AbstractVector
true
julia> eltype(generators(basis))
Monomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}
You could also let me know the API you need the basis to implement and we could make sure StarAlgebra.AbstractBasis
subtypes such as MonomialBasis
do implement it.
at the moment it's enough for basis to get an honest vector that's it.
We'll overhaul the whole thing in the near future, so there's no need to define the API for the old version, right?
No, no need, this PR can sit here and wait for StarAlgebras
I bumped in https://github.com/jump-dev/SumOfSquares.jl/pull/355 even if it's not working but I'll wait for https://github.com/kalmarek/SymbolicWedderburn.jl/issues/79
Closes https://github.com/jump-dev/SumOfSquares.jl/pull/352