forked from oscar-system/Oscar.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmarks.jl
65 lines (52 loc) · 1.75 KB
/
benchmarks.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Oscar
include("cyclic.jl")
include("katsura.jl")
include("agk.jl")
include("tran3.3.jl")
function benchmark(
io,
name::String,
I::Ideal,
target::MonomialOrdering,
start::MonomialOrdering
)
print(io, name, ","); flush(io)
t = @elapsed groebner_walk($I, $target, $start; algorithm=:standard)
print(io, t, ","); flush(io)
t = @elapsed groebner_walk($I, $target, $start; algorithm=:generic)
print(io, t, ","); flush(io)
t = @elapsed groebner_walk($I, $target, $start; algorithm=:perturbed)
print(io, t, ","); flush(io)
t = @elapsed groebner_basis($I; ordering=$target)
println(io, t); flush(io)
end
function print_header(io)
print(io, "name,standard_walk,generic_walk,perturbed_walk,buchberger\n")
end
p = 11863279
Fp = GF(p)
open("results.csv", "a") do io
R, (x, y) = QQ[:x, :y]
I = ideal([y^4 + x^3 - x^2 + x, x^4])
benchmark(io, "simple", I, lex(R), default_ordering(R))
benchmark(io, "cyclic5-QQ", cyclic5(QQ)...)
benchmark(io, "cyclic5-Fp", cyclic5(Fp)...)
benchmark(io, "cyclic6-QQ", cyclic6(QQ)...)
benchmark(io, "cyclic6-Fp", cyclic6(Fp)...)
I = katsura(6)
R = base_ring(I)
benchmark(io, "katsura6-QQ", I, lex(R), default_ordering(R))
Ip = map(gens(I)) do f
change_coefficient_ring(Fp, f)
end |> ideal
Rp = base_ring(Ip)
benchmark(io, "katsura6-Fp", Ip, lex(Rp), default_ordering(Rp))
benchmark(io, "cyclic7-QQ", cyclic7(QQ)...)
benchmark(io, "cyclic7-Fp", cyclic7(Fp)...)
benchmark(io, "agk4-QQ", agk4(QQ)...)
benchmark(io, "agk4-Fp", agk4(Fp)...)
benchmark(io, "tran3.3-QQ", tran33(QQ)...)
benchmark(io, "tran3.3-Fp", tran33(Fp)...)
benchmark(io, "newellp1-QQ", Oscar.newell_patch_with_orderings(QQ)...)
benchmark(io, "newellp1-Fp", Oscar.newell_patch_with_orderings(Fp)...)
end