Skip to content

Commit bba11a5

Browse files
authored
Merge branch 'algebraic-solving:main' into intervals
2 parents 3d49624 + 77c61d5 commit bba11a5

File tree

7 files changed

+31
-17
lines changed

7 files changed

+31
-17
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ jobs:
4141
os: macOS-latest
4242

4343
steps:
44-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v4
4545
with:
4646
# For Codecov, we must also fetch the parent of the HEAD commit to
4747
# be able to properly deal with PRs / merges
4848
fetch-depth: 2
4949
- name: "Set up Julia"
50-
uses: julia-actions/setup-julia@v1
50+
uses: julia-actions/setup-julia@v2
5151
with:
5252
version: ${{ matrix.julia-version }}
5353
arch: ${{ matrix.julia-arch }}
@@ -76,7 +76,7 @@ jobs:
7676
name: Documentation
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: actions/checkout@v2
79+
- uses: actions/checkout@v4
8080
- uses: julia-actions/cache@v1
8181
- uses: julia-actions/julia-buildpkg@latest
8282
- uses: julia-actions/julia-docdeploy@latest

.github/workflows/CleanupDocPreview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout gh-pages branch
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
with:
1414
ref: gh-pages
1515
- name: Delete preview

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AlgebraicSolving"
22
uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d"
33
authors = ["ederc <[email protected]>", "Mohab Safey El Din <[email protected]", "Rafael Mohr <[email protected]>"]
4-
version = "0.4.13"
4+
version = "0.4.15"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -17,7 +17,7 @@ msolve_jll = "6d01cc9a-e8f6-580e-8c54-544227e08205"
1717

1818
[compat]
1919
LoopVectorization = "0.12"
20-
Nemo = "0.43"
20+
Nemo = "0.43, 0.44, 0.45"
2121
StaticArrays = "1"
2222
julia = "1.6"
2323
LinearAlgebra = "1.6"
@@ -26,4 +26,4 @@ Markdown = "1.6"
2626
Printf = "1.6"
2727
Random = "1.6"
2828
Test = "1.6"
29-
msolve_jll = "0.6.5"
29+
msolve_jll = "0.600.501"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
88

99
[compat]
1010
Documenter = "0.26"
11-
msolve_jll = "0.6.1"
11+
msolve_jll = "0.600.501"

src/algorithms/groebner-bases.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ function _core_groebner_basis(
147147
error("At the moment we only supports finite fields.")
148148
end
149149

150-
lens, cfs, exps = _convert_to_msolve(F)
150+
# nr_gens might change if F contains zero polynomials
151+
lens, cfs, exps, nr_gens = _convert_to_msolve(F)
151152

152153
gb_ld = Ref(Cint(0))
153154
gb_len = Ref(Ptr{Cint}(0))

src/interfaces/nemo.jl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ function _convert_to_msolve(
2121
if field_char > 2^31 || degree(base_ring(R)) != 1
2222
error("At the moment we only support prime fields up to prime characteristic < 2^31.")
2323
end
24+
25+
lens = Int32[]
2426
# get coefficients
2527
if field_char == 0
2628
cfs = BigInt[]
@@ -29,15 +31,21 @@ function _convert_to_msolve(
2931
end
3032
if field_char == 0
3133
for i in 1:nr_gens
32-
for cf in coefficients(F[i])
33-
push!(cfs, BigInt(numerator(cf)))
34-
push!(cfs, BigInt(denominator(cf)))
34+
if F[i] != R(0)
35+
for cf in coefficients(F[i])
36+
push!(cfs, BigInt(numerator(cf)))
37+
push!(cfs, BigInt(denominator(cf)))
38+
end
39+
push!(lens, length(F[i]))
3540
end
3641
end
3742
else
3843
for i in 1:nr_gens
39-
for cf in coefficients(F[i])
40-
push!(cfs, Int32(lift(Nemo.ZZ, cf)))
44+
if F[i] != R(0)
45+
for cf in coefficients(F[i])
46+
push!(cfs, Int32(lift(Nemo.ZZ, cf)))
47+
end
48+
push!(lens, length(F[i]))
4149
end
4250
end
4351
end
@@ -50,7 +58,7 @@ function _convert_to_msolve(
5058
end
5159
end
5260

53-
return lens, cfs, exps
61+
return lens, cfs, exps, length(lens)
5462
end
5563

5664
@doc Markdown.doc"""

test/interfaces/nemo.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
@testset "Interfaces -> Nemo" begin
22
R, (x,y,z) = polynomial_ring(QQ,["x","y","z"], internal_ordering=:degrevlex)
33
F = [x^2+1-3, x*y-z, x*z^2-3*y^2]
4-
cmp = (Int32[2, 2, 2], BigInt[1, 1, -2, 1, 1, 1, -1, 1, 1, 1, -3, 1], Int32[2, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 2, 0, 2, 0])
4+
cmp = (Int32[2, 2, 2], BigInt[1, 1, -2, 1, 1, 1, -1, 1, 1, 1, -3, 1], Int32[2, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 2, 0, 2, 0], 3)
55
@test AlgebraicSolving._convert_to_msolve(F) == cmp
6+
# issue #54
7+
R, (x1, x2) = polynomial_ring(GF(17), ["x1", "x2"])
8+
I = Ideal([x1, R(0)])
9+
cmp = (Int32[1], BigInt[1], Int32[1, 0], 1)
10+
@test AlgebraicSolving._convert_to_msolve(I.gens) == cmp
611
for _GF in [GF, AlgebraicSolving.Nemo.Native.GF]
712
R, (x,y,z) = polynomial_ring(_GF(2147483659),["x","y","z"], internal_ordering=:degrevlex)
813
F = [x^2+1-3, x*y-z, x*z^2-3*y^2]
@@ -11,6 +16,6 @@
1116
R, (x,y,z) = polynomial_ring(_GF(101),["x","y","z"], internal_ordering=:degrevlex)
1217
F = [x^2+1-3, x*y-z, x*z^2-3*y^2]
1318
res = AlgebraicSolving._convert_to_msolve(F)
14-
@test AlgebraicSolving._convert_finite_field_array_to_abstract_algebra(Int32(3), res..., R) == F
19+
@test AlgebraicSolving._convert_finite_field_array_to_abstract_algebra(Int32(3), res[1], res[2], res[3], R) == F
1520
end
1621
end

0 commit comments

Comments
 (0)