Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Demin committed Jan 27, 2024
1 parent 9561c0e commit f3c9eca
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 46 deletions.
8 changes: 4 additions & 4 deletions benchmark/results/benchmark_result_0.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## Benchmark results

2024-01-26T23:39:30.428
2024-01-27T00:31:15.423

Benchmarked backends: Any["groebner", "maple", "msolve"]

Benchmark suite: dummy benchmark set

- Workers: 16
- Timeout: 1800 s
- Timeout: 60 s
- Aggregated over: 1 runs

**All timings in seconds.**

|Model|groebner|maple|msolve|
|:----|---|---|---|
|dummy 1|0.00|0.24|0.03|
|dummy 2|0.00|0.23|0.03|
|dummy 1|0.00|0.23|0.03|
|dummy 2|0.00|0.21|0.03|

*Benchmarking environment:*

Expand Down
4 changes: 2 additions & 2 deletions benchmark/results/groebner/benchmark_result_0.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Benchmark results

2024-01-26T23:39:00.057
2024-01-27T00:30:45.638

Benchmarked backend: groebner

Benchmark suite: dummy benchmark set

- Workers: 16
- Timeout: 1800 s
- Timeout: 60 s
- Aggregated over: 1 runs

**All timings in seconds.**
Expand Down
51 changes: 26 additions & 25 deletions benchmark/results/groebner/benchmark_result_1.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
## Benchmark results

2024-01-26T15:00:05.266
2024-01-27T00:17:07.455

Benchmarked backend: groebner

Benchmark suite: Integers modulo 2^30 + 3

- Workers: 16
- Timeout: 600 s
- Aggregated over: 3 runs
- Timeout: 1800 s
- Aggregated over: 1 runs

**All timings in seconds.**

|Model|Total, s|
|:----|---|
|chandra 11|0.48|
|chandra 12|2.73|
|chandra 13|14.95|
|chandra 14|98.81|
|chandra 11| - |
|chandra 12| - |
|chandra 13| - |
|chandra 14| - |
|cyclic 7|0.09|
|cyclic 8|1.17|
|cyclic 9|120.54|
|cyclic 8|1.56|
|cyclic 9|255.31|
|cyclic 10| - |
|dummy|0.00|
|eco 11|0.30|
|eco 12|1.98|
|eco 13|9.00|
|eco 14|93.24|
|henrion 5|0.00|
|henrion 6|0.03|
|henrion 7|1.97|
|eco 11| - |
|eco 12| - |
|eco 13| - |
|eco 14| - |
|henrion 5| - |
|henrion 6| - |
|henrion 7| - |
|henrion 8| - |
|katsura 10|0.75|
|katsura 11|5.14|
|katsura 12|35.77|
|katsura 10| - |
|katsura 11| - |
|katsura 12|101.30|
|katsura 13| - |
|noon 7|0.17|
|noon 8|1.37|
|noon 9|13.44|
|noon 7| - |
|noon 8| - |
|noon 9|16.57|
|noon 10| - |
|noon 11| - |
|reimer 6|0.05|
|reimer 7|0.69|
|reimer 8|18.28|
|reimer 6| - |
|reimer 7| - |
|reimer 8| - |
|reimer 9| - |

*Benchmarking environment:*
Expand All @@ -58,6 +58,7 @@ Versions of the dependencies:
* PrecompileTools : 1.2.0
* MultivariatePolynomials : 0.5.3
* Combinatorics : 1.0.2
* HostCPUFeatures : 0.1.16
* AbstractAlgebra : 0.34.7
* Nemo : 0.38.3
* Atomix : 0.1.0
Expand Down
8 changes: 4 additions & 4 deletions benchmark/results/maple/benchmark_result_0.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## Benchmark results

2024-01-26T23:39:14.885
2024-01-27T00:30:59.875

Benchmarked backend: maple

Benchmark suite: dummy benchmark set

- Workers: 16
- Timeout: 1800 s
- Timeout: 60 s
- Aggregated over: 1 runs

**All timings in seconds.**

|Model|Total, s|
|:----|---|
|dummy 1|0.24|
|dummy 2|0.23|
|dummy 1|0.23|
|dummy 2|0.21|

*Benchmarking environment:*

Expand Down
4 changes: 2 additions & 2 deletions benchmark/results/msolve/benchmark_result_0.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Benchmark results

2024-01-26T23:39:28.793
2024-01-27T00:31:13.800

Benchmarked backend: msolve

Benchmark suite: dummy benchmark set

- Workers: 16
- Timeout: 1800 s
- Timeout: 60 s
- Aggregated over: 1 runs

**All timings in seconds.**
Expand Down
12 changes: 12 additions & 0 deletions experimental/lexcmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ end

#########

function scalar_cmp_lex(x, y)
i = 2
@inbounds while i < length(x) && x[i] == y[i]
i += 1
end
@inbounds x[i] < y[i]
end

begin
n, step = 1, 5
while n < 500
@info "n = $n"
print("scalar_cmp_lex\t\t\t")
@btime scalar_cmp_lex(xx, yy) setup = begin
cc, xx, yy = _setup3(Int8, max(1, $n))
end
print("Groebner.monom_is_equal\t\t")
@btime Groebner.monom_is_equal(xx, yy) setup = begin
cc, xx, yy = _setup3(Int8, max(1, $n))
Expand Down
4 changes: 2 additions & 2 deletions src/groebner/state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ function clear_denominators!(
@inbounds for i in 1:length(coeffs_qq)
@invariant length(coeffs_zz[i]) == length(coeffs_qq[i])
den = common_denominator!(den, coeffs_qq[i])
sz = Base.GMP.MPZ.sizeinbase(den, 2)
# sz = Base.GMP.MPZ.sizeinbase(den, 2)
for j in 1:length(coeffs_qq[i])
num = numerator(coeffs_qq[i][j])
Base.GMP.MPZ.tdiv_q!(buf, den, denominator(coeffs_qq[i][j]))
Base.GMP.MPZ.realloc2!(coeffs_zz[i][j], sz)
# Base.GMP.MPZ.realloc2!(coeffs_zz[i][j], sz)
Base.GMP.MPZ.mul!(coeffs_zz[i][j], num, buf)
end
end
Expand Down
19 changes: 12 additions & 7 deletions src/input-output/AbstractAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,12 @@ end
# specialization for multivariate polynomials
function extract_coeffs_qq(representation, ring::PolyRing, poly)
iszero(poly) && (return zero_coeffs(representation.coefftype, ring))
map(Rational{BigInt}, AbstractAlgebra.coefficients(poly))
n = length(poly)
arr = Vector{Rational{BigInt}}(undef, n)
@inbounds for i in 1:n
arr[i] = Rational{BigInt}(AbstractAlgebra.coeff(poly, i))
end
arr
end

function get_var_to_index(
Expand Down Expand Up @@ -523,10 +528,10 @@ function extract_monoms(
npolys = length(orig_polys)
var_to_index = get_var_to_index(AbstractAlgebra.parent(orig_polys[1]))
exps = Vector{Vector{representation.monomtype}}(undef, npolys)
for i in 1:npolys
@inbounds for i in 1:npolys
poly = orig_polys[i]
exps[i] = Vector{representation.monomtype}(undef, length(poly))
@inbounds for j in 1:length(poly)
for j in 1:length(poly)
exps[i][j] = monom_construct_from_vector(
representation.monomtype,
poly.exps[(end - 1):-1:1, j]
Expand All @@ -545,10 +550,10 @@ function extract_monoms(
npolys = length(orig_polys)
var_to_index = get_var_to_index(AbstractAlgebra.parent(orig_polys[1]))
exps = Vector{Vector{representation.monomtype}}(undef, npolys)
for i in 1:npolys
@inbounds for i in 1:npolys
poly = orig_polys[i]
exps[i] = Vector{representation.monomtype}(undef, length(poly))
@inbounds for j in 1:length(poly)
for j in 1:length(poly)
exps[i][j] = monom_construct_from_vector(
representation.monomtype,
poly.exps[end:-1:1, j]
Expand All @@ -567,10 +572,10 @@ function extract_monoms(
npolys = length(orig_polys)
var_to_index = get_var_to_index(AbstractAlgebra.parent(orig_polys[1]))
exps = Vector{Vector{representation.monomtype}}(undef, npolys)
for i in 1:npolys
@inbounds for i in 1:npolys
poly = orig_polys[i]
exps[i] = Vector{representation.monomtype}(undef, length(poly))
@inbounds for j in 1:length(poly)
for j in 1:length(poly)
exps[i][j] = monom_construct_from_vector(
representation.monomtype,
poly.exps[1:(end - 1), j]
Expand Down

0 comments on commit f3c9eca

Please sign in to comment.