m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
803 B

6 months ago
  1. """Benchmark of the Groebner bases algorithms. """
  2. from sympy.polys.rings import ring
  3. from sympy.polys.domains import QQ
  4. from sympy.polys.groebnertools import groebner
  5. R, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12 = ring("x1:13", QQ)
  6. V = R.gens
  7. E = [(x1, x2), (x2, x3), (x1, x4), (x1, x6), (x1, x12), (x2, x5), (x2, x7), (x3, x8),
  8. (x3, x10), (x4, x11), (x4, x9), (x5, x6), (x6, x7), (x7, x8), (x8, x9), (x9, x10),
  9. (x10, x11), (x11, x12), (x5, x12), (x5, x9), (x6, x10), (x7, x11), (x8, x12)]
  10. F3 = [ x**3 - 1 for x in V ]
  11. Fg = [ x**2 + x*y + y**2 for x, y in E ]
  12. F_1 = F3 + Fg
  13. F_2 = F3 + Fg + [x3**2 + x3*x4 + x4**2]
  14. def time_vertex_color_12_vertices_23_edges():
  15. assert groebner(F_1, R) != [1]
  16. def time_vertex_color_12_vertices_24_edges():
  17. assert groebner(F_2, R) == [1]