passagemath-singular 10.6.31rc3__cp314-cp314-musllinux_1_2_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-singular might be problematic. Click here for more details.

Files changed (493) hide show
  1. PySingular.cpython-314-x86_64-linux-musl.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +493 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +5 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-67059f19.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-30166d29.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-9d37bcf4.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-fd6f12fc.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgcc_s-0cd532bd.so.1 +0 -0
  11. passagemath_singular.libs/libgf2x-9e30c3e3.so.3.0.0 +0 -0
  12. passagemath_singular.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
  13. passagemath_singular.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  14. passagemath_singular.libs/libgsl-42cda06f.so.28.0.0 +0 -0
  15. passagemath_singular.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
  16. passagemath_singular.libs/libncursesw-9c9e32c3.so.6.5 +0 -0
  17. passagemath_singular.libs/libntl-26885ca2.so.44.0.1 +0 -0
  18. passagemath_singular.libs/libomalloc-0-e9ff96db.9.6.so +0 -0
  19. passagemath_singular.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
  20. passagemath_singular.libs/libpolys-4-8bcf8e7d.4.1.so +0 -0
  21. passagemath_singular.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
  22. passagemath_singular.libs/libreadline-06542304.so.8.2 +0 -0
  23. passagemath_singular.libs/libsingular_resources-4-73bf7623.4.1.so +0 -0
  24. passagemath_singular.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
  25. sage/algebras/all__sagemath_singular.py +3 -0
  26. sage/algebras/fusion_rings/all.py +19 -0
  27. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-musl.so +0 -0
  29. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  30. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-musl.so +0 -0
  32. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  33. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  34. sage/algebras/fusion_rings/fusion_double.py +899 -0
  35. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-musl.so +0 -0
  37. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  38. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  39. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-musl.so +0 -0
  40. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  41. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  42. sage/algebras/letterplace/all.py +1 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
  44. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  45. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
  47. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  48. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  49. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-musl.so +0 -0
  50. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  51. sage/algebras/quatalg/all.py +2 -0
  52. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  53. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-musl.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
  56. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  57. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  58. sage/all__sagemath_singular.py +11 -0
  59. sage/ext_data/all__sagemath_singular.py +1 -0
  60. sage/ext_data/singular/function_field/core.lib +98 -0
  61. sage/interfaces/all__sagemath_singular.py +1 -0
  62. sage/interfaces/singular.py +2835 -0
  63. sage/libs/all__sagemath_singular.py +1 -0
  64. sage/libs/singular/__init__.py +1 -0
  65. sage/libs/singular/decl.pxd +1168 -0
  66. sage/libs/singular/function.cpython-314-x86_64-linux-musl.so +0 -0
  67. sage/libs/singular/function.pxd +87 -0
  68. sage/libs/singular/function.pyx +1901 -0
  69. sage/libs/singular/function_factory.py +61 -0
  70. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-musl.so +0 -0
  71. sage/libs/singular/groebner_strategy.pxd +22 -0
  72. sage/libs/singular/groebner_strategy.pyx +582 -0
  73. sage/libs/singular/option.cpython-314-x86_64-linux-musl.so +0 -0
  74. sage/libs/singular/option.pyx +671 -0
  75. sage/libs/singular/polynomial.cpython-314-x86_64-linux-musl.so +0 -0
  76. sage/libs/singular/polynomial.pxd +39 -0
  77. sage/libs/singular/polynomial.pyx +661 -0
  78. sage/libs/singular/ring.cpython-314-x86_64-linux-musl.so +0 -0
  79. sage/libs/singular/ring.pxd +58 -0
  80. sage/libs/singular/ring.pyx +893 -0
  81. sage/libs/singular/singular.cpython-314-x86_64-linux-musl.so +0 -0
  82. sage/libs/singular/singular.pxd +72 -0
  83. sage/libs/singular/singular.pyx +1944 -0
  84. sage/libs/singular/standard_options.py +145 -0
  85. sage/matrix/all__sagemath_singular.py +1 -0
  86. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-musl.so +0 -0
  87. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  88. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  89. sage/rings/all__sagemath_singular.py +1 -0
  90. sage/rings/function_field/all__sagemath_singular.py +1 -0
  91. sage/rings/function_field/derivations_polymod.py +911 -0
  92. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-musl.so +0 -0
  93. sage/rings/function_field/element_polymod.pyx +406 -0
  94. sage/rings/function_field/function_field_polymod.py +2611 -0
  95. sage/rings/function_field/ideal_polymod.py +1775 -0
  96. sage/rings/function_field/order_polymod.py +1475 -0
  97. sage/rings/function_field/place_polymod.py +681 -0
  98. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
  100. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  101. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
  103. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  104. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  105. sage/rings/polynomial/plural.cpython-314-x86_64-linux-musl.so +0 -0
  106. sage/rings/polynomial/plural.pxd +48 -0
  107. sage/rings/polynomial/plural.pyx +3171 -0
  108. sage/symbolic/all__sagemath_singular.py +1 -0
  109. sage/symbolic/comparison_impl.pxi +428 -0
  110. sage/symbolic/constants_c_impl.pxi +178 -0
  111. sage/symbolic/expression.cpython-314-x86_64-linux-musl.so +0 -0
  112. sage/symbolic/expression.pxd +7 -0
  113. sage/symbolic/expression.pyx +14200 -0
  114. sage/symbolic/getitem_impl.pxi +202 -0
  115. sage/symbolic/pynac.pxi +572 -0
  116. sage/symbolic/pynac_constant_impl.pxi +133 -0
  117. sage/symbolic/pynac_function_impl.pxi +206 -0
  118. sage/symbolic/pynac_impl.pxi +2576 -0
  119. sage/symbolic/pynac_wrap.h +124 -0
  120. sage/symbolic/series_impl.pxi +272 -0
  121. sage/symbolic/substitution_map_impl.pxi +94 -0
  122. sage_wheels/bin/ESingular +0 -0
  123. sage_wheels/bin/Singular +0 -0
  124. sage_wheels/bin/TSingular +0 -0
  125. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  126. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  127. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  128. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  129. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  130. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  131. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  132. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  133. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  134. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  135. sage_wheels/lib/singular/MOD/interval.la +41 -0
  136. sage_wheels/lib/singular/MOD/interval.so +0 -0
  137. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  138. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  139. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  140. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  147. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  148. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  149. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  150. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  151. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  152. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  153. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  154. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  155. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  156. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  157. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  158. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  159. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  160. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  161. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  162. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  163. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  165. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  166. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  167. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  168. sage_wheels/libexec/singular/MOD/surfex +16 -0
  169. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  170. sage_wheels/share/factory/gftables/10201 +342 -0
  171. sage_wheels/share/factory/gftables/1024 +37 -0
  172. sage_wheels/share/factory/gftables/10609 +356 -0
  173. sage_wheels/share/factory/gftables/11449 +384 -0
  174. sage_wheels/share/factory/gftables/11881 +398 -0
  175. sage_wheels/share/factory/gftables/121 +6 -0
  176. sage_wheels/share/factory/gftables/12167 +408 -0
  177. sage_wheels/share/factory/gftables/125 +7 -0
  178. sage_wheels/share/factory/gftables/12769 +428 -0
  179. sage_wheels/share/factory/gftables/128 +7 -0
  180. sage_wheels/share/factory/gftables/1331 +47 -0
  181. sage_wheels/share/factory/gftables/1369 +48 -0
  182. sage_wheels/share/factory/gftables/14641 +490 -0
  183. sage_wheels/share/factory/gftables/15625 +523 -0
  184. sage_wheels/share/factory/gftables/16 +3 -0
  185. sage_wheels/share/factory/gftables/16129 +540 -0
  186. sage_wheels/share/factory/gftables/16384 +549 -0
  187. sage_wheels/share/factory/gftables/16807 +563 -0
  188. sage_wheels/share/factory/gftables/1681 +58 -0
  189. sage_wheels/share/factory/gftables/169 +8 -0
  190. sage_wheels/share/factory/gftables/17161 +574 -0
  191. sage_wheels/share/factory/gftables/1849 +64 -0
  192. sage_wheels/share/factory/gftables/18769 +628 -0
  193. sage_wheels/share/factory/gftables/19321 +646 -0
  194. sage_wheels/share/factory/gftables/19683 +659 -0
  195. sage_wheels/share/factory/gftables/2048 +71 -0
  196. sage_wheels/share/factory/gftables/2187 +75 -0
  197. sage_wheels/share/factory/gftables/2197 +76 -0
  198. sage_wheels/share/factory/gftables/2209 +76 -0
  199. sage_wheels/share/factory/gftables/22201 +742 -0
  200. sage_wheels/share/factory/gftables/22801 +762 -0
  201. sage_wheels/share/factory/gftables/2401 +82 -0
  202. sage_wheels/share/factory/gftables/243 +11 -0
  203. sage_wheels/share/factory/gftables/24389 +815 -0
  204. sage_wheels/share/factory/gftables/24649 +824 -0
  205. sage_wheels/share/factory/gftables/25 +3 -0
  206. sage_wheels/share/factory/gftables/256 +11 -0
  207. sage_wheels/share/factory/gftables/26569 +888 -0
  208. sage_wheels/share/factory/gftables/27 +3 -0
  209. sage_wheels/share/factory/gftables/27889 +932 -0
  210. sage_wheels/share/factory/gftables/2809 +96 -0
  211. sage_wheels/share/factory/gftables/28561 +954 -0
  212. sage_wheels/share/factory/gftables/289 +12 -0
  213. sage_wheels/share/factory/gftables/29791 +995 -0
  214. sage_wheels/share/factory/gftables/29929 +1000 -0
  215. sage_wheels/share/factory/gftables/3125 +107 -0
  216. sage_wheels/share/factory/gftables/32 +4 -0
  217. sage_wheels/share/factory/gftables/32041 +1070 -0
  218. sage_wheels/share/factory/gftables/32761 +1094 -0
  219. sage_wheels/share/factory/gftables/32768 +1095 -0
  220. sage_wheels/share/factory/gftables/343 +14 -0
  221. sage_wheels/share/factory/gftables/3481 +118 -0
  222. sage_wheels/share/factory/gftables/361 +14 -0
  223. sage_wheels/share/factory/gftables/36481 +1218 -0
  224. sage_wheels/share/factory/gftables/3721 +126 -0
  225. sage_wheels/share/factory/gftables/37249 +1244 -0
  226. sage_wheels/share/factory/gftables/38809 +1296 -0
  227. sage_wheels/share/factory/gftables/39601 +1322 -0
  228. sage_wheels/share/factory/gftables/4 +3 -0
  229. sage_wheels/share/factory/gftables/4096 +139 -0
  230. sage_wheels/share/factory/gftables/44521 +1486 -0
  231. sage_wheels/share/factory/gftables/4489 +152 -0
  232. sage_wheels/share/factory/gftables/49 +4 -0
  233. sage_wheels/share/factory/gftables/4913 +166 -0
  234. sage_wheels/share/factory/gftables/49729 +1660 -0
  235. sage_wheels/share/factory/gftables/5041 +170 -0
  236. sage_wheels/share/factory/gftables/50653 +1691 -0
  237. sage_wheels/share/factory/gftables/512 +20 -0
  238. sage_wheels/share/factory/gftables/51529 +1720 -0
  239. sage_wheels/share/factory/gftables/52441 +1750 -0
  240. sage_wheels/share/factory/gftables/529 +20 -0
  241. sage_wheels/share/factory/gftables/5329 +180 -0
  242. sage_wheels/share/factory/gftables/54289 +1812 -0
  243. sage_wheels/share/factory/gftables/57121 +1906 -0
  244. sage_wheels/share/factory/gftables/58081 +1938 -0
  245. sage_wheels/share/factory/gftables/59049 +1971 -0
  246. sage_wheels/share/factory/gftables/6241 +210 -0
  247. sage_wheels/share/factory/gftables/625 +23 -0
  248. sage_wheels/share/factory/gftables/63001 +2102 -0
  249. sage_wheels/share/factory/gftables/64 +5 -0
  250. sage_wheels/share/factory/gftables/6561 +221 -0
  251. sage_wheels/share/factory/gftables/6859 +231 -0
  252. sage_wheels/share/factory/gftables/6889 +232 -0
  253. sage_wheels/share/factory/gftables/729 +27 -0
  254. sage_wheels/share/factory/gftables/7921 +266 -0
  255. sage_wheels/share/factory/gftables/8 +3 -0
  256. sage_wheels/share/factory/gftables/81 +5 -0
  257. sage_wheels/share/factory/gftables/8192 +276 -0
  258. sage_wheels/share/factory/gftables/841 +30 -0
  259. sage_wheels/share/factory/gftables/9 +3 -0
  260. sage_wheels/share/factory/gftables/9409 +316 -0
  261. sage_wheels/share/factory/gftables/961 +34 -0
  262. sage_wheels/share/info/singular.info +191898 -0
  263. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  264. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  265. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  266. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  267. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  268. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  269. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  270. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  271. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  272. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  273. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  274. sage_wheels/share/singular/LIB/all.lib +136 -0
  275. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  276. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  277. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  278. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  279. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  280. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  281. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  282. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  283. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  284. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  285. sage_wheels/share/singular/LIB/central.lib +2169 -0
  286. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  287. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  288. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  289. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  290. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  291. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  292. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  293. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  294. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  295. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  296. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  297. sage_wheels/share/singular/LIB/control.lib +1636 -0
  298. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  299. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  300. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  301. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  302. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  303. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  304. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  305. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  306. sage_wheels/share/singular/LIB/deform.lib +925 -0
  307. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  308. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  309. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  310. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  311. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  312. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  313. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  314. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  315. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  316. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  317. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  318. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  319. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  320. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  321. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  322. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  323. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  324. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  325. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  326. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  327. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  328. sage_wheels/share/singular/LIB/general.lib +1350 -0
  329. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  330. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  331. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  332. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  333. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  334. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  335. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  336. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  337. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  338. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  339. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  340. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  341. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  342. sage_wheels/share/singular/LIB/help.cnf +57 -0
  343. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  344. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  345. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  346. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  347. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  348. sage_wheels/share/singular/LIB/inout.lib +679 -0
  349. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  350. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  351. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  352. sage_wheels/share/singular/LIB/invar.lib +443 -0
  353. sage_wheels/share/singular/LIB/involut.lib +980 -0
  354. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  355. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  356. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  357. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  358. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  359. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  360. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  361. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  362. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  363. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  364. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  365. sage_wheels/share/singular/LIB/methods.lib +212 -0
  366. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  367. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  368. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  369. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  370. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  371. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  372. sage_wheels/share/singular/LIB/modular.lib +545 -0
  373. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  374. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  375. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  376. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  377. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  378. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  379. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  380. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  381. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  382. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  383. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  384. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  385. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  386. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  387. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  388. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  389. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  390. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  391. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  392. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  393. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  394. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  395. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  396. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  397. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  398. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  399. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  400. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  401. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  402. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  403. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  404. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  405. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  406. sage_wheels/share/singular/LIB/perron.lib +202 -0
  407. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  408. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  409. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  410. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  411. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  412. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  413. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  414. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  415. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  416. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  417. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  418. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  419. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  420. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  421. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  422. sage_wheels/share/singular/LIB/random.lib +455 -0
  423. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  424. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  425. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  426. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  427. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  428. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  429. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  430. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  431. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  432. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  433. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  434. sage_wheels/share/singular/LIB/resources.lib +170 -0
  435. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  436. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  437. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  438. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  439. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  440. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  441. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  442. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  443. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  444. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  445. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  446. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  447. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  448. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  449. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  450. sage_wheels/share/singular/LIB/sets.lib +524 -0
  451. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  452. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  453. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  454. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  455. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  456. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  457. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  458. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  459. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  460. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  461. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  462. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  463. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  464. sage_wheels/share/singular/LIB/surf.lib +506 -0
  465. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  466. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  467. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  468. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  469. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  470. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  471. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  472. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  473. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  474. sage_wheels/share/singular/LIB/template.lib +116 -0
  475. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  476. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  477. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  478. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  479. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  480. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  481. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  482. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  483. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  484. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  485. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  486. sage_wheels/share/singular/emacs/COPYING +44 -0
  487. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  488. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  489. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  490. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  491. sage_wheels/share/singular/emacs/singular.el +4273 -0
  492. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  493. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1498 @@
1
+ //// Singular library normaliz.lib
2
+ version="version sagbiNormaliz0.lib 4.4.0.6 Okt_2024 "; // $Id: 3869429f7084a99eb59cbab8c647b39c5a38bb2f $
3
+ category="Commutative Algebra";
4
+ info="
5
+ LIBRARY: sagbiNormaliz0.lib Provides an interface for the computation of Sagbi bases.
6
+ It uses normaliz (version 3.10.1 or higher) for combinatorial computations.
7
+
8
+ AUTHORS: Winfried Bruns, wbruns@uos.de
9
+
10
+ OVERVIEW:
11
+
12
+ The library sagbiNormaliz.lib provides functions for the computations of Sagbi bases of
13
+ subalgebras A of polynomial rings over a field. It is based on normaliz.lib. Its
14
+ functions compute Sagbi bases with or without the control by Hilbert functions and/or
15
+ degrees. Hilbert functions and degrees require that bthe ambient polynomial ring is
16
+ standard graded. (An extension to general positive gradings would not be difficult.)
17
+
18
+ In addition to the Sagbi bases it can compute a defining ideal for the algebra A with
19
+ respect to the given system of generators. (The computation of defining ideals cannot be
20
+ controlled by Hilbert series.)
21
+
22
+ Use of this library requires the program Normaliz to be installed and the
23
+ availability of normaliz.lib. You can download both from
24
+ @uref{https://github.com/Normaliz/Normaliz/releases}.
25
+ Please make sure that the executable is in the search path or use setNmzExecPath (defined
26
+ in normaliz.lib).
27
+
28
+ The computations of this library require reading Normaliz output files and therefore a file name
29
+ must be set. The standard file name chosen by the library is NmzSagbiExchange in the current
30
+ directory. The user can change the name.
31
+
32
+ KEYWORDS: Sagbi basis, initial algebra, defining ideal.
33
+
34
+ PROCEDURES:
35
+ sagbiGeneral(ideal Q [, int sagbiMaxRounds, int sorting, int verb]) computes the Sagbi basis of the subalgebra of
36
+ the current polynomial ring that is generated by the elements of Q. The computation is stopped after at most sagbiMaxRounds rounds if trhe parameter is set. If sorting is set, the computed elements are degrevlex sorted before a round of the algorithm.
37
+ The optional parameter verb sets the terminal output. Default is 1 = on..
38
+
39
+ sagbiByDegree(ideal Q, int Sagbi_degree_bound,[,int sorting, int verb]) computes the Sagbi basis degree by degree
40
+ until thwe degree bound is reached or the Sagbi basis has been computed compltely.
41
+
42
+ sagbiHilbControlled(ideal Q, intvec HS_num_algebra, intvec HS_denom_algebra, int Sagbi_degree_bound[, int finalCheck, int sorting, int verb])
43
+ computes the Sagbi basis up to the degree bound. The Hilbert series of the subalgebra
44
+ generated by the elements of Q is given by its numerator and denominator as a rational
45
+ function. HS_denom_algebra lists the exponents g_i in the factors 1 -t^g_i of the denominator.
46
+ If the degree bound is reached and the optional argument inalCheck is set, the Hilbert series
47
+ is checked again for completion.
48
+
49
+ sagbiDefIdealGeneral(ideal Q [, int sagbiMaxRounds, int sorting, int verb]) does the same as sagbiGeneral, but additionally
50
+ computes as much of a system of generators of the defining idael as it can get before being stopped.
51
+
52
+ sagbiDefIdealByDegree(ideal Q, int Sagbi_degree_bound,[,int sorting, int verb]) does the same as sagbiByDegree,
53
+ but additionally computes the defining ideal up to the degree set by Sagbi_degree_bound.
54
+
55
+
56
+ ";
57
+ LIB "general.lib";
58
+
59
+
60
+ // ------------------------------------------------
61
+ // Helpers for ideal management
62
+ // -----------------------------------------------
63
+
64
+ static proc leadcoafIdeal(ideal Q){
65
+ ideal LC;
66
+ for(int i = 1; i <= ncols(Q); i++){
67
+ if(i == 1){
68
+ LC[1] = leadcoef(Q[1]);
69
+ }
70
+ else{
71
+ LC = LC, leadcoef(Q[i]);
72
+ }
73
+ }
74
+ return(LC);
75
+ }
76
+
77
+ static proc degIdeal(ideal Q){
78
+ int p = ncols(Q);
79
+ intvec D = 1..p; // to give it size p
80
+ for(int i = 1; i <= p; i++){
81
+ D[i] = deg(Q[i]); // no GradingDenom: only interested in <0, 0 , >0
82
+ }
83
+ return(D);
84
+ }
85
+
86
+ static proc checkPposDegree(ideal Q){
87
+ for(int i = 1; i <= ncols(Q); i++){
88
+ if(deg(Q[i]) <= 0){
89
+ ERROR("Polynomials in input must have positive degree");
90
+ }
91
+ }
92
+ }
93
+
94
+
95
+ static proc aapplyLaedIdeal(ideal LC){
96
+
97
+ for(int i = 1; i <= ncols(LC); i++){
98
+ if(LC[i] == 0){
99
+ @DefIdeal = @DefIdeal, @PreIm[i];
100
+ @PreIm[i] = 0;
101
+ }
102
+ else{
103
+ @PreIm[i] = @PreIm[i]/LC[i];
104
+ }
105
+ }
106
+ @DefIdeal = simplify(@DefIdeal, 3);
107
+ @PreIm = simplify(@PreIm, 2);
108
+ }
109
+
110
+
111
+ static proc checkDefIdeal(ideal Q){
112
+ map h = @S, Q;
113
+ ideal test_def_Id = h(@DefIdeal);
114
+ test_def_Id = simplify(test_def_Id,2);
115
+ if(size(test_def_Id) != 0){
116
+ ERROR("Defining ideal doesn't map to 0. Inform the authors!");
117
+ }
118
+ }
119
+
120
+ static proc removeConstants(ideal Q){
121
+ for(int i = 1; i<=ncols(Q); i++){
122
+ if(deg(Q[i]) == 0){
123
+ Q[i] = 0;
124
+ }
125
+ }
126
+ Q = simplify(Q, 2);
127
+ return(Q);
128
+ }
129
+
130
+ static proc preparePreIm(intvec D, ideal LC){
131
+
132
+ for(int i = 1; i <= size(D); i++){
133
+ if(D[i] <= 0){ // constant
134
+ @DefIdeal = @DefIdeal, @PreIm[i] - LC[i];
135
+ @PreIm[i] = 0;
136
+ }
137
+ else{
138
+ @PreIm[i] = @PreIm[i]/LC[i];
139
+ }
140
+ }
141
+ @PreIm = simplify(@PreIm, 2);
142
+ }
143
+
144
+ // ------------------------------------------------
145
+ // Helpers related to grading
146
+ // -----------------------------------------------
147
+
148
+
149
+ static proc gradingDenominator(ideal P){
150
+ int GradingDenom = deg(P[1]);
151
+ for(int i = 2; i <= size(P); i++){
152
+ GradingDenom = gcd(GradingDenom, deg(P[i]));
153
+ }
154
+ return(GradingDenom);
155
+ }
156
+
157
+ static proc gradVector(ideal Q, int GradingDenom){
158
+ intvec SGrad;
159
+ SGrad = deg(Q[1]) div GradingDenom;
160
+ for(int i = 2; i <= size(Q); i++){
161
+ SGrad = SGrad, deg(Q[i]) div GradingDenom;
162
+ }
163
+ return(SGrad);
164
+ }
165
+
166
+ static proc scalarProduct(intvec u, intvec v){
167
+ int p = 0;
168
+ for(int i = 1; i <= size(u); i++){
169
+ p = p + u[i]*v[i];
170
+ }
171
+ return(p);
172
+ }
173
+
174
+ static proc posScalarProductMat(intmat U, int row, intvec v){
175
+ int p = 0;
176
+ for(int i = 1; i <= ncols(U); i++){
177
+ if(U[row,i] > 0){
178
+ p = p + U[row,i]*v[i];
179
+ }
180
+ }
181
+ return(p);
182
+ }
183
+
184
+ static proc selectNextDegree(intmat saveTete_a_tete, int startTete_tete, intvec SGrad){
185
+
186
+ for(int k = 1; k <= nrows(saveTete_a_tete); k++){
187
+ // posScalarProductMat(saveTete_a_tete, k, SGrad);
188
+ }
189
+
190
+ int endTete_atete = nrows(saveTete_a_tete);
191
+ if(startTete_tete > nrows(saveTete_a_tete))
192
+ {
193
+ intmat empty[0][ncols(saveTete_a_tete)];
194
+ return (empty, startTete_tete);
195
+ }
196
+
197
+ int startDeg = posScalarProductMat(saveTete_a_tete, startTete_tete, SGrad);
198
+ int i,j;
199
+
200
+ for(i = startTete_tete; i <= nrows(saveTete_a_tete); i++){
201
+ if(posScalarProductMat(saveTete_a_tete, i, SGrad) > startDeg)
202
+ {
203
+ endTete_atete = i -1;
204
+ break;
205
+ }
206
+ }
207
+ intmat selection[endTete_atete - startTete_tete +1][ncols(saveTete_a_tete)];
208
+ for(i = startTete_tete; i <= endTete_atete; i++){
209
+ for(j = 1; j <= ncols(saveTete_a_tete); j++){
210
+ selection[i - startTete_tete +1, j] = saveTete_a_tete[i, j];
211
+ }
212
+ }
213
+ return(selection, endTete_atete + 1);
214
+ }
215
+
216
+ static proc selectionByDegree(ideal P, intvec grading, int our_deg){
217
+ ideal Q;
218
+ for(int i = 1; i <= size(P); i++){
219
+ if(scalarProduct(leadexp(P[i]), grading) == our_deg){
220
+ Q = Q + P[i];
221
+ }
222
+ }
223
+ return(Q);
224
+ }
225
+
226
+ // ------------------------------------------------
227
+ // Helpers for Hilbert series
228
+ // -----------------------------------------------
229
+
230
+
231
+ static proc polyProd(intvec F, bigintmat G, int max_degree){
232
+ // F and G represent polynomials in one variable
233
+ // We compute their product up to maxdegree
234
+ int deg_F = size(F) - 1;
235
+ int deg_G = ncols(G) - 1;
236
+ int deg_prod = deg_F + deg_G;
237
+ int eff_deg = max_degree;
238
+ if(eff_deg > deg_prod || eff_deg == -1){
239
+ eff_deg = deg_prod;
240
+ }
241
+ bigintmat Prod[1][eff_deg +1];
242
+ int d, j;
243
+ bigint S;
244
+ for(d = 0; d <= eff_deg; d++){
245
+ S = 0;
246
+ for(j = 0; j <= d; j++){
247
+ if(j <= deg_F && d - j <= deg_G){
248
+ S = S + F[j + 1]*G[1, d - j +1];
249
+ }
250
+ }
251
+ Prod[1,d + 1] = S;
252
+ }
253
+ return(Prod);
254
+ }
255
+
256
+ static proc cycloRatFunctionExpansion(intvec num_vec, intvec den_vec, int exp_degree){
257
+ // Computes the expansion of a rational function with numerator represented by num_vec
258
+ // and denominator a product of terms 1 - t^g_i where zjhe g_i are the entries of den_vec
259
+ bigintmat E[1][exp_degree + 1];
260
+ int to_copy = size(num_vec);
261
+ if(to_copy > exp_degree + 1){
262
+ to_copy = exp_degree + 1;
263
+ }
264
+ int i, j, k;
265
+ for(i = 1; i <= to_copy; i++){
266
+ E[1, i] = num_vec[i];
267
+ }
268
+ intvec fac;
269
+ for(i = 1; i <= exp_degree; i++){
270
+ fac = fac, 0;
271
+ }
272
+ for( k = 1; k<= size(den_vec); k++){
273
+ for(i = 1; i <= size(fac); i++){
274
+ fac[i] = 0;
275
+ }
276
+ for(i = 0; i * den_vec[k] <= exp_degree; i++){
277
+ fac[1 + i * den_vec[k] ] = 1;
278
+ }
279
+ E = polyProd(fac, E, exp_degree);
280
+ }
281
+ return(E);
282
+ }
283
+
284
+ static proc intvec2poly(intvec vec){
285
+ poly f = 0;
286
+ poly t = var(1);
287
+ for(int i = 1; i <= size(vec); i++){
288
+ f = f + vec[i]*t^(i-1);
289
+ }
290
+ return(f);
291
+ }
292
+
293
+ static proc expandDenom(intvec den){
294
+ poly g = 1;
295
+ poly t = var(1);
296
+ for(int i = 1; i <= size(den); i++){
297
+ g = g*(1-t^den[i]);
298
+ }
299
+ return(g);
300
+ }
301
+
302
+ static proc unifiedRepresentations(intvec num_vec_1, intvec den_vec_1, intvec num_vec_2, intvec den_vec_2){
303
+
304
+ ring T = 0,t,dp;
305
+ poly num_1, den_1, num_2, den_2;
306
+ num_1 = intvec2poly(num_vec_1);
307
+ num_2 = intvec2poly(num_vec_2);
308
+ den_1 = expandDenom(den_vec_1);
309
+ den_2 = expandDenom(den_vec_2);
310
+ if(num_1*den_2 == num_2*den_1){
311
+ return(1);
312
+ }
313
+ return(0);
314
+ }
315
+
316
+ static proc compareCCycloRatFunctions(intvec num_vec_1, intvec den_vec_1, num_vec_2, den_vec_2){
317
+ // Compares the expansions of rational functions as in cycloRatFunctionExpansion
318
+ // It must be made sure that the rational functions agree if and only they agree in
319
+ // numerator and denominator
320
+
321
+ if(num_vec_1 == num_vec_2 && den_vec_1 == den_vec_2){
322
+ return(-1,0);
323
+ }
324
+ if(unifiedRepresentations(num_vec_1, den_vec_1, num_vec_2, den_vec_2) ){
325
+ return(-1,0);
326
+ }
327
+
328
+ int expansion_deg = size(num_vec_1);
329
+ bigintmat expansion_1, expansion_2;
330
+ int u;
331
+ while(1)
332
+ {
333
+ expansion_1 = cycloRatFunctionExpansion(num_vec_1, den_vec_1, expansion_deg);
334
+ expansion_2 = cycloRatFunctionExpansion(num_vec_2, den_vec_2, expansion_deg);
335
+ if(expansion_1 == expansion_2){
336
+ expansion_deg = 2*expansion_deg;
337
+ continue;
338
+ }
339
+ for(u = 1; u <= expansion_deg+1; u++){
340
+ if(expansion_1[1, u] != expansion_2[1, u]){
341
+ return(u -1, expansion_1[1, u] - expansion_2[1, u])
342
+ }
343
+ }
344
+ }
345
+ }
346
+
347
+ // ------------------------------------------------
348
+ // Computation of Hilbert series
349
+ // -----------------------------------------------
350
+
351
+ // The return value is_normal registers whether monoid is normal
352
+ // in the nonnormal case the Markov basis is kept
353
+ // for use in tete-a-tete
354
+ static proc HilbertSeriesMonoid(intmat U, int min_degree){
355
+ // min_degree for output of Markovbasis
356
+ intmat V;
357
+ int swallow = setNmzOption("intclosed",1);
358
+ V = normaliz(U, "monoid");
359
+ exportNuminvs();
360
+ // showNuminvs();
361
+ swallow = setNmzOption("intclosed",0);
362
+ int is_normal = nmz_integrally_closed;
363
+ if(!is_normal){
364
+ dbprint(our_printlevel,"Not normal");
365
+ swallow = setNmzOption("MRK",1);
366
+ }
367
+ swallow = setNmzOption("only_hvect",1);
368
+ V = normaliz(U, "monoid", min_degree, "gb_min_degree");
369
+ swallow = setNmzOption("only_hvect",0);
370
+ swallow = setNmzOption("MRK",0);
371
+ exportNuminvs();
372
+ return(nmz_hilbert_series_num, nmz_hilbert_series_denom, is_normal);
373
+ }
374
+
375
+ static proc HilbertSeriesMonAlgebra(ideal P, int min_degree)
376
+ {
377
+ intmat U = mons2intmat(P);
378
+ return (HilbertSeriesMonoid(U, min_degree));
379
+ }
380
+
381
+ // ------------------------------------------------
382
+ // Computation of Hilbert bases
383
+ // -----------------------------------------------
384
+
385
+ static proc HilbertBasisMonoid(intmat U){
386
+ intmat V;
387
+ int swallow = setNmzOption("hilbbas",1);
388
+ V = normaliz(U, "monoid");
389
+ swallow = setNmzOption("hilbbas",0);
390
+ return(V);
391
+ }
392
+
393
+ static proc HilbertBasisMonAlgebra(ideal P){
394
+ intmat U = mons2intmat(P);
395
+ return (intmat2mons(HilbertBasisMonoid(U)));
396
+ }
397
+
398
+ // ------------------------------------------------
399
+ // Subduction
400
+ // -----------------------------------------------
401
+
402
+ static proc Subduction(ideal Pgiven, bigint nr_generators_needed){
403
+ // nr_generators = -1: complete subduction
404
+ // szbduction in the sense of Robbiano-Sweedler.
405
+ // It is applied once to every polynomial whose
406
+ // initial is not in the minimal system of generators of the algebra
407
+ // generated by the initial monomials
408
+ ideal P = Pgiven;
409
+ intvec test_num, test_den;
410
+ int i,j;
411
+ int swallow = setNmzOption("REP",1);
412
+ intmat U = mons2intmat(P);
413
+ intmat V = normaliz(U, "monoid"); // V only to swallow return value
414
+ V = readNmzData("rep");
415
+ swallow = setNmzOption("REP",0);
416
+ exportNuminvs();
417
+
418
+ bigint nr_generators = bigint(size(P) - nrows(V));
419
+ string output = "polynomials " + string(size(P)) + " minimal so far " + string( nr_generators);
420
+ dbprint(our_printlevel,output);
421
+
422
+ if(nr_generators_needed != -1 && nr_generators_needed == nr_generators){
423
+ return(P, 0, nmz_hilbert_basis_key); // important here: no change in P anymore
424
+ } // can use nmz_hilbert_basis_key
425
+ if(nr_generators_needed == -1 && size(P) == nmz_hilbert_basis_elements){
426
+ return(P, 0, nmz_hilbert_basis_key);
427
+ }
428
+ if(nr_generators_needed != -1 && size(P) == nmz_hilbert_basis_elements){
429
+ ERROR("Error in Subduction. Inform the authors!");
430
+ }
431
+ // relative to Pgiven
432
+ def our_ring = basering;
433
+ int p = size(P);
434
+ list baseringlist = ringlist(basering);
435
+ ring S = (baseringlist[1]),(y(1.. p)),dp;
436
+ ideal Bl = intmat2binomials(V);
437
+ setring our_ring;
438
+ map f = S, P;
439
+ ideal P_modify = f(Bl);
440
+ for(i = 1; i <= nrows(V); i++){
441
+ for(j= 1; j <= ncols(V); j++){
442
+ if(V[i,j] == 1){
443
+ break;
444
+ }
445
+ }
446
+ P[j] = P_modify[i];
447
+ }
448
+ ideal LC = leadcoafIdeal(P);
449
+ intvec D = degIdeal(P);
450
+ our_ring = basering;
451
+ setring our_ring;
452
+ P = removeConstants(P);
453
+ P = simplify(P,1); // nakes monic
454
+ int check = ncols(P);
455
+
456
+ if(@do_def_ideal){
457
+ setring @S;
458
+ map g = S,@PreIm;
459
+ ideal Pre_modify = g(Bl);
460
+ ideal LCC = fetch(our_ring, LC);
461
+ for(i = 1; i <= nrows(V); i++){
462
+ for(j= 1; j <= ncols(V); j++){
463
+ if(V[i,j] == 1){
464
+ break;
465
+ }
466
+ }
467
+ @PreIm[j] = Pre_modify[i];
468
+ if(D[j] <= 0){
469
+ @DefIdeal = @DefIdeal, @PreIm[j] - LCC[j];
470
+ @PreIm[j] = 0;
471
+ }
472
+ else{
473
+ @PreIm[j] = @PreIm[j]/LCC[j];
474
+ }
475
+ }
476
+ @PreIm = simplify(@PreIm, 2); // removes 0, DON'T MAKE MONIC
477
+ if(check != ncols(@PreIm)){
478
+ "P ncols", check, " PreIm ncols ", ncols(@PreIm);
479
+ ERROR("Preimage doesn' fit. Inform the authors!");
480
+ }
481
+ }
482
+
483
+ setring our_ring;
484
+ return(P,1, nmz_hilbert_basis_key);
485
+ }
486
+
487
+ static proc HilbbasSubduction(ideal P, int old_nr_hilbbas, bigint HF_difference){
488
+ // Applies subduction as many times as necessary to frill HF_difference
489
+ ideal Q = simplify(P, 3);
490
+ int change;
491
+ intvec HilbertBasisKey;
492
+
493
+ bigint nr_generators_needed = bigint(old_nr_hilbbas) + HF_difference;
494
+ string output = "Have " + string( old_nr_hilbbas) + " need " + string(nr_generators_needed);
495
+ dbprint(our_printlevel,output);
496
+
497
+ while(1){
498
+ (Q, change, HilbertBasisKey) = Subduction(Q, nr_generators_needed);
499
+ if(change == 0){
500
+ list L = sort(HilbertBasisKey);
501
+ HilbertBasisKey = L[1];
502
+ return(Q, HilbertBasisKey); // HilbertBasisKey only used in this case
503
+ }
504
+ }
505
+ }
506
+
507
+ static proc completeSubduction(ideal Q){
508
+ // applies subduction repeatedly until statbility is reached.
509
+ int change;
510
+ intvec HilbertBasisKey; // for syntactical reasons
511
+
512
+ string output = "complete subduction applied to size "+ string(size(Q));
513
+ dbprint(our_printlevel,output);
514
+ while(1){
515
+ (Q, change,HilbertBasisKey) = Subduction(Q, -1);
516
+ if(change == 0){
517
+ output = "subduced size " + string(size(Q));
518
+ dbprint(our_printlevel,output);
519
+ def our_ring = basering;
520
+ if(@do_def_ideal){
521
+ setring @S;
522
+ "Size defining ideal so far (not minimized)", size(@DefIdeal);
523
+ setring our_ring;
524
+ }
525
+ return(Q);
526
+ }
527
+ }
528
+ }
529
+
530
+ // ------------------------------------------------
531
+ // Tete-a-tete
532
+ // -----------------------------------------------
533
+
534
+ static proc Tete_A_TeteHilbControlled(ideal P, int crit_degree, int is_normal)
535
+ // Computes the terte-a-ztete of a system of polynomials (termonology of
536
+ // Robbiano-Sweedler). Control by Hilbert series: only the crit degree is
537
+ // evaluated and normalioty is exploited. Genereal version below.
538
+ {
539
+ dbprint(our_printlevel,"Start Tete-a-tete ");
540
+ string output;
541
+
542
+ // system("--ticks-per-sec",1000);
543
+ // timer=0;
544
+ // int t = timer;
545
+
546
+ int i;
547
+ ideal Q = P;
548
+ Q = simplify(Q,3);
549
+
550
+ // First we reconstruct the grading of the binomials
551
+ // Only needed in the nonnormal case
552
+ int GradingDenom = gradingDenominator(Q);
553
+ intvec SGrad = gradVector(Q, GradingDenom);
554
+ intmat U = mons2intmat(Q);
555
+
556
+ def our_ring = basering;
557
+ int p = size(Q);
558
+ list baseringlist = ringlist(basering);
559
+ ring S = (baseringlist[1]),(y(1..p)), dp;
560
+ // U;
561
+ intmat V;
562
+ ideal B, Bfull;
563
+ if(is_normal){ // in the normal case we don't have the Markov basis yet
564
+ int swallow = setNmzOption("MRK",1);
565
+ intmat Bl = normaliz(U, "monoid", crit_degree, "gb_min_degree", crit_degree, "gb_degree_bound");
566
+ exportNuminvs();
567
+ swallow = setNmzOption("MRK",0);
568
+ V = readNmzData("mrk");
569
+ dbprint(our_printlevel,"Evaluating tete-a-tete");
570
+ output = "Computing " + string(nrows(V)) + " binomials";
571
+ dbprint(our_printlevel,output);
572
+ B = intmat2binomials(V);
573
+ }
574
+ else{ // we have the full Markov basis already from the Hilbert series computation.
575
+ // However we have the full Markov basis, and not a single degree only.
576
+ // IMPORTANT::: we use the data of the Hilbert series computation
577
+ // in this case.
578
+ //
579
+
580
+ int our_deg, u;
581
+ V = readNmzData("mrk");
582
+ dbprint(our_printlevel,"Evaluating tete-a-tete");
583
+ output = "Selecting from " + string(nrows(V)) + " binomials";
584
+ dbprint(our_printlevel,output);
585
+ Bfull = intmat2binomials(V);
586
+ // "SSSSSSS ", size(leadexp(Bfull[1])), " ", size(SGrad);
587
+ B = selectionByDegree(Bfull, SGrad, crit_degree);
588
+ }
589
+
590
+ B = simplify(B,3);
591
+ dbprint(our_printlevel,"Binomials computed");
592
+
593
+ setring our_ring;
594
+ map f =S, P;
595
+ Q = Q, f(B);
596
+ dbprint(our_printlevel,"Generators extended");
597
+ Q =simplify(Q,3);
598
+ // "Time in milliseconds ", timer-t;
599
+ return(Q);
600
+ }
601
+
602
+ static proc Tete_A_TeteGeneral(ideal P, int current_degree, int Sagbi_degree_bound, int degreeByDegree, int makeNewTete_a_tete)
603
+ {
604
+
605
+ int degree_tete_a_tete = -1;
606
+ string output;
607
+ // "Start Tete-a-tete ";
608
+ // "current_degree ", current_degree;
609
+ // "Sagbi_degree_bound ", Sagbi_degree_bound;
610
+ // "degreeByDegree ", degreeByDegree;
611
+ // "makeNewTete_a_tete ", makeNewTete_a_tete;
612
+ // "startTete_tete", startTete_tete;
613
+ if(makeNewTete_a_tete){
614
+ dbprint(our_printlevel,"Making new tete-a-tete");
615
+ }
616
+ else{
617
+ dbprint(our_printlevel,"Exploiting existing tete-a-tete");
618
+ }
619
+ ideal Q = P;
620
+ intvec SGrad;
621
+ if(degreeByDegree){
622
+ int GradingDenom = gradingDenominator(Q);
623
+ SGrad = gradVector(Q, GradingDenom);
624
+ }
625
+
626
+ intmat U = mons2intmat(Q);
627
+
628
+ def our_ring = basering;
629
+ int p = size(Q);
630
+ list baseringlist = ringlist(basering);
631
+ ring S = (baseringlist[1]),(y(1..p)), dp;
632
+ // U;
633
+ ideal B;
634
+
635
+ int swallow = setNmzOption("MRK",1);
636
+ intmat Dummy;
637
+ if(current_degree != -1){
638
+ if(degreeByDegree == 2){ // no jumping over empty degrees
639
+ Dummy = normaliz(U, "monoid", current_degree, "gb_min_degree", current_degree, "gb_degree_bound");
640
+ exportNuminvs();
641
+ }
642
+ else{
643
+ if(makeNewTete_a_tete){
644
+ // U;
645
+ // "---------------";
646
+ // transpose(U);
647
+ Dummy = normaliz(U, "monoid", current_degree, "gb_min_degree");
648
+ // exportNuminvs();
649
+ // showNuminvs();
650
+ }
651
+ // gb_degree_bound = -2 implies: print component d such that d >= gb_min_degree
652
+ // and component is nonzero
653
+ // Bl = normaliz(U, "monoid", current_degree, "gb_min_degree", -2, "gb_degree_bound");
654
+ }
655
+ }
656
+ else{
657
+ Dummy = normaliz(U, "monoid");
658
+ }
659
+ swallow = setNmzOption("MRK",0);
660
+
661
+ intmat V;
662
+ if(current_degree != -1){
663
+ if(makeNewTete_a_tete){
664
+ saveTete_a_tete = readNmzData("mrk");
665
+ startTete_tete = 1;
666
+ }
667
+ (V, startTete_tete) = selectNextDegree(saveTete_a_tete, startTete_tete, SGrad);
668
+ }
669
+ else{
670
+ V = readNmzData("mrk");
671
+ }
672
+
673
+ int tete_a_tete_empty = 0;
674
+ if(nrows(V) == 0){
675
+ dbprint(our_printlevel,"Tete-a-tete empty");
676
+ tete_a_tete_empty = 1;
677
+ }
678
+ dbprint(our_printlevel,"Evaluating tete-a-tete");
679
+ output = "Computing " + string(nrows(V)) + " binomials";
680
+ dbprint(our_printlevel,output);
681
+ B = intmat2binomials(V);
682
+ dbprint(our_printlevel,"Binomials computed");
683
+ int degree_too_large;
684
+ degree_too_large = 0;
685
+ if(degreeByDegree==1){
686
+ degree_tete_a_tete = scalarProduct(leadexp(B[1]), SGrad);
687
+ if(degree_tete_a_tete > Sagbi_degree_bound)
688
+ {
689
+ degree_too_large = 1;
690
+ }
691
+ }
692
+ if(degreeByDegree==2){
693
+ degree_tete_a_tete = current_degree;
694
+ }
695
+ B = simplify(B,3);
696
+ setring our_ring;
697
+ if(tete_a_tete_empty && degreeByDegree != 2){
698
+ return(Q, -1);
699
+ }
700
+ if(degree_too_large){
701
+ return(Q, degree_tete_a_tete);
702
+ }
703
+ map f =S, Q;
704
+ Q = Q, f(B);
705
+ dbprint(our_printlevel,"Generators extended");
706
+ ideal LC = leadcoafIdeal(Q); // data needed for PreIm
707
+ intvec D = degIdeal(Q);
708
+ Q = removeConstants(Q);
709
+ Q =simplify(Q,1);// makes monic
710
+ int check = ncols(Q);
711
+
712
+ if(@do_def_ideal){
713
+ setring @S;
714
+ map g = S,@PreIm;
715
+ @PreIm = @PreIm, g(B);
716
+ ideal LCC = fetch(our_ring, LC);
717
+ // aapplyLaedIdeal(LCC);
718
+ preparePreIm(D, LCC);
719
+ if(check != ncols(@PreIm)){
720
+ "Q ncols", check, " PreIm ncols ", ncols(@PreIm);
721
+ ERROR("Preimage doesn'tfit. Inform the authors!");
722
+ }
723
+ }
724
+ setring our_ring;
725
+ return(Q, degree_tete_a_tete);
726
+ }
727
+
728
+ // ------------------------------------------------
729
+ // Sagbi computation
730
+ // -----------------------------------------------
731
+
732
+ static proc dosagbiHilbControlled(ideal Q, intvec HS_num_algebra, intvec HS_denom_algebra,
733
+ int Sagbi_degree_bound, int finalCheck, int sorting){
734
+ // The code would allow Sagbi_degree_bound = -, meaning no bound
735
+
736
+ int has_positive_degree = 0;
737
+ for(int i = 1; i <= ncols(Q); i++){
738
+ if(deg(Q[i]) >= 1){
739
+ has_positive_degree = 1;
740
+ break;
741
+ }
742
+ }
743
+ if(!has_positive_degree){
744
+ ERROR("At least one generetor miust have positive degree");
745
+ }
746
+ string output;
747
+
748
+ int crit_degree, nr_hilbbas_1, nr_hilbbas_2;
749
+ bigint HF_difference;
750
+ ideal Plow, Phigh, K, Dummy;
751
+ intvec HS_denom_cand, HS_num_cand;
752
+ int GradingDenom, standard_crit_degree;
753
+ intvec HilbertBasisKey;
754
+
755
+ int @do_def_ideal = 0;
756
+ export(@do_def_ideal);
757
+
758
+ ideal P = simplify(Q,15); // make inititial coeff 1, erase 0, duplicates and scalar multiples
759
+ P = completeSubduction(P);
760
+ dbprint(our_printlevel,"Initial subduction dione");
761
+
762
+ GradingDenom = gradingDenominator(P);
763
+ int round = 0;
764
+ int count;
765
+ intmat U,V;
766
+ int swallow;
767
+ int is_normal;
768
+
769
+ list L;
770
+
771
+ crit_degree = 0;
772
+
773
+
774
+ while(1){
775
+ if(round > 0){
776
+ output = "New Hilbert series " + string(round);
777
+ dbprint(our_printlevel,output);
778
+ }
779
+
780
+ if(sorting){
781
+ L = sort(P,"dp");
782
+ P = L[1];
783
+ }
784
+
785
+ (HS_num_cand, HS_denom_cand, is_normal) = HilbertSeriesMonAlgebra(P, crit_degree+1);
786
+
787
+ (crit_degree, HF_difference) = compareCCycloRatFunctions(HS_num_algebra, HS_denom_algebra,
788
+ HS_num_cand, HS_denom_cand);
789
+
790
+ if(crit_degree > Sagbi_degree_bound && Sagbi_degree_bound != -1){
791
+ output = "critical degree = " + string(crit_degree) + " > Sagbi_degree_bound = " + string(Sagbi_degree_bound);
792
+ dbprint(our_printlevel,"--------------------------------------------------------------");
793
+ return(P,0):
794
+ }
795
+
796
+ if(crit_degree == -1){
797
+ if(round > 0){
798
+ dbprint(our_printlevel,"Sagbi basis computed");
799
+ dbprint(our_printlevel,"--------------------------------------------------------------");
800
+ }
801
+ return(P,2);
802
+ }
803
+ if(round == 0){
804
+ dbprint(our_printlevel,"--------------------------------------------------------------");
805
+ }
806
+ else{
807
+ dbprint(our_printlevel,"*********************");
808
+ }
809
+ round++;
810
+
811
+ // "got Hilbert series ", HS_num_cand, " ", HS_denom_cand;
812
+ if(round == 1){
813
+ output = "expected Hilbert series with representation " + string(HS_num_algebra) + " " + string( HS_denom_algebra);
814
+ dbprint(our_printlevel,output);
815
+ }
816
+ output = "crit_degree " + string(crit_degree) + ": HF_difference " + string( HF_difference);
817
+ dbprint(our_printlevel,output);
818
+
819
+ // we must split our algebra generators at the critical degree
820
+ Plow = 0;
821
+ Phigh = 0;
822
+ standard_crit_degree = crit_degree * GradingDenom;
823
+ for(i = 1; i <=size(P); i++){
824
+ if(deg(P[i]) <= standard_crit_degree){
825
+ Plow = Plow + P[i];
826
+ }
827
+ else{
828
+ Phigh = Phigh + P[i];
829
+ }
830
+ }
831
+ Dummy = HilbertBasisMonAlgebra(Plow);
832
+ nr_hilbbas_1 = size(Dummy);
833
+
834
+ K= Tete_A_TeteHilbControlled(Plow, crit_degree,is_normal);
835
+ dbprint(our_printlevel,"Tete-a-tete done");
836
+ (K, HilbertBasisKey) = HilbbasSubduction(K, nr_hilbbas_1, HF_difference);
837
+ dbprint(our_printlevel,"Subduction done");
838
+
839
+ P = 0;
840
+ for(i = 1; i <= size( HilbertBasisKey); i++){
841
+ P = P + K[ HilbertBasisKey[i]];
842
+ }
843
+
844
+ if(crit_degree >= Sagbi_degree_bound && Sagbi_degree_bound != -1 && !finalCheck){
845
+ output = "Sagbi basis computed up tp degree " + string(Sagbi_degree_bound);
846
+ dbprint(our_printlevel,output);
847
+ dbprint(our_printlevel,"No final check");
848
+ return(P,1);
849
+ }
850
+
851
+ if(size(Phigh) > 0){
852
+ P = P + Phigh;
853
+ P = completeSubduction(P);
854
+ }
855
+ }
856
+ }
857
+ // ---------------------------------------------------------------
858
+
859
+ static proc doSagbiGeneral(ideal Q, int dcefining_ideal, int Sagbi_degree_bound, int Sagbi_max_rounds, int sorting)
860
+ {
861
+ int i;
862
+ int has_positive_degree = 0;
863
+ for(i = 1; i <= ncols(Q); i++){
864
+ if(deg(Q[i]) >= 1){
865
+ has_positive_degree = 1;
866
+ break;
867
+ }
868
+ }
869
+ if(!has_positive_degree){
870
+ ERROR("At least one generetor miust have positive degree");
871
+ }
872
+
873
+
874
+ string output;
875
+
876
+ int degreeByDegree = 0;
877
+ if(Sagbi_degree_bound != -1){
878
+ degreeByDegree = 1;
879
+ }
880
+
881
+ // if(degreeByDegree == 0 && dcefining_ideal == 1){
882
+ // ERROR("Defining ideal only computed gegree by degree");
883
+ // }
884
+
885
+ int @do_def_ideal = dcefining_ideal;
886
+ export(@do_def_ideal);
887
+
888
+ ideal P;
889
+ int GradingDenom;
890
+ intvec D;
891
+
892
+ def our_ring = basering;
893
+
894
+ if(!@do_def_ideal){
895
+ Q = removeConstants(Q); // erases constants including 0
896
+ P = simplify(Q,13); // make inititial coeff 1, remove duplicates and scalar multiples
897
+ }
898
+ else{
899
+ // setup preimages of generators, take care of constants in the generators (not forbidden)
900
+ // constants give elements in the defining ideal
901
+ P = Q;
902
+ ideal LC = leadcoafIdeal(P); // must be done before any change of P
903
+ D = degIdeal(P); // ditto. We need hese data for PreIm
904
+ for(i = 1; i <=size(D); i++){
905
+ if(D[i] <= 0){
906
+ ERROR("constants not allowed in algebra generators");
907
+ }
908
+ }
909
+ // "Degrees ", D, " LC ", LC;
910
+ list baseringlist = ringlist(basering);
911
+ int p = ncols(P);
912
+ P = removeConstants(P); // PreIm will be gtaken care below
913
+ P = simplify(P,1); // make monic
914
+ ring @S = (baseringlist[1]),(y(1.. p)),wp(D);
915
+ ideal @PreIm =(y(1..p));
916
+ ideal @DefIdeal;
917
+ ideal @PreIm_low;
918
+ ideal @PreIm_high;
919
+ export(@S);
920
+ export(@PreIm);
921
+ export(@DefIdeal);
922
+ export(@PreIm_low);
923
+ export(@PreIm_high);
924
+ ideal LCC = fetch(our_ring, LC);
925
+ preparePreIm(D, LCC); // takes care of constants in P, makes moic
926
+ // for(i = 1; i <= ncols(LCC); i++){
927
+ // @PreIm[i] = @PreIm[i]/LCC[i];
928
+ // }
929
+ setring our_ring;
930
+ }
931
+
932
+ GradingDenom = gradingDenominator(P);
933
+
934
+ P = completeSubduction(P);
935
+ dbprint(our_printlevel,"Initial subduction dione");
936
+
937
+ int maxDegreeGens = deg(P[1]);
938
+ int minDegreeGens = maxDegreeGens;
939
+ for(i = 2; i <= size(P); i++){
940
+ if(deg(P[i]) > maxDegreeGens){
941
+ maxDegreeGens = deg(P[i]);
942
+ }
943
+ if(deg(P[i]) < minDegreeGens){
944
+ minDegreeGens = deg(P[i]);
945
+ }
946
+ }
947
+ maxDegreeGens = maxDegreeGens div GradingDenom;
948
+ minDegreeGens = minDegreeGens div GradingDenom;
949
+
950
+
951
+ ideal P_1;
952
+ int done;
953
+ int checked;
954
+ int makeNewTete_a_tete = 1;
955
+ int first_after_maxDegGens = 1;
956
+
957
+ int uu = minDegreeGens;
958
+ int degreeBoundReached;
959
+ list L;
960
+
961
+ int degree_tete_a_tete;
962
+
963
+ ideal Plow, Phigh;
964
+ int round = 1;
965
+ int check_high,check_low;
966
+
967
+ while(1){
968
+ P = simplify(P,3);
969
+ if(sorting){
970
+ L = sort(P, "dp");
971
+ P = L[1];
972
+ }
973
+
974
+ Plow = 0;
975
+ Phigh = 0;
976
+ our_ring = basering;
977
+
978
+ if(@do_def_ideal){
979
+ setring @S;
980
+ @PreIm_high = 0;
981
+ @PreIm_low = 0;
982
+ }
983
+
984
+ setring our_ring;
985
+
986
+ if(!degreeByDegree){
987
+ (P_1, degree_tete_a_tete) = Tete_A_TeteGeneral(P, -1, -1, 0,1);
988
+ P_1 = completeSubduction(P_1);
989
+ }
990
+ else{
991
+ if(uu < maxDegreeGens){
992
+ our_ring = basering;
993
+ D = degIdeal(P);
994
+ for(i = 1; i <=size(P); i++){
995
+ if(D[i] <= uu * GradingDenom){
996
+ Plow = Plow + P[i];
997
+ }
998
+ else{
999
+ Phigh = Phigh + P[i];
1000
+ }
1001
+ }
1002
+ check_low = size(Plow);
1003
+ check_high = size(Phigh);
1004
+ if(@do_def_ideal){
1005
+ setring @S;
1006
+ for(i = 1; i <=size(D); i++){
1007
+ if(D[i] <= uu * GradingDenom){
1008
+ @PreIm_low = @PreIm_low + @PreIm[i];
1009
+ }
1010
+ else{
1011
+ @PreIm_high = @PreIm_high + @PreIm[i];
1012
+ }
1013
+ }
1014
+ if(size(@PreIm_low) != check_low || size(@PreIm_high) != check_high){
1015
+ "Problem ", size(@PreIm_low), check_low, size(@PreIm_high), check_high;
1016
+ }
1017
+ @PreIm = @PreIm_low;
1018
+ }
1019
+ setring our_ring;
1020
+ // 2 = strictly degree by degree
1021
+ (P_1, degree_tete_a_tete) = Tete_A_TeteGeneral(Plow,uu, Sagbi_degree_bound, 2, 1);
1022
+ }
1023
+ else{
1024
+ (P_1, degree_tete_a_tete) = Tete_A_TeteGeneral(P,uu, Sagbi_degree_bound, 1, makeNewTete_a_tete);
1025
+ }
1026
+ if(degree_tete_a_tete == -1){
1027
+ our_ring = basering;
1028
+ dbprint(our_printlevel,"Sagbi basis computed");
1029
+ if(@do_def_ideal){
1030
+ setring @S;
1031
+ @DefIdeal = simplify(@DefIdeal, 3);
1032
+ }
1033
+ setring our_ring;
1034
+ if(@do_def_ideal){
1035
+ checkDefIdeal(Q);
1036
+ }
1037
+ return(P_1,2);
1038
+ }
1039
+ if(uu != degree_tete_a_tete){
1040
+ if(uu > degree_tete_a_tete){
1041
+ ERROR("Degree in tete-a-tete too small. Inform the authors!");
1042
+ }
1043
+ uu = degree_tete_a_tete;
1044
+ if(uu > Sagbi_degree_bound){
1045
+ dbprint(our_printlevel,"Degree bound reached");
1046
+ if(@do_def_ideal){
1047
+ setring @S;
1048
+ @DefIdeal = simplify(@DefIdeal, 3);
1049
+ }
1050
+ setring our_ring;
1051
+ if(@do_def_ideal){
1052
+ checkDefIdeal(Q);
1053
+ }
1054
+ return(P_1, 1);
1055
+ }
1056
+ output = "Degree increased to " + string( uu);
1057
+ dbprint(our_printlevel,output);
1058
+ }
1059
+ P_1 = completeSubduction(P_1);
1060
+ }
1061
+
1062
+ degreeBoundReached = 0;
1063
+ if(Sagbi_degree_bound == uu){
1064
+ degreeBoundReached = 1;
1065
+ }
1066
+
1067
+ if(degreeBoundReached){
1068
+ dbprint(our_printlevel,"Degree bound reached");
1069
+ if(@do_def_ideal){
1070
+ setring @S;
1071
+ @DefIdeal = simplify(@DefIdeal, 3);
1072
+ }
1073
+ setring our_ring;
1074
+ if(@do_def_ideal){
1075
+ checkDefIdeal(Q);
1076
+ }
1077
+ return(P_1,1);
1078
+ }
1079
+
1080
+ done = 0;
1081
+ checked = 0;
1082
+ if(size(P) == size(P_1) && !degreeByDegree){
1083
+ done = 1;
1084
+ checked = 1;
1085
+ for(i = 1; i <= size(P); i++){
1086
+ if(P[i] != P_1[i]){
1087
+ done = 0;
1088
+ break;
1089
+ }
1090
+ }
1091
+ }
1092
+
1093
+ if(done){
1094
+ dbprint(our_printlevel,"Sagbi basis computed");
1095
+ if(@do_def_ideal){
1096
+ our_ring = basering;
1097
+ setring @S;
1098
+ @DefIdeal = simplify(@DefIdeal, 3);
1099
+ setring our_ring;
1100
+ checkDefIdeal(Q);
1101
+ }
1102
+ return(P_1, 2);
1103
+ }
1104
+
1105
+ round++;
1106
+ if(Sagbi_max_rounds != -1 && round > Sagbi_max_rounds){
1107
+ dbprint(our_printlevel,"Maximal number of rounds reached");
1108
+ return(P_1,1);
1109
+ }
1110
+
1111
+ uu++;
1112
+ dbprint(our_printlevel,"*********************");
1113
+ output = "Round " + string( round) + " with " + string(size(P_1)) + " generators";
1114
+ dbprint(our_printlevel,output);
1115
+ if(degreeByDegree){
1116
+ output = "Degree >= " + string(uu);
1117
+ dbprint(our_printlevel, output);
1118
+ }
1119
+
1120
+ if(degreeByDegree){
1121
+ makeNewTete_a_tete = 0;
1122
+ if(size(P) != size(P_1)){
1123
+ makeNewTete_a_tete = 1;
1124
+ }
1125
+ else{
1126
+ if(minDegreeGens < maxDegreeGens){ // in this case we may have P != P_1 despite of equal size
1127
+ for(i = size(P); i >= 1; i--){
1128
+ if(P[i] != P_1[i]){
1129
+ makeNewTete_a_tete = 1;
1130
+ break;
1131
+ }
1132
+ }
1133
+ }
1134
+ }
1135
+ }
1136
+
1137
+ P = P_1 + Phigh;
1138
+ our_ring = basering;
1139
+ if(@do_def_ideal){
1140
+ setring @S;
1141
+ @PreIm = @PreIm + @PreIm_high;
1142
+ }
1143
+
1144
+ setring our_ring;
1145
+
1146
+ } // main while loop
1147
+
1148
+ }
1149
+
1150
+ // ------------------------------------------------
1151
+ // User interface
1152
+ // -----------------------------------------------
1153
+
1154
+ proc sagbiHilbControlled(ideal Q, intvec HS_num_algebra, intvec HS_denom_algebra, int Sagbi_degree_bound, list #)
1155
+ "USAGE: agbiHilbControlled(ideal Q, intvec HS_num_algebra, intvec HS_denom_algebra, int Sagbi_degree_bound [,int finalChweck, int sorting, int verb]);
1156
+ RETURN: An ideal whose generators form the Sagbi basis of the algebra generated
1157
+ by the polynomials inin degrwees <= Sagbi_degree_bound. The computation is controlled by the Hilbert series
1158
+ given by the numerator and the denominator.
1159
+
1160
+ If sorting is set, the computed elements are degrevlex sorted before a round of the algorithm.
1161
+ The optional parameter verb sets the terminal output. Default is 1 = on.
1162
+
1163
+ The return value has a second integer component. Its possible values are: 0, if the full Sagbi basis has
1164
+ not been reached, 1 if this is unknown, and 2 if the full Sagbi basis has been computed.
1165
+
1166
+ EXAMPLE: example sagbiHilbControlled; shows an example
1167
+ "
1168
+ {
1169
+
1170
+ int finalCheck = 0;
1171
+ int sorting = 0;
1172
+
1173
+ if(size(#) > 0){
1174
+ finalCheck = #[1];
1175
+ }
1176
+ if(size(#) > 1){
1177
+ sorting = #[2];
1178
+ }
1179
+ if(size(#) > 2){
1180
+ our_printlevel = #[3];
1181
+ }
1182
+
1183
+ if(Sagbi_degree_bound <= 0){
1184
+ ERROR("Degree bound must be positive");
1185
+ }
1186
+
1187
+ if(!homog(Q)){
1188
+ ERROR("sagbiHilbControlled expects homogeneous input");
1189
+ }
1190
+ list baseringlist = ringlist(basering);
1191
+ intvec w = baseringlist[3][1][2];
1192
+ for(int i = 1; i <=size(w); i++){
1193
+ if(w[i] != 1){
1194
+ ERROR("Basering not standard graded");
1195
+ }
1196
+ }
1197
+
1198
+ ideal P;
1199
+ int success;
1200
+ (P, success) = dosagbiHilbControlled(Q, HS_num_algebra, HS_denom_algebra, Sagbi_degree_bound, finalCheck, sorting);
1201
+ return(P,success);
1202
+ }
1203
+ example
1204
+ { "EXAMPLE:"; echo=2;
1205
+ ring R = 0, (x,y,z),dp;
1206
+ ideal P = x^6+y^6+z^6, x^7+y^7+z^7, x^8+y^8+z^8;
1207
+ ideal Q;
1208
+ intvec HS_num = 1;
1209
+ intvec HS_denom = 6,7,8;
1210
+ int success;
1211
+ // degree bound 40, final check, ,no sorting, no terminal output
1212
+ (Q,success) = sagbiHilbControlled(P,HS_num, HS_denom,40, 1,0,0);
1213
+ lead(Q);
1214
+ "Note: success = 0 <==> Sagbi basis incomplete";
1215
+ "success",success;
1216
+ }
1217
+
1218
+
1219
+ proc sagbiByDegree(ideal Q, int Sagbi_degree_bound, list #)
1220
+ "USAGE: sagbiByDegree(ideal Q, int sagbiDegreeBound [,int sorting, int verb]);
1221
+ RETURN: RETURN: An ideal whose generators form the Sagbi basis of the algebra generated
1222
+ by the polynomials inin degrwees <= Sagbi_degree_bound.
1223
+
1224
+ If sorting is set, the computed elements are degrevlex sorted before a round of the algorithm.
1225
+ The optional parameter verb sets the terminal output. Default is 1 = on.
1226
+
1227
+ The return value has a second integer component. Its possible values are: 0, if the full Sagbi basis has
1228
+ not been reached, 1 if this is unknown, and 2 if the full Sagbi basis has been computed.
1229
+
1230
+ EXAMPLE: example sagbiByDegree; shows an example
1231
+ "
1232
+ {
1233
+ int sorting = 0;
1234
+ if(size(#) > 0)
1235
+ {
1236
+ sorting = #[1];
1237
+ }
1238
+ if(size(#) > 1){
1239
+ our_printlevel = #[2];
1240
+ }
1241
+
1242
+
1243
+ if(Sagbi_degree_bound <= 0){
1244
+ ERROR("Degree bound must be positive");
1245
+ }
1246
+ if(!homog(Q)){
1247
+ ERROR("sagbiByDegree expects homogeneous input");
1248
+ }
1249
+
1250
+ list baseringlist = ringlist(basering);
1251
+ intvec w = baseringlist[3][1][2];
1252
+ for(int i = 1; i <=size(w); i++){
1253
+ if(w[i] != 1){
1254
+ ERROR("Basering not standard graded");
1255
+ }
1256
+ }
1257
+
1258
+ ideal P;
1259
+ int success;
1260
+ (P, success) = doSagbiGeneral(Q, 0, Sagbi_degree_bound, -1, sorting);
1261
+
1262
+ int NrTerms = 0;
1263
+ for(int k = 1; k <= size(P); k++){
1264
+ NrTerms = NrTerms + size(P[k]);
1265
+ }
1266
+ // "Number Terms", NrTerms;
1267
+
1268
+
1269
+ return(P,success);
1270
+ }
1271
+ example
1272
+ { "EXAMPLE:"; echo=2;
1273
+ ring R = 0, (x,y,z),dp;
1274
+ ideal P = x^6+y^6+z^6, x^7+y^7+z^7, x^8+y^8+z^8;
1275
+ ideal Q;
1276
+ int success;
1277
+ // degree bound 40, no sorting, no terminal output
1278
+ (Q,success) = sagbiByDegree(P,40,0,0);
1279
+ lead(Q);
1280
+ "Note: success = 1 <==> Unknown whether complete";
1281
+ "success",success;
1282
+ }
1283
+
1284
+
1285
+ proc sagbiGeneral(ideal Q, list #)
1286
+ "USAGE: sagbiGeneral(ideal Q [, int sagbiMaxRounds, int sorting, int verb]));
1287
+ RETURN: An ideal whose generators form the Sagbi basis of the algebra generated
1288
+ by the polynomials in Q as far as computwed in at most sagbiMaxRounds.
1289
+
1290
+ If sorting is set, the computed elements are degrevlex sorted before a round of the algorithm.
1291
+ The optional parameter verb sets the terminal output. Default is 1 = on.
1292
+
1293
+ The return value has a second integer component. Its possible values are: 0, if the full Sagbi basis has
1294
+ not been reached, 1 if this is unknown, and 2 if the full Sagbi basis has been computed.
1295
+
1296
+ EXAMPLE: example agbiGeneral; shows an example
1297
+ "
1298
+ {
1299
+ int sorting = 0;
1300
+ int Sagbi_max_rounds = -1;
1301
+ if(size(#) > 0){
1302
+ Sagbi_max_rounds = #[1];
1303
+ }
1304
+ if(size(#) > 1){
1305
+ sorting = #[2];
1306
+ }
1307
+ if(size(#) > 2){
1308
+ our_printlevel = #[3];
1309
+ }
1310
+ ideal P;
1311
+ int success;
1312
+ (P, success) = doSagbiGeneral(Q, 0, -1, Sagbi_max_rounds, sorting);
1313
+ return(P,success);
1314
+ }
1315
+ example
1316
+ { "EXAMPLE:"; echo=2;
1317
+ ring R = 0, (x,y,z),dp;
1318
+ ideal P = x^6+y^6+z^6, x^7+y^7+z^7;
1319
+ ideal Q;
1320
+ int success;
1321
+ // at most 3 rounds, no sorting, no terminal output
1322
+ (Q,success) = sagbiGeneral(P,3,0,0);
1323
+ Q;
1324
+ "Note: success = 2 <==> Sagbi basis complete";
1325
+ "success",success;
1326
+ }
1327
+
1328
+ proc sagbiDefIdealByDegree(ideal Q, int Sagbi_degree_bound, list #)
1329
+ "USAGE: defIdealByDegree(ideal Q, int sagbiDegreeBound [,int sorting, int verb]);
1330
+ RETURN: An instance of
1331
+
1332
+ newstruct("sagbiResult","int success, ideal sagbiBasis, ideal defIdeal");
1333
+
1334
+ success has the value 0, if the full Sagbi basis has not been reached,
1335
+ 1 if this is unknown, and 2 if the full Sagbi basis has been computed.
1336
+
1337
+ sagbiBasis is the Sagbi basis encodeed as an ideal in the polynomial ring that was
1338
+ active when sagbiDefIdealByDegree was called.
1339
+
1340
+ defIdeal contains the defining ideal (as far as computed). It lives in the ring
1341
+ (name of the result).r_defIdeal; See example for the activation of this ring.
1342
+ The defining ideal has been minimized.
1343
+
1344
+ Note: sorting, if set at all, must be 0.
1345
+
1346
+ EXAMPLE: example sagbiDefIdealByDegree; shows an example
1347
+ "
1348
+ {
1349
+ // checkPposDegree(Q);
1350
+
1351
+ int sorting = 0;
1352
+ if(size(#) > 1){
1353
+ sorting = #[2];
1354
+ }
1355
+ if(sorting){
1356
+ "Sorting not allowed for defining ideal and swiched off";
1357
+ sorting = 0;
1358
+ }
1359
+
1360
+ if(size(#) > 1){
1361
+ our_printlevel = #[2];
1362
+ }
1363
+
1364
+ if(Sagbi_degree_bound <= 0){
1365
+ ERROR("Degree bound must be positive");
1366
+ }
1367
+ if(!homog(Q)){
1368
+ ERROR("defIdealByDegree expects homogeneous input");
1369
+ }
1370
+
1371
+ list baseringlist = ringlist(basering);
1372
+ intvec w = baseringlist[3][1][2];
1373
+ for(int i = 1; i <=size(w); i++){
1374
+ if(w[i] != 1){
1375
+ ERROR("Basering not standard graded");
1376
+ }
1377
+ }
1378
+
1379
+ ideal P;
1380
+ int success;
1381
+ (P, success) = doSagbiGeneral(Q, 1, Sagbi_degree_bound, -1, sorting); // 1 = defining ideal
1382
+
1383
+ // int NrTerms = 0;
1384
+ // for(int k = 1; k <= size(P); k++){
1385
+ // NrTerms = NrTerms + size(P[k]);
1386
+ // }
1387
+ // "Number Terms", NrTerms;
1388
+
1389
+ sagbiResult res;
1390
+ res.success = success;
1391
+ res.sagbiBasis = P;
1392
+ def our_ring = basering;
1393
+ setring @S;
1394
+ res.defIdeal = minbase(@DefIdeal);
1395
+ setring our_ring;
1396
+ return(res);
1397
+ }
1398
+ example
1399
+ { "EXAMPLE:"; echo=2;
1400
+ ring R = 0,(x(1..2)(1..5)), dp;
1401
+ matrix M[2][5] = x(1..2)(1..5);
1402
+ ideal P = minor(M,2);
1403
+ int degree_bound = 15;
1404
+ def Result = sagbiDefIdealByDegree(P, degree_bound, 0, 1);
1405
+ "Note: success = 2 <==> Sagbi basis and defining ideal completee";
1406
+ "success", Result.success;
1407
+ "Sagbi basis";
1408
+ Result.sagbiBasis;
1409
+ def motherRing = Result.r_defIdeal;
1410
+ setring motherRing;
1411
+ "defining ideal";
1412
+ Result.defIdeal;
1413
+ }
1414
+
1415
+ proc sagbiDefIdealGeneral(ideal Q, list #)
1416
+ "USAGE: defIdealGeneral(ideal Q [, int sagbiMaxRounds, int sorting, int verb]));
1417
+ RETURN: An instance of
1418
+
1419
+ newstruct("sagbiResult","int success, ideal sagbiBasis, ideal defIdeal");
1420
+
1421
+ success has the value 0, if the full Sagbi basis has not been reached,
1422
+ 1 if this is unknown, and 2 if the full Sagbi basis has been computed.
1423
+
1424
+ sagbiBasis is the Sagbi basis encodeed as an ideal in the polynomial ring that was
1425
+ active when sagbiDefIdealByDegree was called.
1426
+
1427
+ defIdeal contains the defining ideal (as far as computed). It lives in the ring
1428
+ (name of the result).r_defIdeal; See example for the activation of this ring.
1429
+
1430
+ Note: sorting, if set at all, must be 0.
1431
+
1432
+ EXAMPLE: example sagbiDefIdealGeneral; shows an example
1433
+ "
1434
+ {
1435
+ int sorting = 0;
1436
+ int Sagbi_max_rounds = -1;
1437
+ if(size(#) > 0){
1438
+ Sagbi_max_rounds = #[1];
1439
+ }
1440
+ if(size(#) > 1){
1441
+ sorting = #[2];
1442
+ }
1443
+ if(sorting){
1444
+ "Sorting not allowed for defining ideal and swiched off";
1445
+ sorting = 0;
1446
+ }
1447
+ if(size(#) > 2){
1448
+ our_printlevel = #[3];
1449
+ }
1450
+ ideal P;
1451
+ int success;
1452
+ (P, success) = doSagbiGeneral(Q, 1, -1, Sagbi_max_rounds, sorting); // 1 = defining ideal, -1 = no degrees.
1453
+
1454
+ sagbiResult res;
1455
+ res.success = success;
1456
+ res.sagbiBasis = P;
1457
+ def our_ring = basering;
1458
+ setring @S;
1459
+ res.defIdeal = @DefIdeal;
1460
+ setring our_ring;
1461
+ return(res);
1462
+ }
1463
+ example
1464
+ { "EXAMPLE:";echo=2;
1465
+ ring R = 0,(x,w),dp;
1466
+ ideal A = x^2-w+1, x + w^3, x -w;
1467
+ def Result = sagbiDefIdealGeneral(A,-1); "Note: success = 2 <==> Sagbi basis and defining ideal completee";
1468
+ "success", Result.success;
1469
+ "Sagbi basis";
1470
+ Result.sagbiBasis;
1471
+ def motherRing = Result.r_defIdeal;
1472
+ setring motherRing;
1473
+ "defining ideal";
1474
+ Result.defIdeal;
1475
+ }
1476
+ // ------------------------------------------------
1477
+ // Initialization
1478
+ // -----------------------------------------------
1479
+
1480
+ static proc mod_init()
1481
+ {
1482
+ LIB "normaliz.lib";
1483
+ int swallow;
1484
+ addNmzOption("MRK","MarkovBasis");
1485
+ addNmzOption("REP","Representations");
1486
+ addNmzOption("BPK","BinomialsPacked");
1487
+ swallow = setNmzOption("BPK", 1);
1488
+ swallow = setNmzOption("MRK",0);
1489
+ swallow =setNmzOption("REP",0);
1490
+ setNmzFilename("NmzSagbiExchange");
1491
+ intmat saveTete_a_tete;
1492
+ int startTete_tete;
1493
+ export(saveTete_a_tete);
1494
+ export(startTete_tete);
1495
+ int our_printlevel = 1;
1496
+ export(our_printlevel);
1497
+ newstruct("sagbiResult","int success, ideal sagbiBasis, ideal defIdeal");
1498
+ }