-
Notifications
You must be signed in to change notification settings - Fork 1
Groebner.jl integration #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ 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.
|
| MPoly{T}(x::CoeffType) where {T} = MPoly(eltype(T)(x)) | ||
| terms(x::MPoly) = x.terms | ||
| function nvariables(p::MPoly) | ||
| if monomialtype(p) <: PackedMonomial |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
Mind adding tests and adding an example? |
|
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>
No description provided.