Skip to content

Commit

Permalink
add Groebner v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Demin committed Jul 26, 2023
1 parent 2f2131d commit fe52c01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DiffRules = "1.4"
Distributions = "0.23, 0.24, 0.25"
DocStringExtensions = "0.7, 0.8, 0.9"
DomainSets = "0.6"
Groebner = "0.3"
Groebner = "0.3, 0.4"
IfElse = "0.1"
LaTeXStrings = "1.3"
Latexify = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16"
Expand Down
10 changes: 5 additions & 5 deletions src/groebner_basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ DP = SymbolicUtils.DynamicPolynomials
Bijections = SymbolicUtils.Bijections

# extracting underlying polynomial and coefficient type from Polyforms
underlyingpoly(x::Number) = x
underlyingpoly(x::Number) = x
underlyingpoly(pf::PolyForm) = pf.p
coefftype(x::Number) = typeof(x)
coefftype(x::Number) = typeof(x)
coefftype(pf::PolyForm) = DP.coefficienttype(underlyingpoly(pf))

#=
Expand All @@ -19,8 +19,8 @@ function symbol_to_poly(sympolys::AbstractArray)
stdsympolys = map(unwrap, sympolys)
sort!(stdsympolys, lt=(<ₑ))

pvar2sym = Bijections.Bijection{Any,Any}()
sym2term = Dict{BasicSymbolic,Any}()
pvar2sym = Bijections.Bijection{Any,Any}()
sym2term = Dict{BasicSymbolic,Any}()
polyforms = map(f -> PolyForm(f, pvar2sym, sym2term), stdsympolys)

# Discover common coefficient type
Expand Down Expand Up @@ -72,7 +72,7 @@ The algorithm is randomized, so the basis will be correct with high probability.
function groebner_basis(polynomials)
polynoms, pvar2sym, sym2term = symbol_to_poly(polynomials)

basis = groebner(polynoms, reduced=true)
basis = groebner(polynoms)

# polynomials is nonemtpy
T = symtype(first(polynomials))
Expand Down

0 comments on commit fe52c01

Please sign in to comment.