Skip to content

Conversation

@YingboMa
Copy link
Owner

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@8280dd1). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master       #5   +/-   ##
=========================================
  Coverage          ?   75.05%           
=========================================
  Files             ?        7           
  Lines             ?      938           
  Branches          ?        0           
=========================================
  Hits              ?      704           
  Misses            ?      234           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8280dd1...6d26b83. Read the comment docs.

MPoly{T}(x::CoeffType) where {T} = MPoly(eltype(T)(x))
terms(x::MPoly) = x.terms
function nvariables(p::MPoly)
if monomialtype(p) <: PackedMonomial
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only support PackedMonomial here?

PackedMonomial{L,E}(bits::NTuple{K,UInt64}) where {L,E,K} = new{L,new_E(Val(E)),K}(bits)
PackedMonomial{L,E,K}(bits::NTuple{K,UInt64}) where {L,E,K} = new{L,new_E(Val(E)),K}(bits)
end
nvariables(x::PackedMonomial{L}) where L = L
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition is not the same as the nvariables definition for Monomial.
L is the maximum number of supported variables.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just added those quickly so I can use Groebner.jl :p it's not optimized.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, computing nvariables for polynomial can be expensive. We have to take the union.

@YingboMa
Copy link
Owner Author

@chriselrod
Copy link
Collaborator

Mind adding tests and adding an example?

@YingboMa
Copy link
Owner Author

After loading SIMDPolynomials and Groebner

julia> x1, x2 = [PackedMonomial{2,7}(i) for i in 0:1];

julia> system = [10*x1*x2^2 - 11*x1 + 10,
               10*x1^2*x2 - 11*x2 + 10];

julia> groebner(system)
3-element Vector{MPoly{Vector{SIMDPolynomials.Term{Int64, PackedMonomial{2, 7, 1}}}}}:
             11x₀² - 11x₁² - 10x₀ + 10x₁
 110x₁³ + 100x₀x₁ - 100x₁² - 121x₁ + 110
                     10x₀x₁² - 11x₀ + 10

Co-authored-by: Chris Elrod <elrodc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants