passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.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 (490) hide show
  1. PySingular.cpython-314-aarch64-linux-gnu.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +490 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-6a2a8666.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-ac579979.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-66e33516.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-81de1160.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgf2x-fbd36f80.so.3.0.0 +0 -0
  11. passagemath_singular.libs/libgfortran-e1b7dfc8.so.5.0.0 +0 -0
  12. passagemath_singular.libs/libgmp-93ebf16a.so.10.5.0 +0 -0
  13. passagemath_singular.libs/libgsl-e3525837.so.28.0.0 +0 -0
  14. passagemath_singular.libs/libmpfr-e0f11cf3.so.6.2.1 +0 -0
  15. passagemath_singular.libs/libntl-0043a3a2.so.44.0.1 +0 -0
  16. passagemath_singular.libs/libomalloc-0-06512335.9.6.so +0 -0
  17. passagemath_singular.libs/libopenblasp-r0-4c5b64b1.3.29.so +0 -0
  18. passagemath_singular.libs/libpolys-4-cb7246b5.4.1.so +0 -0
  19. passagemath_singular.libs/libreadline-28330744.so.8.2 +0 -0
  20. passagemath_singular.libs/libsingular_resources-4-8c425241.4.1.so +0 -0
  21. passagemath_singular.libs/libtinfo-f81c2d16.so.6.3 +0 -0
  22. sage/algebras/all__sagemath_singular.py +3 -0
  23. sage/algebras/fusion_rings/all.py +19 -0
  24. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  25. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-aarch64-linux-gnu.so +0 -0
  26. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  27. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  28. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-aarch64-linux-gnu.so +0 -0
  29. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  30. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  31. sage/algebras/fusion_rings/fusion_double.py +899 -0
  32. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  33. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-aarch64-linux-gnu.so +0 -0
  34. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  35. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  36. sage/algebras/fusion_rings/shm_managers.cpython-314-aarch64-linux-gnu.so +0 -0
  37. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  38. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  39. sage/algebras/letterplace/all.py +1 -0
  40. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
  41. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  42. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  43. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
  44. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  45. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  46. sage/algebras/letterplace/letterplace_ideal.cpython-314-aarch64-linux-gnu.so +0 -0
  47. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  48. sage/algebras/quatalg/all.py +2 -0
  49. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  50. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-aarch64-linux-gnu.so +0 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  52. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-aarch64-linux-gnu.so +0 -0
  53. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  54. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  55. sage/all__sagemath_singular.py +11 -0
  56. sage/ext_data/all__sagemath_singular.py +1 -0
  57. sage/ext_data/singular/function_field/core.lib +98 -0
  58. sage/interfaces/all__sagemath_singular.py +1 -0
  59. sage/interfaces/singular.py +2835 -0
  60. sage/libs/all__sagemath_singular.py +1 -0
  61. sage/libs/singular/__init__.py +1 -0
  62. sage/libs/singular/decl.pxd +1168 -0
  63. sage/libs/singular/function.cpython-314-aarch64-linux-gnu.so +0 -0
  64. sage/libs/singular/function.pxd +87 -0
  65. sage/libs/singular/function.pyx +1901 -0
  66. sage/libs/singular/function_factory.py +61 -0
  67. sage/libs/singular/groebner_strategy.cpython-314-aarch64-linux-gnu.so +0 -0
  68. sage/libs/singular/groebner_strategy.pxd +22 -0
  69. sage/libs/singular/groebner_strategy.pyx +582 -0
  70. sage/libs/singular/option.cpython-314-aarch64-linux-gnu.so +0 -0
  71. sage/libs/singular/option.pyx +671 -0
  72. sage/libs/singular/polynomial.cpython-314-aarch64-linux-gnu.so +0 -0
  73. sage/libs/singular/polynomial.pxd +39 -0
  74. sage/libs/singular/polynomial.pyx +661 -0
  75. sage/libs/singular/ring.cpython-314-aarch64-linux-gnu.so +0 -0
  76. sage/libs/singular/ring.pxd +58 -0
  77. sage/libs/singular/ring.pyx +893 -0
  78. sage/libs/singular/singular.cpython-314-aarch64-linux-gnu.so +0 -0
  79. sage/libs/singular/singular.pxd +72 -0
  80. sage/libs/singular/singular.pyx +1944 -0
  81. sage/libs/singular/standard_options.py +145 -0
  82. sage/matrix/all__sagemath_singular.py +1 -0
  83. sage/matrix/matrix_mpolynomial_dense.cpython-314-aarch64-linux-gnu.so +0 -0
  84. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  85. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  86. sage/rings/all__sagemath_singular.py +1 -0
  87. sage/rings/function_field/all__sagemath_singular.py +1 -0
  88. sage/rings/function_field/derivations_polymod.py +911 -0
  89. sage/rings/function_field/element_polymod.cpython-314-aarch64-linux-gnu.so +0 -0
  90. sage/rings/function_field/element_polymod.pyx +406 -0
  91. sage/rings/function_field/function_field_polymod.py +2611 -0
  92. sage/rings/function_field/ideal_polymod.py +1775 -0
  93. sage/rings/function_field/order_polymod.py +1475 -0
  94. sage/rings/function_field/place_polymod.py +681 -0
  95. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  96. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
  97. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  98. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  99. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
  100. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  101. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  102. sage/rings/polynomial/plural.cpython-314-aarch64-linux-gnu.so +0 -0
  103. sage/rings/polynomial/plural.pxd +48 -0
  104. sage/rings/polynomial/plural.pyx +3171 -0
  105. sage/symbolic/all__sagemath_singular.py +1 -0
  106. sage/symbolic/comparison_impl.pxi +428 -0
  107. sage/symbolic/constants_c_impl.pxi +178 -0
  108. sage/symbolic/expression.cpython-314-aarch64-linux-gnu.so +0 -0
  109. sage/symbolic/expression.pxd +7 -0
  110. sage/symbolic/expression.pyx +14200 -0
  111. sage/symbolic/getitem_impl.pxi +202 -0
  112. sage/symbolic/pynac.pxi +572 -0
  113. sage/symbolic/pynac_constant_impl.pxi +133 -0
  114. sage/symbolic/pynac_function_impl.pxi +206 -0
  115. sage/symbolic/pynac_impl.pxi +2576 -0
  116. sage/symbolic/pynac_wrap.h +124 -0
  117. sage/symbolic/series_impl.pxi +272 -0
  118. sage/symbolic/substitution_map_impl.pxi +94 -0
  119. sage_wheels/bin/ESingular +0 -0
  120. sage_wheels/bin/Singular +0 -0
  121. sage_wheels/bin/TSingular +0 -0
  122. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  123. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  124. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  125. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  126. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  127. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  128. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  129. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  130. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  131. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  132. sage_wheels/lib/singular/MOD/interval.la +41 -0
  133. sage_wheels/lib/singular/MOD/interval.so +0 -0
  134. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  135. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  136. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  137. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  138. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  139. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  140. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  146. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  147. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  148. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  149. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  150. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  151. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  152. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  153. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  154. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  155. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  156. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  157. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  158. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  159. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  160. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  161. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  162. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  163. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  164. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  165. sage_wheels/libexec/singular/MOD/surfex +16 -0
  166. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  167. sage_wheels/share/factory/gftables/10201 +342 -0
  168. sage_wheels/share/factory/gftables/1024 +37 -0
  169. sage_wheels/share/factory/gftables/10609 +356 -0
  170. sage_wheels/share/factory/gftables/11449 +384 -0
  171. sage_wheels/share/factory/gftables/11881 +398 -0
  172. sage_wheels/share/factory/gftables/121 +6 -0
  173. sage_wheels/share/factory/gftables/12167 +408 -0
  174. sage_wheels/share/factory/gftables/125 +7 -0
  175. sage_wheels/share/factory/gftables/12769 +428 -0
  176. sage_wheels/share/factory/gftables/128 +7 -0
  177. sage_wheels/share/factory/gftables/1331 +47 -0
  178. sage_wheels/share/factory/gftables/1369 +48 -0
  179. sage_wheels/share/factory/gftables/14641 +490 -0
  180. sage_wheels/share/factory/gftables/15625 +523 -0
  181. sage_wheels/share/factory/gftables/16 +3 -0
  182. sage_wheels/share/factory/gftables/16129 +540 -0
  183. sage_wheels/share/factory/gftables/16384 +549 -0
  184. sage_wheels/share/factory/gftables/16807 +563 -0
  185. sage_wheels/share/factory/gftables/1681 +58 -0
  186. sage_wheels/share/factory/gftables/169 +8 -0
  187. sage_wheels/share/factory/gftables/17161 +574 -0
  188. sage_wheels/share/factory/gftables/1849 +64 -0
  189. sage_wheels/share/factory/gftables/18769 +628 -0
  190. sage_wheels/share/factory/gftables/19321 +646 -0
  191. sage_wheels/share/factory/gftables/19683 +659 -0
  192. sage_wheels/share/factory/gftables/2048 +71 -0
  193. sage_wheels/share/factory/gftables/2187 +75 -0
  194. sage_wheels/share/factory/gftables/2197 +76 -0
  195. sage_wheels/share/factory/gftables/2209 +76 -0
  196. sage_wheels/share/factory/gftables/22201 +742 -0
  197. sage_wheels/share/factory/gftables/22801 +762 -0
  198. sage_wheels/share/factory/gftables/2401 +82 -0
  199. sage_wheels/share/factory/gftables/243 +11 -0
  200. sage_wheels/share/factory/gftables/24389 +815 -0
  201. sage_wheels/share/factory/gftables/24649 +824 -0
  202. sage_wheels/share/factory/gftables/25 +3 -0
  203. sage_wheels/share/factory/gftables/256 +11 -0
  204. sage_wheels/share/factory/gftables/26569 +888 -0
  205. sage_wheels/share/factory/gftables/27 +3 -0
  206. sage_wheels/share/factory/gftables/27889 +932 -0
  207. sage_wheels/share/factory/gftables/2809 +96 -0
  208. sage_wheels/share/factory/gftables/28561 +954 -0
  209. sage_wheels/share/factory/gftables/289 +12 -0
  210. sage_wheels/share/factory/gftables/29791 +995 -0
  211. sage_wheels/share/factory/gftables/29929 +1000 -0
  212. sage_wheels/share/factory/gftables/3125 +107 -0
  213. sage_wheels/share/factory/gftables/32 +4 -0
  214. sage_wheels/share/factory/gftables/32041 +1070 -0
  215. sage_wheels/share/factory/gftables/32761 +1094 -0
  216. sage_wheels/share/factory/gftables/32768 +1095 -0
  217. sage_wheels/share/factory/gftables/343 +14 -0
  218. sage_wheels/share/factory/gftables/3481 +118 -0
  219. sage_wheels/share/factory/gftables/361 +14 -0
  220. sage_wheels/share/factory/gftables/36481 +1218 -0
  221. sage_wheels/share/factory/gftables/3721 +126 -0
  222. sage_wheels/share/factory/gftables/37249 +1244 -0
  223. sage_wheels/share/factory/gftables/38809 +1296 -0
  224. sage_wheels/share/factory/gftables/39601 +1322 -0
  225. sage_wheels/share/factory/gftables/4 +3 -0
  226. sage_wheels/share/factory/gftables/4096 +139 -0
  227. sage_wheels/share/factory/gftables/44521 +1486 -0
  228. sage_wheels/share/factory/gftables/4489 +152 -0
  229. sage_wheels/share/factory/gftables/49 +4 -0
  230. sage_wheels/share/factory/gftables/4913 +166 -0
  231. sage_wheels/share/factory/gftables/49729 +1660 -0
  232. sage_wheels/share/factory/gftables/5041 +170 -0
  233. sage_wheels/share/factory/gftables/50653 +1691 -0
  234. sage_wheels/share/factory/gftables/512 +20 -0
  235. sage_wheels/share/factory/gftables/51529 +1720 -0
  236. sage_wheels/share/factory/gftables/52441 +1750 -0
  237. sage_wheels/share/factory/gftables/529 +20 -0
  238. sage_wheels/share/factory/gftables/5329 +180 -0
  239. sage_wheels/share/factory/gftables/54289 +1812 -0
  240. sage_wheels/share/factory/gftables/57121 +1906 -0
  241. sage_wheels/share/factory/gftables/58081 +1938 -0
  242. sage_wheels/share/factory/gftables/59049 +1971 -0
  243. sage_wheels/share/factory/gftables/6241 +210 -0
  244. sage_wheels/share/factory/gftables/625 +23 -0
  245. sage_wheels/share/factory/gftables/63001 +2102 -0
  246. sage_wheels/share/factory/gftables/64 +5 -0
  247. sage_wheels/share/factory/gftables/6561 +221 -0
  248. sage_wheels/share/factory/gftables/6859 +231 -0
  249. sage_wheels/share/factory/gftables/6889 +232 -0
  250. sage_wheels/share/factory/gftables/729 +27 -0
  251. sage_wheels/share/factory/gftables/7921 +266 -0
  252. sage_wheels/share/factory/gftables/8 +3 -0
  253. sage_wheels/share/factory/gftables/81 +5 -0
  254. sage_wheels/share/factory/gftables/8192 +276 -0
  255. sage_wheels/share/factory/gftables/841 +30 -0
  256. sage_wheels/share/factory/gftables/9 +3 -0
  257. sage_wheels/share/factory/gftables/9409 +316 -0
  258. sage_wheels/share/factory/gftables/961 +34 -0
  259. sage_wheels/share/info/singular.info +191898 -0
  260. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  261. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  262. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  263. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  264. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  265. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  266. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  267. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  268. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  269. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  270. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  271. sage_wheels/share/singular/LIB/all.lib +136 -0
  272. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  273. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  274. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  275. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  276. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  277. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  278. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  279. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  280. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  281. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  282. sage_wheels/share/singular/LIB/central.lib +2169 -0
  283. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  284. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  285. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  286. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  287. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  288. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  289. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  290. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  291. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  292. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  293. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  294. sage_wheels/share/singular/LIB/control.lib +1636 -0
  295. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  296. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  297. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  298. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  299. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  300. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  301. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  302. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  303. sage_wheels/share/singular/LIB/deform.lib +925 -0
  304. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  305. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  306. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  307. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  308. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  309. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  310. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  311. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  312. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  313. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  314. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  315. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  316. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  317. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  318. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  319. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  320. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  321. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  322. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  323. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  324. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  325. sage_wheels/share/singular/LIB/general.lib +1350 -0
  326. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  327. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  328. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  329. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  330. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  331. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  332. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  333. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  334. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  335. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  336. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  337. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  338. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  339. sage_wheels/share/singular/LIB/help.cnf +57 -0
  340. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  341. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  342. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  343. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  344. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  345. sage_wheels/share/singular/LIB/inout.lib +679 -0
  346. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  347. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  348. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  349. sage_wheels/share/singular/LIB/invar.lib +443 -0
  350. sage_wheels/share/singular/LIB/involut.lib +980 -0
  351. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  352. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  353. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  354. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  355. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  356. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  357. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  358. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  359. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  360. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  361. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  362. sage_wheels/share/singular/LIB/methods.lib +212 -0
  363. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  364. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  365. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  366. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  367. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  368. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  369. sage_wheels/share/singular/LIB/modular.lib +545 -0
  370. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  371. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  372. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  373. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  374. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  375. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  376. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  377. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  378. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  379. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  380. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  381. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  382. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  383. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  384. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  385. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  386. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  387. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  388. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  389. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  390. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  391. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  392. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  393. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  394. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  395. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  396. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  397. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  398. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  399. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  400. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  401. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  402. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  403. sage_wheels/share/singular/LIB/perron.lib +202 -0
  404. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  405. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  406. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  407. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  408. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  409. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  410. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  411. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  412. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  413. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  414. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  415. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  416. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  417. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  418. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  419. sage_wheels/share/singular/LIB/random.lib +455 -0
  420. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  421. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  422. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  423. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  424. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  425. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  426. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  427. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  428. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  429. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  430. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  431. sage_wheels/share/singular/LIB/resources.lib +170 -0
  432. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  433. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  434. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  435. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  436. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  437. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  438. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  439. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  440. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  441. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  442. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  443. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  444. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  445. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  446. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  447. sage_wheels/share/singular/LIB/sets.lib +524 -0
  448. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  449. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  450. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  451. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  452. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  453. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  454. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  455. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  456. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  457. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  458. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  459. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  460. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  461. sage_wheels/share/singular/LIB/surf.lib +506 -0
  462. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  463. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  464. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  465. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  466. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  467. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  468. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  469. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  470. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  471. sage_wheels/share/singular/LIB/template.lib +116 -0
  472. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  473. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  474. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  475. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  476. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  477. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  478. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  479. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  480. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  481. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  482. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  483. sage_wheels/share/singular/emacs/COPYING +44 -0
  484. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  485. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  486. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  487. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  488. sage_wheels/share/singular/emacs/singular.el +4273 -0
  489. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  490. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1533 @@
1
+ ////////////////////////////////////////////////////////////////////////////
2
+ version="version presolve.lib 4.4.0.0 Nov_2023 "; // $Id: 1eb07ddf56542f07421d193e4aaee09cef4eb958 $
3
+ category="Symbolic-numerical solving";
4
+ info="
5
+ LIBRARY: presolve.lib Pre-Solving of Polynomial Equations
6
+ AUTHOR: Gert-Martin Greuel, email: greuel@mathematik.uni-kl.de,
7
+
8
+ PROCEDURES:
9
+ degreepart(id,d1,d2); elements of id of total degree >= d1 and <= d2, and rest
10
+ elimlinearpart(id); linear part eliminated from id
11
+ elimpart(id[,n]); partial elimination of vars [among first n vars]
12
+ elimpartanyr(i,p); factors of p partially eliminated from i in any ring
13
+ fastelim(i,p[..]); fast elimination of factors of p from i [options]
14
+ findvars(id); variables occurring/not occurring in id
15
+ hilbvec(id[,c,o]); intvec of Hilberseries of id [in char c and ord o]
16
+ linearpart(id); elements of id of total degree <=1
17
+ tolessvars(id[,]); maps id to new basering having only vars occurring in id
18
+ solvelinearpart(id); reduced std-basis of linear part of id
19
+ sortandmap(id[..]); map to new basering with vars sorted w.r.t. complexity
20
+ sortvars(id[n1,p1..]); sort vars w.r.t. complexity in id [different blocks]
21
+ valvars(id[..]); valuation of vars w.r.t. to their complexity in id
22
+ idealSplit(id,tF,fS); a list of ideals such that their intersection
23
+ has the same radical as id
24
+ ( parameters in square brackets [] are optional)
25
+ ";
26
+
27
+ LIB "inout.lib";
28
+ LIB "general.lib";
29
+ LIB "matrix.lib";
30
+ LIB "ring.lib";
31
+ LIB "elim.lib";
32
+ ///////////////////////////////////////////////////////////////////////////////
33
+ proc shortid (def id,int n,list #)
34
+ "USAGE: shortid(id,n[,e]); id= ideal/module, n,e=integers
35
+ RETURN: - if called with two arguments or e=0:
36
+ @* same type as id, containing generators of id having <= n terms.
37
+ @* - if called with three arguments and e!=0:
38
+ @* a list L:
39
+ @* L[1]: same type as id, containing generators of id having <= n terms.
40
+ @* L[2]: number of corresponding generator of id
41
+ NOTE: May be used to compute partial standard basis in case id is to hard
42
+ EXAMPLE: example shortid; shows an example
43
+ "
44
+ {
45
+ intvec v;
46
+ int ii;
47
+ for(ii=1; ii<=ncols(id); ii++)
48
+ {
49
+ if (size(id[ii]) <=n and id[ii]!=0 )
50
+ {
51
+ v=v,ii;
52
+ }
53
+ if (size(id[ii]) > n )
54
+ {
55
+ id[ii]=0;
56
+ }
57
+ }
58
+ if( size(v)>1 )
59
+ {
60
+ v = v[2..size(v)];
61
+ }
62
+ id = simplify(id,2);
63
+ list L = id,v;
64
+ if ( size(#)==0 )
65
+ {
66
+ return(id);
67
+ }
68
+ if ( size(#)!=0 )
69
+ {
70
+ if(#[1]==0)
71
+ {
72
+ return(id);
73
+ }
74
+ if(#[1]!=0)
75
+ {
76
+ return(L);
77
+ }
78
+ }
79
+ }
80
+ example
81
+ { "EXAMPLE:"; echo = 2;
82
+ ring s=0,(x,y,z,w),dp;
83
+ ideal i = (x3+y2+yw2)^2,(xz+z2)^2,xyz-w2-xzw;
84
+ shortid(i,3);
85
+ }
86
+ ///////////////////////////////////////////////////////////////////////////////
87
+
88
+ proc degreepart (def id,int d1,int d2,list #)
89
+ "USAGE: degreepart(id,d1,d2[,v]); id=ideal/module, d1,d1=integers, v=intvec
90
+ RETURN: list of size 2,
91
+ _[1]: generators of id of [v-weighted] total degree >= d1 and <= d2
92
+ (default: v = 1,...,1)
93
+ _[2]: remaining generators of id
94
+ NOTE: if id is of type int/number/poly it is converted to ideal, if id is
95
+ of type intmat/matrix/vector to module and then the corresponding
96
+ generators are computed
97
+ EXAMPLE: example degreepart; shows an example
98
+ "
99
+ {
100
+ if( typeof(id)=="int" or typeof(id)=="number"
101
+ or typeof(id)=="ideal" or typeof(id)=="poly" )
102
+ {
103
+ ideal dpart = ideal(id);
104
+ }
105
+ if( typeof(id)=="intmat" or typeof(id)=="matrix"
106
+ or typeof(id)=="module" or typeof(id)=="vector")
107
+ {
108
+ module dpart = module(id);
109
+ }
110
+
111
+ def epart = dpart;
112
+ int s,ii = ncols(id),0;
113
+ if ( size(#)==0 )
114
+ {
115
+ for ( ii=1; ii<=s; ii++ )
116
+ {
117
+ dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii];
118
+ epart[ii] = (size(dpart[ii])==0) * id[ii];
119
+ }
120
+ }
121
+ else
122
+ {
123
+ for ( ii=1; ii<=s; ii=ii+1 )
124
+ {
125
+ dpart[ii]=(jet(id[ii],d1-1,#[1])==0)*(id[ii]==jet(id[ii],d2,#[1]))*id[ii];
126
+ epart[ii] = (size(dpart[ii])==0)*id[ii];
127
+ }
128
+ }
129
+ list L = simplify(dpart,2),simplify(epart,2);
130
+ return(L);
131
+ }
132
+ example
133
+ { "EXAMPLE:"; echo = 2;
134
+ ring r=0,(x,y,z),dp;
135
+ ideal i=1+x+x2+x3+x4,3,xz+y3+z8;
136
+ degreepart(i,0,4);
137
+
138
+ module m=[x,y,z],x*[x3,y2,z],[1,x2,z3,0,1];
139
+ intvec v=2,3,6;
140
+ show(degreepart(m,8,8,v));
141
+ }
142
+ ///////////////////////////////////////////////////////////////////////////////
143
+
144
+ proc linearpart (def id)
145
+ "USAGE: linearpart(id); id=ideal/module
146
+ RETURN: list of size 2,
147
+ _[1]: generators of id of total degree <= 1
148
+ _[2]: remaining generators of id
149
+ NOTE: all variables have degree 1 (independent of ordering of basering)
150
+ EXAMPLE: example linearpart; shows an example
151
+ "
152
+ {
153
+ return(degreepart(id,0,1));
154
+ }
155
+ example
156
+ { "EXAMPLE:"; echo = 2;
157
+ ring r=0,(x,y,z),dp;
158
+ ideal i=1+x+x2+x3,3,x+3y+5z;
159
+ linearpart(i);
160
+
161
+ module m=[x,y,z],x*[x3,y2,z],[1,x2,z3,0,1];
162
+ show(linearpart(m));
163
+ }
164
+ ///////////////////////////////////////////////////////////////////////////////
165
+
166
+ proc elimlinearpart (ideal i,list #)
167
+ "USAGE: elimlinearpart(i[,n]); i=ideal, n=integer,@*
168
+ default: n=nvars(basering)
169
+ RETURN: list L with 5 entries:
170
+ @format
171
+ L[1]: ideal obtained from i by substituting from the first n variables those
172
+ which appear in a linear part of i, by putting this part into triangular
173
+ form
174
+ L[2]: ideal of variables which have been substituted
175
+ L[3]: ideal, j-th element defines substitution of j-th var in [2]
176
+ L[4]: ideal of variables of basering, eliminated ones are set to 0
177
+ L[5]: ideal, describing the map from the basering to itself such that
178
+ L[1] is the image of i
179
+ @end format
180
+ NOTE: the procedure always interreduces the ideal i internally w.r.t.
181
+ ordering dp.
182
+ EXAMPLE: example elimlinearpart; shows an example
183
+ "
184
+ {
185
+ int ii,n,k,ringchange;
186
+ string o;
187
+ intvec getoption = option(get);
188
+ option(redSB);
189
+ def BAS = basering;
190
+ n = nvars(BAS);
191
+ list gnirlist = ringlist(basering);
192
+ list g3 = gnirlist[3];
193
+
194
+ //---------------------------------- start ------------------------------------
195
+ if ( size(#)!=0 ) { n=#[1]; }
196
+ ideal maxi,rest = maxideal(1),0;
197
+ if ( n < nvars(BAS) )
198
+ {
199
+ rest = maxi[n+1..nvars(BAS)]; //variables which are not substituted
200
+ }
201
+ attrib(rest,"isSB",1);
202
+
203
+ //-------------------- find linear part and reduce rest ----------------------
204
+ // Perhaps for big systems, check only those generators of id
205
+ // which do not contain elements not to be eliminated
206
+
207
+ //ideal id = interred(i);
208
+ //## gmg, geaendert 9/2008: interred sehr lange z.B. bei Leonard1 in normal,
209
+ //daher interred ersetzt durch: std nur auf linearpart angewendet
210
+ //Wechsel zu dp Ordnung (da Lin affin linear)
211
+
212
+ //--------------- replace ordering different from dp by dp -------------------
213
+ o = "dp("+string(n)+")";
214
+ if( ! find(ordstr(BAS),o) or find(ordstr(BAS),"a") )
215
+ {
216
+ ringchange = 1; //remember change of ring
217
+ intvec V;
218
+ V[n]=0; V=V+1; //weights for dp ordering
219
+ gnirlist[3] = list("dp",V), list("C",0);
220
+ def newBAS = ring(gnirlist); //change of ring to dp ordering
221
+ setring newBAS;
222
+ ideal rest = imap(BAS,rest);
223
+ attrib(rest,"isSB",1);
224
+ ideal i = imap(BAS,i);
225
+ }
226
+
227
+ list Lin = linearpart(i);
228
+ ideal lin = std(Lin[1]); //SB of ideal generated by polys of i
229
+ //having at most degree 1
230
+ ideal id = Lin[2]; //remaining polys from i, of deg > 1
231
+ id = simplify(NF(id,lin),2); //instead of subst
232
+ ideal id1 = linearpart(id)[1];
233
+ while( size(id1) != 0 ) //repeat to find linear parts
234
+ {
235
+ lin = lin,id1;
236
+ lin = std(lin);
237
+ id = simplify(NF(id,lin),2); //instead of subst, (### is faster)
238
+ id1 = linearpart(id)[1];
239
+ }
240
+ //------------- check for special case of unit ideal and return ---------------
241
+ int check;
242
+ if( lin[1] == 1 )
243
+ {
244
+ check = 1;
245
+ }
246
+ else
247
+ {
248
+ for (ii=1; ii<=size(id); ii++ )
249
+ {
250
+ if ( id[ii] == 1 )
251
+ {
252
+ check = 1; break;
253
+ }
254
+ }
255
+ }
256
+
257
+ if (check == 1) //case of a unit ideal
258
+ {
259
+ setring BAS;
260
+ list L = ideal(1), ideal(0), ideal(0), maxideal(1), maxideal(1);
261
+ option(set,getoption);
262
+ return(L);
263
+ }
264
+ //----- remove generators from lin containing vars not to be eliminated ------
265
+ if ( n < nvars(BAS) )
266
+ {
267
+ for ( ii=1; ii<=size(lin); ii++ )
268
+ {
269
+ if ( reduce(lead(lin[ii]),rest) == 0 )
270
+ {
271
+ id=lin[ii],id;
272
+ lin[ii] = 0;
273
+ }
274
+ }
275
+ }
276
+ lin = simplify(lin,1);
277
+ ideal eva = lead(lin); //vars to be eliminated
278
+ attrib(eva,"isSB",1);
279
+ ideal neva = NF(maxideal(1),eva); //vars not to be eliminated
280
+ //------------------ go back to original ring end return ---------------------
281
+
282
+ if ( ringchange ) //i.e there was a ring change
283
+ {
284
+ setring BAS;
285
+ ideal id = imap(newBAS,id);
286
+ ideal eva = imap(newBAS,eva);
287
+ ideal lin = imap(newBAS,lin);
288
+ ideal neva = imap(newBAS,neva);
289
+ }
290
+
291
+ eva = eva[ncols(eva)..1]; // sorting according to variables in basering
292
+ lin = lin[ncols(lin)..1];
293
+ ideal phi = neva;
294
+ k = 1;
295
+ for( ii=1; ii<=n; ii++ )
296
+ {
297
+ if( neva[ii] == 0 )
298
+ {
299
+ phi[ii] = eva[k]-lin[k];
300
+ k=k+1;
301
+ }
302
+ }
303
+
304
+ list L = id, eva, lin, neva, phi;
305
+ option(set,getoption);
306
+ return(L);
307
+ }
308
+ example
309
+ { "EXAMPLE:"; echo = 2;
310
+ ring s=0,(u,x,y,z),dp;
311
+ ideal i = u3+y3+z-x,x2y2+z3,y+z+1,y+u;
312
+ elimlinearpart(i);
313
+ }
314
+ ///////////////////////////////////////////////////////////////////////////////
315
+ proc elimpart (ideal i,list #)
316
+ "USAGE: elimpart(i [,n,e] ); i=ideal, n,e=integers
317
+ n : only the first n vars are considered for substitution,@*
318
+ e =0: substitute from linear part of i (same as elimlinearpart)@*
319
+ e!=0: eliminate also by direct substitution@*
320
+ (default: n = nvars(basering), e = 1)
321
+ RETURN: list of 5 objects:
322
+ @format
323
+ [1]: ideal obtained by substituting from the first n variables those
324
+ from i, which appear in the linear part of i (or, if e!=0, which
325
+ can be expressed directly in the remaining vars)
326
+ [2]: ideal, variables which have been substituted
327
+ [3]: ideal, i-th element defines substitution of i-th var in [2]
328
+ [4]: ideal of variables of basering, substituted ones are set to 0
329
+ [5]: ideal, describing the map from the basering, say k[x(1..m)], to
330
+ itself onto k[..variables from [4]..] and [1] is the image of i
331
+ @end format
332
+ The ideal i is generated by [1] and [3] in k[x(1..m)], the map [5]
333
+ maps [3] to 0, hence induces an isomorphism
334
+ @format
335
+ k[x(1..m)]/i -> k[..variables from [4]..]/[1]
336
+ @end format
337
+ NOTE: Applying elimpart to interred(i) may result in more substitutions.
338
+ However, interred may be more expansive than elimpart for big ideals
339
+ EXAMPLE: example elimpart; shows an example
340
+ "
341
+ {
342
+ def BAS = basering;
343
+ int n,e = nvars(BAS),1;
344
+ if ( size(#)==1 ) { n=#[1]; }
345
+ if ( size(#)==2 ) { n=#[1]; e=#[2];}
346
+ //----------- interreduce linear part with proc elimlinearpart ----------------
347
+ // lin = ideal i after interreduction with linear part
348
+ // eva = eliminated (substituted) variables
349
+ // sub = polynomials defining substitution
350
+ // neva= not eliminated variables
351
+ // phi = map describing substitution
352
+
353
+ list L = elimlinearpart(i,n);
354
+ ideal lin, eva, sub, neva, phi = L[1], L[2], L[3], L[4], L[5];
355
+ if ( e == 0 )
356
+ {
357
+ return(L);
358
+ }
359
+
360
+ //-------- direct substitution of variables if possible and if e!=0 -----------
361
+ // first find terms lin1 in lin of pure degree 1 in each polynomial of lin
362
+ // k1 = pure degree 1 part, i.e. nonzero elts of lin1, renumbered
363
+ // k2 = lin2 (=matrix(lin) - matrix(lin2)), renumbered
364
+ // kin = matrix(k1)+matrix(k2) = those polys of lin which contained a pure
365
+ // degree 1 part.
366
+ /*
367
+ Alte Version mit interred:
368
+ // Then go to ring newBAS with ordering c,dp(n) and create a matrix with
369
+ // size(k1) columns and 2 rows, such that if [f1,f2] is a column of M then f1+f2
370
+ // is one of the polys of lin containing a pure degree 1 part and f1 is this
371
+ // part interreduce this matrix (i.e. Gauss elimination on linear part, with
372
+ // rest transformed accordingly).
373
+ //Ist jetzt durch direkte Substitution gemacht (schneller!)
374
+ //Variante falls wieder interred angewendet werden soll:
375
+ //ideal k12 = k1,k2;
376
+ //matrix M = matrix(k12,2,kk); //degree 1 part is now in row 1
377
+ //M = interred(M);
378
+ //### interred zu teuer, muss nicht sein. Wenn interred angewendet
379
+ //werden soll, vorher in Ring mit Ordnung (c,dp) wechseln!
380
+ //Abfrage: if( ordstr(BAS) != "c,dp("+string(n)+")" )
381
+ //auf KEINEN Fall std (wird zu gross)
382
+ //l = ncols(M);
383
+ //k1 = M[1,1..l];
384
+ //k2 = M[2,1..l];
385
+ Interred ist jetzt ganz weggelassen. Aber es gibt Beispiele wo interred polys
386
+ mit Grad 1 Teilen produziert, die vorher nicht da waren (aus polys, die einen konstanten Term haben).
387
+ z.B. i=xy2-xu4-x+y2,x2y2+z3+zy,y+z2+1,y+u2;, interred(i)=z2+y+1,y2-x,u2+y,x3-z
388
+ -z ergibt ich auch i[2]-z*i[3] mit option(redThrough)
389
+ statt interred kann man hier auch NF(i,i[3])+i[3] verwenden
390
+ hier lifert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i))
391
+ aber 3 (x,y,z)
392
+ Da interred oder NF aber die Laenge der polys vergroessern kann, nicht gemacht
393
+ */
394
+ int ii, kk;
395
+ ideal k1, k2, lin2;
396
+ int l = ncols(lin); // lin=i after applying elimlinearpart
397
+ ideal lin1 = ideal(matrix(jet(lin,1))-matrix(jet(lin,0))); // part of pure degree 1
398
+ //Note: If i,i1,i2 are ideals, then i = i1 - i2 is equivalent to
399
+ //i = ideal(matrix(i1) - matrix(i2))
400
+
401
+ if (size(lin1) == 0 )
402
+ {
403
+ return(L);
404
+ }
405
+
406
+ //-------- check candidates for direct substitution of variables ----------
407
+ //since lin1 != 0 there are candidates for substituting variables
408
+
409
+ lin2 = matrix(lin) - matrix(lin1); //difference as matrix
410
+ // rest of lin, part of pure degree 1 subtracted from each generator of lin
411
+
412
+ for( ii=1; ii<=l; ii++ )
413
+ {
414
+ if( lin1[ii] != 0 )
415
+ {
416
+ kk = kk+1;
417
+ k1[kk] = lin1[ii]; // part of pure degree 1, renumbered
418
+ k2[kk] = lin2[ii]; // rest of those polys which had a degree 1 part
419
+ lin2[ii] = 0;
420
+ }
421
+ }
422
+ //Now each !=0 generator of lin2 contains only constant terms or terms of
423
+ //degree >= 2, hence lin 2 can never be used for further substitutions
424
+ //We have: lin = ideal(matrix(k1)+matrix(k2)), lin2
425
+
426
+ ideal kin = matrix(k1)+matrix(k2);
427
+ //kin = polys of lin which contained a pure degree 1 part.
428
+ kin = simplify(kin,2);
429
+ l = size(kin); //l != 0 since lin1 != 0
430
+ poly p,kip,vip, cand;
431
+ int count=1;
432
+ while ( count != 0 )
433
+ {
434
+ count = 0;
435
+ for ( ii=1; ii<=n; ii++ ) //start direct substitution of var(ii)
436
+ {
437
+ for (kk=1; kk<=l; kk++ )
438
+ {
439
+ p = kin[kk]/var(ii);
440
+ //if ( deg(p) == 0 )
441
+ //old test, does not work if some var has deg 0
442
+ //geaendert Mai 09 gmg
443
+
444
+ if( p!=0 & p == jet(p,0) )
445
+ //this means that kin[kk]= p*var(ii) + h,
446
+ //with p=const !=0 and h not depending on var(ii)
447
+ {
448
+ //we look for the shortest candidate to substitute var(ii)
449
+ if ( cand == 0 )
450
+ {
451
+ cand = kin[kk]; //candidate for substituting var(ii)
452
+ }
453
+ else
454
+ {
455
+ if ( size(kin[kk]) < size(cand) )
456
+ {
457
+ cand = kin[kk];
458
+ }
459
+ }
460
+ }
461
+ }
462
+ if ( cand != 0 )
463
+ {
464
+ p = cand/var(ii);
465
+ kip = cand/p; //normalized polynomial of kin w.r.t var(ii)
466
+ eva = eva+var(ii); //var(ii) added to list of elimin. vars
467
+ neva[ii] = 0;
468
+ sub = sub+kip; //polynomial defining substitution
469
+ //## gmg: geaendert 08/2008, map durch subst ersetzt
470
+ //(viel schneller)
471
+ vip = var(ii) - kip; //polynomial to be substituted
472
+ lin = subst(lin, var(ii), vip); //subst in rest
473
+ lin = simplify(lin,2);
474
+ kin = subst(kin, var(ii), vip); //subst in pure dgree 1 part
475
+ kin = simplify(kin,2);
476
+ l = size(kin);
477
+ count = 1;
478
+ }
479
+ cand=0;
480
+ }
481
+ }
482
+
483
+ lin = kin+lin;
484
+
485
+ for( ii=1; ii<=size(lin); ii++ )
486
+ {
487
+ lin[ii] = cleardenom(lin[ii]);
488
+ }
489
+
490
+ for( ii=1; ii<=n; ii++ )
491
+ {
492
+ for( kk=1; kk<=size(eva); kk++ )
493
+ {
494
+ if (phi[ii] == eva[kk] )
495
+ { phi[ii] = eva[kk]-sub[kk]; break; }
496
+ }
497
+ }
498
+ map psi = BAS,phi;
499
+ ideal phi1 = maxideal(1);
500
+ for(ii=1; ii<=size(eva); ii++)
501
+ {
502
+ phi1=psi(phi1);
503
+ }
504
+ L = lin, eva, sub, neva, phi1;
505
+ return(L);
506
+ }
507
+ example
508
+ { "EXAMPLE:"; echo = 2;
509
+ ring s=0,(u,x,y,z),dp;
510
+ ideal i = xy2-xu4-x+y2,x2y2+z3+zy,y+z2+1,y+u2;
511
+ elimpart(i);
512
+
513
+ i = interred(i); i;
514
+ elimpart(i);
515
+
516
+ elimpart(i,2);
517
+ }
518
+
519
+ ///////////////////////////////////////////////////////////////////////////////
520
+
521
+ proc elimpartanyr (ideal i, list #)
522
+ "USAGE: elimpartanyr(i [,p,e] ); i=ideal, p=polynomial, e=integer@*
523
+ p: product of vars to be eliminated,@*
524
+ e =0: substitute from linear part of i (same as elimlinearpart)@*
525
+ e!=0: eliminate also by direct substitution@*
526
+ (default: p=product of all vars, e=1)
527
+ RETURN: list of 6 objects:
528
+ @format
529
+ [1]: (interreduced) ideal obtained by substituting from i those vars
530
+ appearing in p, which occur in the linear part of i (or which can
531
+ be expressed directly in the remaining variables, if e!=0)
532
+ [2]: ideal, variables which have been substituted
533
+ [3]: ideal, i-th element defines substitution of i-th var in [2]
534
+ [4]: ideal of variables of basering, substituted ones are set to 0
535
+ [5]: ideal, describing the map from the basering, say k[x(1..m)], to
536
+ itself onto k[..variables fom [4]..] and [1] is the image of i
537
+ [6]: int, # of vars considered for substitution (= # of factors of p)
538
+ @end format
539
+ The ideal i is generated by [1] and [3] in k[x(1..m)], the map [5]
540
+ maps [3] to 0, hence induces an isomorphism
541
+ @format
542
+ k[x(1..m)]/i -> k[..variables fom [4]..]/[1]
543
+ @end format
544
+ NOTE: the procedure creates a ring with ordering dp
545
+ and vars placed correctly and then applies @code{elimpart}.
546
+ EXAMPLE: example elimpartanyr; shows an example
547
+ "
548
+ {
549
+ def P = basering;
550
+ int j,n,e = 0,0,1;
551
+ poly p = product(maxideal(1));
552
+ if ( size(#)==1 ) { p=#[1]; }
553
+ if ( size(#)==2 ) { p=#[1]; e=#[2]; }
554
+ string a,b;
555
+ for ( j=1; j<=nvars(P); j++ )
556
+ {
557
+ if (deg(p/var(j))>=0) { a = a+varstr(j)+","; n = n+1; }
558
+ else { b = b+varstr(j)+","; }
559
+ }
560
+ if ( size(b) != 0 ) { b = b[1,size(b)-1]; }
561
+ else { a = a[1,size(a)-1]; }
562
+ ring gnir = create_ring(ring_list(P)[1], "("+a+b+")", "dp", "no_minpoly");
563
+ ideal i = imap(P,i);
564
+ list L = elimpart(i,n,e)+list(n);
565
+ setring P;
566
+ list L = imap(gnir,L);
567
+ return(L);
568
+ }
569
+ example
570
+ { "EXAMPLE:"; echo = 2;
571
+ ring s=0,(x,y,z),dp;
572
+ ideal i = x3+y2+z,x2y2+z3,y+z+1;
573
+ elimpartanyr(i,z);
574
+ }
575
+ ///////////////////////////////////////////////////////////////////////////////
576
+
577
+ proc fastelim (ideal i, poly p, list #)
578
+ "USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=polynomial; h,o,a,b,e=integers@*
579
+ p: product of variables to be eliminated;@*
580
+ Optional parameters:
581
+ @format
582
+ - h !=0: use Hilbert-series driven std-basis computation
583
+ - o !=0: use proc @code{valvars} for a - hopefully - optimal ordering of vars
584
+ - a !=0: order vars to be eliminated w.r.t. increasing complexity
585
+ - b !=0: order vars not to be eliminated w.r.t. increasing complexity
586
+ - e !=0: use @code{elimpart} first to eliminate easy part
587
+ - m !=0: compute a minimal system of generators
588
+ @end format
589
+ (default: h,o,a,b,e,m = 0,1,0,0,0,0)
590
+ RETURN: ideal obtained from i by eliminating those variables, which occur in p
591
+ EXAMPLE: example fastelim; shows an example.
592
+ "
593
+ {
594
+ def P = basering;
595
+ int h,o,a,b,e,m = 0,1,0,0,0,0;
596
+ if ( size(#) == 1 ) { h=#[1]; }
597
+ if ( size(#) == 2 ) { h=#[1]; o=#[2]; }
598
+ if ( size(#) == 3 ) { h=#[1]; o=#[2]; a=#[3]; }
599
+ if ( size(#) == 4 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4];}
600
+ if ( size(#) == 5 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4]; e=#[5]; }
601
+ if ( size(#) == 6 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4]; e=#[5]; m=#[6]; }
602
+ list L = elimpartanyr(i,p,e);
603
+ poly q = product(L[2]); //product of vars which are already eliminated
604
+ if ( q==0 ) { q=1; }
605
+ p = p/q; //product of vars which must still be eliminated
606
+ int nu = size(L[5])-size(L[2]); //number of vars which must still be eliminated
607
+ if ( p==1 ) //ready if no vars are left
608
+ { //compute minbase if 3-rd argument !=0
609
+ if ( m != 0 ) { L[1]=minbase(L[1]); }
610
+ return(L);
611
+ }
612
+ //---------------- create new ring with remaining variables -------------------
613
+ string newvar = string(L[4]);
614
+ L = L[1],p;
615
+ ring r1 = create_ring(ring_list(P)[1], "("+newvar+")", "dp", "no_minpoly");
616
+ list L = imap(P,L);
617
+ //------------------- find "best" ordering of variables ----------------------
618
+ newvar = string(maxideal(1));
619
+ if ( o != 0 )
620
+ {
621
+ list ordevar = valvars(L[1],a,L[2],b);
622
+ intvec v = ordevar[1];
623
+ newvar=string(sort(maxideal(1),v)[1]);
624
+ //------------ create new ring with "best" ordering of variables --------------
625
+ def r0=changevar(newvar);
626
+ setring r0;
627
+ list L = imap(r1,L);
628
+ kill r1;
629
+ def r1 = r0;
630
+ kill r0;
631
+ }
632
+ //----------------- h==0: eliminate remaining vars directly -------------------
633
+ if ( h == 0 )
634
+ {
635
+ L[1] = eliminate(L[1],L[2]);
636
+ def r2 = r1;
637
+ }
638
+ else
639
+ //------- h!=0: homogenize and compute Hilbert series using hilbvec ----------
640
+ {
641
+ bigintvec hi = hilbvec(L[1]); // Hilbert series of i
642
+ ring r2 = create_ring(ring_list(P)[1], "("+varstr(basering)+",@homo)", "dp", "no_minpoly");
643
+ list L = imap(r1,L);
644
+ L[1] = homog(L[1],@homo); // @homo = homogenizing var
645
+ //---- use Hilbert-series to eliminate variables with Hilbert-driven std -----
646
+ L[1] = eliminate(L[1],L[2],hi);
647
+ L[1]=subst(L[1],@homo,1); // dehomogenize by setting @homo=1
648
+ }
649
+ if ( m != 0 ) // compute minbase
650
+ {
651
+ if ( #[1] != 0 ) { L[1] = minbase(L[1]); }
652
+ }
653
+ def id = L[1];
654
+ setring P;
655
+ return(imap(r2,id));
656
+ }
657
+ example
658
+ { "EXAMPLE:"; echo = 2;
659
+ ring s=31991,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp;
660
+ ideal i = w2+f2-1, x2+t2+a2-1, y2+u2+b2-1, z2+v2+c2-1,
661
+ d2+e2-1, f4+2u, wa+tf, xy+tu+ab;
662
+ fastelim(i,xytua,1,1); //with hilb,valvars
663
+ fastelim(i,xytua,1,0,1); //with hilb,minbase
664
+ }
665
+ ///////////////////////////////////////////////////////////////////////////////
666
+
667
+ proc faststd (def @id, list #)
668
+ "USAGE: faststd(id [,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]);
669
+ id=ideal/module, o=string (allowed:\"lp\",\"dp\",\"Dp\",\"ls\",
670
+ \"ds\",\"Ds\"), \"hilb\",\"sort\",\"dec\",\"block\" options for
671
+ Hilbert-driven std, and the procedure sortandmap
672
+ RETURN: a ring R, in which an ideal STD_id is stored: @*
673
+ - the ring R differs from the active basering only in the choice
674
+ of monomial ordering and in the sorting of the variables.
675
+ - STD_id is a standard basis for the image (under imap) of the input
676
+ ideal/module id with respect to the new monomial ordering. @*
677
+ NOTE: Using the optional input parameters, we may modify the computations
678
+ performed: @*
679
+ - \"hilb\" : use Hilbert-driven standard basis computation@*
680
+ - \"sort\" : use 'sortandmap' for a best sorting of the variables@*
681
+ - \"dec\" : order vars w.r.t. decreasing complexity (with \"sort\")@*
682
+ - \"block\" : create block ordering, each block having ordstr=o, s.t.
683
+ vars of same complexity are in one block (with \"sort\")@*
684
+ - o : defines the basic ordering of the resulting ring@*
685
+ [default: o=ordering of 1st block of basering (if allowed, else o=\"dp\"],
686
+ \"sort\", if none of the optional parameters is given @*
687
+ This procedure is only useful for hard problems where other methods fail.@*
688
+ \"hilb\" is useful for hard orderings (as \"lp\") or for characteristic 0,@*
689
+ it is correct for \"lp\",\"dp\",\"Dp\" (and for block orderings combining
690
+ these) but not for s-orderings or if the vars have different weights.@*
691
+ There seem to be only few cases in which \"dec\" is fast.
692
+ SEE ALSO: groebner
693
+ EXAMPLE: example faststd; shows an example.
694
+ "
695
+ {
696
+ def @P = basering;
697
+ int @h,@s,@n,@m,@ii = 0,0,0,0,0;
698
+ string @o,@va,@c = ordstr(basering),"","";
699
+ //-------------------- prepare ordering and set options -----------------------
700
+ if ( @o[1]=="c" or @o[1]=="C")
701
+ { @o = @o[3,2]; }
702
+ else
703
+ { @o = @o[1,2]; }
704
+ if( @o[1]!="d" and @o[1]!="D" and @o[1]!="l")
705
+ { @o="dp"; }
706
+
707
+ if (size(#) == 0 )
708
+ { @s = 1; }
709
+ for ( @ii=1; @ii<=size(#); @ii++ )
710
+ {
711
+ if ( typeof(#[@ii]) != "string" )
712
+ {
713
+ "// wrong syntax! type: help faststd";
714
+ return();
715
+ }
716
+ else
717
+ {
718
+ if ( #[@ii] == "hilb" ) { @h = 1; }
719
+ if ( #[@ii] == "dec" ) { @n = 1; }
720
+ if ( #[@ii] == "block" ) { @m = 1; }
721
+ if ( #[@ii] == "sort" ) { @s = 1; }
722
+ if ( #[@ii]=="lp" or #[@ii]=="dp" or #[@ii]=="Dp" or #[@ii]=="ls"
723
+ or #[@ii]=="ds" or #[@ii]=="Ds" ) { @o = #[@ii]; }
724
+ }
725
+ }
726
+ if( voice==2 ) { "// chosen options, hilb sort dec block:",@h,@s,@n,@m; }
727
+
728
+ //-------------------- nosort: create ring with new name ----------------------
729
+ if ( @s==0 )
730
+ {
731
+ ring @S1 = create_ring(ring_list(@P)[1], "("+varstr(@P)+")", "("+@o+")", "no_minpoly");
732
+ def STD_id = imap(@P,@id);
733
+ if ( @h==0 ) { STD_id = std(STD_id); }
734
+ }
735
+
736
+ //---------------------- no hilb: compute SB directly -------------------------
737
+ if ( @s != 0 and @h == 0 )
738
+ {
739
+ intvec getoption = option(get);
740
+ option(redSB);
741
+ @id = interred(sort(@id)[1]);
742
+ poly @p = product(maxideal(1),1..nvars(@P));
743
+ def @S1=sortandmap(@id,@n,@p,0,@o,@m);
744
+ setring @S1;
745
+ option(set,getoption);
746
+ def STD_id=imap(@S1,IMAG);
747
+ STD_id = std(STD_id);
748
+ }
749
+ //------- hilb: homogenize and compute Hilbert-series using hilbvec -----------
750
+ // this uses another standardbasis computation
751
+ if ( @h != 0 )
752
+ {
753
+ ring @Q = create_ring(ring_list(@P)[1], "("+varstr(@P)+",@homo)", "("+@o+")", "no_minpoly");
754
+ def @id = imap(@P,@id);
755
+ @id = homog(@id,@homo); // @homo = homogenizing var
756
+ if ( @s != 0 )
757
+ {
758
+ intvec getoption = option(get);
759
+ option(redSB);
760
+ @id = interred(sort(@id)[1]);
761
+ poly @p = product(maxideal(1),1..(nvars(@Q)-1));
762
+ def @S1=sortandmap(@id,@n,@p,0,@o,@m);
763
+ setring @S1;
764
+ option(set,getoption);
765
+ kill @Q;
766
+ def @Q= basering;
767
+ def @id = IMAG;
768
+ }
769
+ intvec @hi; // encoding of Hilbert-series of i
770
+ @hi = hilbvec(@id);
771
+ //if ( @s!=0 ) { @hi = hilbvec(@id,"32003",ordstr(@Q)); }
772
+ //else { @hi = hilbvec(@id); }
773
+ //-------------------------- use Hilbert-driven std --------------------------
774
+ @id = std(@id,@hi);
775
+ @id = subst(@id,@homo,1); // dehomogenize by setting @homo=1
776
+ @va = varstr(@Q)[1,size(varstr(@Q))-6];
777
+ if ( @s!=0 )
778
+ {
779
+ @o = ordstr(@Q);
780
+ if ( @o[1]=="c" or @o[1]=="C") { @o = @o[1,size(@o)-6]; }
781
+ else { @o = @o[1,size(@o)-8] + @o[size(@o)-1,2]; }
782
+ }
783
+ kill @S1;
784
+ ring @S1 = create_ring(ring_list(@Q)[1], "("+@va+")", "("+@o+")", "no_minpoly");
785
+ def STD_id = imap(@Q,@id);
786
+ }
787
+ attrib(STD_id,"isSB",1);
788
+ export STD_id;
789
+ if (defined(IMAG)) { kill IMAG; }
790
+ setring @P;
791
+ dbprint(printlevel-voice+3,"
792
+ // 'faststd' created a ring, in which an object STD_id is stored.
793
+ // To access the object, type (if the name R was assigned to the return value):
794
+ setring R; STD_id; ");
795
+ return(@S1);
796
+ }
797
+ example
798
+ { "EXAMPLE:"; echo = 2;
799
+ system("--ticks-per-sec",100); // show time in 1/100 sec
800
+ ring s = 0,(e,f,x,y,z,t,u,v,w,a,b,c,d),(c,lp);
801
+ ideal i = w2+f2-1, x2+t2+a2-1, y2+u2+b2-1, z2+v2+c2-1,
802
+ d2+e2-1, f4+2u, wa+tf, xy+tu+ab;
803
+ option(prot); timer=1;
804
+ int time = timer;
805
+ ideal j=std(i);
806
+ timer-time;
807
+ dim(j),mult(j);
808
+
809
+ time = timer;
810
+ def R=faststd(i); // use "best" ordering of vars
811
+ timer-time;
812
+ show(R);setring R;dim(STD_id),mult(STD_id);
813
+
814
+ setring s;kill R;time = timer;
815
+ def R=faststd(i,"hilb"); // hilb-std only
816
+ timer-time;
817
+ show(R);setring R;dim(STD_id),mult(STD_id);
818
+
819
+ setring s;kill R;time = timer;
820
+ def R=faststd(i,"hilb","sort"); // hilb-std,"best" ordering
821
+ timer-time;
822
+ show(R);setring R;dim(STD_id),mult(STD_id);
823
+
824
+ setring s;kill R;time = timer;
825
+ def R=faststd(i,"hilb","sort","block","dec"); // hilb-std,"best",blocks
826
+ timer-time;
827
+ show(R);setring R;dim(STD_id),mult(STD_id);
828
+
829
+ setring s;kill R;time = timer;
830
+ timer-time;time = timer;
831
+ def R=faststd(i,"sort","block","Dp"); //"best",decreasing,Dp-blocks
832
+ timer-time;
833
+ show(R);setring R;dim(STD_id),mult(STD_id);
834
+ }
835
+ ///////////////////////////////////////////////////////////////////////////////
836
+
837
+ proc findvars(def id, list #)
838
+ "USAGE: findvars(id ); id=poly/ideal/vector/module/matrix
839
+ RETURN: list L with 4 entries:
840
+ @format
841
+ L[1]: ideal of variables occurring in id
842
+ L[2]: intvec of variables occurring in id
843
+ L[3]: ideal of variables not occurring in id
844
+ L[4]: intvec of variables not occurring in id
845
+ @end format
846
+ SEE ALSO: variables
847
+ EXAMPLE: example findvars; shows an example
848
+ "
849
+ {
850
+ int ii,n;
851
+ ideal found, notfound;
852
+ intvec f,nf;
853
+ n = nvars(basering);
854
+ ideal i = simplify(ideal(matrix(id)),10);
855
+ matrix M[ncols(i)][1] = i;
856
+ vector v = module(M)[1];
857
+ ideal max = maxideal(1);
858
+
859
+ for (ii=1; ii<=n; ii++)
860
+ {
861
+ if ( v != subst(v,var(ii),0) )
862
+ {
863
+ found = found+var(ii);
864
+ f = f,ii;
865
+ }
866
+ else
867
+ {
868
+ notfound = notfound+var(ii);
869
+ nf = nf,ii;
870
+ }
871
+ }
872
+ if ( size(f)>1 ) { f = f[2..size(f)]; } //intvec of found vars
873
+ if ( size(nf)>1 ) { nf = nf[2..size(nf)]; } //intvec of vars not found
874
+ list L = found,f,notfound,nf; return(L);
875
+ }
876
+ example
877
+ { "EXAMPLE:"; echo = 2;
878
+ ring s = 0,(e,f,x,y,t,u,v,w,a,d),dp;
879
+ ideal i = w2+f2-1, x2+t2+a2-1;
880
+ findvars(i);
881
+ }
882
+ ///////////////////////////////////////////////////////////////////////////////
883
+
884
+ proc hilbvec (def @id, list #)
885
+ "USAGE: hilbvec(id[,c,o]); id=poly/ideal/vector/module/matrix, c,o=strings,@*
886
+ c=char, o=ordering used by @code{hilb} (default: c=\"32003\", o=\"dp\")
887
+ RETURN: bigintvec of 1st Hilbert-series of id, computed in char c and ordering o
888
+ NOTE: id must be homogeneous (i.e. all vars have weight 1)
889
+ EXAMPLE: example hilbvec; shows an example
890
+ "
891
+ {
892
+ def @P = basering;
893
+ string @c,@o = "32003", "dp";
894
+ if ( size(#) == 1 ) { @c = #[1]; }
895
+ if ( size(#) == 2 ) { @c = #[1]; @o = #[2]; }
896
+ ring @r = create_ring("("+@c+")", "("+varstr(basering)+")", "("+@o+")");
897
+ def @i = imap(@P,@id);
898
+ //show(basering);
899
+ @i = std(@i);
900
+ bigintvec @hi = hilb(@i,1); // intvec of 1-st Hilbert-series of id
901
+ return(@hi);
902
+ }
903
+ example
904
+ { "EXAMPLE:"; echo = 2;
905
+ ring s = 0,(e,f,x,y,z,t,u,v,w,a,b,c,d,H),dp;
906
+ ideal id = w2+f2-1, x2+t2+a2-1, y2+u2+b2-1, z2+v2+c2-1,
907
+ d2+e2-1, f4+2u, wa+tf, xy+tu+ab;
908
+ id = homog(id,H);
909
+ hilbvec(id);
910
+ }
911
+ ///////////////////////////////////////////////////////////////////////////////
912
+
913
+ proc tolessvars (def id ,list #)
914
+ "USAGE: tolessvars(id [,s1,s2] ); id poly/ideal/vector/module/matrix,
915
+ s1=string (new ordering)@*
916
+ [default: s1=\"dp\" or \"ds\" depending on whether the first block
917
+ of the old ordering is a p- or an s-ordering, respectively]
918
+ RETURN: If id contains all vars of the basering: empty list. @*
919
+ Else: ring R with the same char as the basering, but possibly less
920
+ variables (only those variables which actually occur in id). In R
921
+ an object IMAG (image of id under imap) is stored.
922
+ DISPLAY: If printlevel >=0, display ideal of vars, which have been omitted
923
+ from the old ring.
924
+ EXAMPLE: example tolessvars; shows an example
925
+ "
926
+ {
927
+ //---------------- initialisation and check occurrence of vars -----------------
928
+ int s,ii,n,fp,fs;
929
+ string s2,newvar;
930
+ int pr = printlevel-voice+3; // p = printlevel+1 (default: p=1)
931
+ def P = basering;
932
+ s2 = ordstr(P);
933
+
934
+ list L = findvars(id,1);
935
+ newvar = string(L[1]); // string of new variables
936
+ n = size(L[1]); // number of new variables
937
+ if( n == 0 )
938
+ {
939
+ dbprint( pr,"","// no variable occurred in "+typeof(id)+", no change of ring!");
940
+ return(id);
941
+ }
942
+ if( n == nvars(P) )
943
+ {
944
+ dbprint(printlevel-voice+3,"
945
+ // All variables appear in input object.
946
+ // empty list returned. ");
947
+ return(list());
948
+ }
949
+ //----------------- prepare new ring, map to it and return --------------------
950
+ if ( size(#) == 0 )
951
+ {
952
+ fp = find(s2,"p");
953
+ fs = find(s2,"s");
954
+ if( fs==0 or (fs>=fp && fp!=0) ) { s2="dp"; }
955
+ else { s2="ds"; }
956
+ }
957
+ if ( size(#) ==1 ) { s2=#[1]; }
958
+ dbprint( pr,"","// variables which did not occur:",L[3] );
959
+ ring S1 = create_ring(ring_list(P)[1], "("+newvar+")", "("+s2+")", "no_minpoly");
960
+ def IMAG = imap(P,id);
961
+ export IMAG;
962
+ dbprint(printlevel-voice+3,"
963
+ // 'tolessvars' created a ring, in which an object IMAG is stored.
964
+ // To access the object, type (if the name R was assigned to the return value):
965
+ setring R; IMAG; ");
966
+ return(S1);
967
+ }
968
+ example
969
+ { "EXAMPLE:"; echo = 2;
970
+ ring r = 0,(x,y,z),dp;
971
+ ideal i = y2-x3,x-3,y-2x;
972
+ def R_r = tolessvars(i,"lp");
973
+ setring R_r;
974
+ show(basering);
975
+ IMAG;
976
+ kill R_r;
977
+ }
978
+ ///////////////////////////////////////////////////////////////////////////////
979
+
980
+ proc solvelinearpart (def id,list #)
981
+ "USAGE: solvelinearpart(id [,n] ); id=ideal/module, n=integer (default: n=0)
982
+ RETURN: (interreduced) generators of id of degree <=1 in reduced triangular
983
+ form if n=0 [non-reduced triangular form if n!=0]
984
+ ASSUME: monomial ordering is a global ordering (p-ordering)
985
+ NOTE: may be used to solve a system of linear equations,
986
+ see @code{gauss_row} from 'matrix.lib' for a different method
987
+ WARNING: the result is very likely to be false for 'real' coefficients, use
988
+ char 0 instead!
989
+ EXAMPLE: example solvelinearpart; shows an example
990
+ "
991
+ {
992
+ intvec getoption = option(get);
993
+ option(redSB);
994
+ if ( size(#)!=0 )
995
+ {
996
+ if(#[1]!=0) { option(noredSB); }
997
+ }
998
+ def lin = interred(degreepart(id,0,1)[1]);
999
+ if ( size(#)!=0 )
1000
+ {
1001
+ if(#[1]!=0)
1002
+ {
1003
+ return(lin);
1004
+ }
1005
+ }
1006
+ option(set,getoption);
1007
+ return(simplify(lin,1));
1008
+ }
1009
+ example
1010
+ { "EXAMPLE:"; echo = 2;
1011
+ // Solve the system of linear equations:
1012
+ // 3x + y + z - u = 2
1013
+ // 3x + 8y + 6z - 7u = 1
1014
+ // 14x + 10y + 6z - 7u = 0
1015
+ // 7x + 4y + 3z - 3u = 3
1016
+ ring r = 0,(x,y,z,u),lp;
1017
+ ideal i= 3x + y + z - u,
1018
+ 13x + 8y + 6z - 7u,
1019
+ 14x + 10y + 6z - 7u,
1020
+ 7x + 4y + 3z - 3u;
1021
+ ideal j= 2,1,0,3;
1022
+ j = matrix(i)-matrix(j); // difference of 1x4 matrices
1023
+ // compute reduced triangular form, setting
1024
+ solvelinearpart(j); // the RHS equal 0 gives the solutions!
1025
+ solvelinearpart(j,1); ""; // triangular form, not reduced
1026
+ }
1027
+ ///////////////////////////////////////////////////////////////////////////////
1028
+
1029
+ proc sortandmap (def @id, list #)
1030
+ "USAGE: sortandmap(id [,n1,p1,n2,p2...,o1,m1,o2,m2...]);@*
1031
+ id=poly/ideal/vector/module,@*
1032
+ p1,p2,...= polynomials (product of variables),@*
1033
+ n1,n2,...= integers,@*
1034
+ o1,o2,...= strings,@*
1035
+ m1,m2,...= integers@*
1036
+ (default: p1=product of all vars, n1=0, o1=\"dp\",m1=0)
1037
+ the last pi (containing the remaining vars) may be omitted
1038
+ RETURN: a ring R, in which a poly/ideal/vector/module IMAG is stored: @*
1039
+ - the ring R differs from the active basering only in the choice
1040
+ of monomial ordering and in the sorting of the variables.@*
1041
+ - IMAG is the image (under imap) of the input ideal/module id @*
1042
+ The new monomial ordering and sorting of vars is as follows:
1043
+ @format
1044
+ - each block of vars occurring in pi is sorted w.r.t. its complexity in id,
1045
+ - ni controls the sorting in i-th block (= vars occurring in pi):
1046
+ ni=0 (resp. ni!=0) means that least complex (resp. most complex) vars come
1047
+ first
1048
+ - oi and mi define the monomial ordering of the i-th block:
1049
+ if mi =0, oi=ordstr(i-th block)
1050
+ if mi!=0, the ordering of the i-th block itself is a blockordering,
1051
+ each subblock having ordstr=oi, such that vars of same complexity are
1052
+ in one block
1053
+ @end format
1054
+ Note that only simple ordstrings oi are allowed: \"lp\",\"dp\",\"Dp\",
1055
+ \"ls\",\"ds\",\"Ds\". @*
1056
+ NOTE: We define a variable x to be more complex than y (with respect to id)
1057
+ if val(x) > val(y) lexicographically, where val(x) denotes the
1058
+ valuation vector of x:@*
1059
+ consider id as list of polynomials in x with coefficients in the
1060
+ remaining variables. Then:@*
1061
+ val(x) = (maximal occurring power of x, # of all monomials in leading
1062
+ coefficient, # of all monomials in coefficient of next smaller power
1063
+ of x,...).
1064
+ EXAMPLE: example sortandmap; shows an example
1065
+ "
1066
+ {
1067
+ def @P = basering;
1068
+ int @ii,@jj;
1069
+ intvec @v;
1070
+ string @o;
1071
+ //----------------- find o in # and split # into 2 lists ---------------------
1072
+ # = # +list("dp",0);
1073
+ for ( @ii=1; @ii<=size(#); @ii++)
1074
+ {
1075
+ if ( typeof(#[@ii])=="string" ) break;
1076
+ }
1077
+ if ( @ii==1 ) { list @L1 = list(); }
1078
+ else { list @L1 = #[1..@ii-1]; }
1079
+ list @L2 = #[@ii..size(#)];
1080
+ list @L = sortvars(@id,@L1);
1081
+ string @va = string(@L[1]);
1082
+ list @l = @L[2]; //e.g. @l[4]=intvec describing permutation of 1-st block
1083
+ //----------------- construct correct ordering with oi and mi ----------------
1084
+ for ( @ii=4; @ii<=size(@l); @ii=@ii+4 )
1085
+ {
1086
+ @L2=@L2+list("dp",0);
1087
+ if ( @L2[@ii div 2] != 0)
1088
+ {
1089
+ @v = @l[@ii];
1090
+ for ( @jj=1; @jj<=size(@v); @jj++ )
1091
+ {
1092
+ @o = @o+@L2[@ii div 2 -1]+"("+string(@v[@jj])+"),";
1093
+ }
1094
+ }
1095
+ else
1096
+ {
1097
+ @o = @o+@L2[@ii div 2 -1]+"("+string(size(@l[@ii]))+"),";
1098
+ }
1099
+ }
1100
+ @o=@o[1..size(@o)-1];
1101
+ ring @S1 = create_ring(ring_list(@P)[1], "("+@va+")", "("+@o+")", "no_minpoly");
1102
+ def IMAG = imap(@P,@id);
1103
+ export IMAG;
1104
+ dbprint(printlevel-voice+3,"
1105
+ // 'sortandmap' created a ring, in which an object IMAG is stored.
1106
+ // To access the object, type (if the name R was assigned to the return value):
1107
+ setring R; IMAG; ");
1108
+ return(@S1);
1109
+ }
1110
+ example
1111
+ { "EXAMPLE:"; echo = 2;
1112
+ ring s = 32003,(x,y,z),dp;
1113
+ ideal i=x3+y2,xz+z2;
1114
+ def R_r=sortandmap(i);
1115
+ show(R_r);
1116
+ setring R_r; IMAG;
1117
+ kill R_r; setring s;
1118
+ def R_r=sortandmap(i,1,xy,0,z,0,"ds",0,"lp",0);
1119
+ show(R_r);
1120
+ setring R_r; IMAG;
1121
+ kill R_r;
1122
+ }
1123
+ ///////////////////////////////////////////////////////////////////////////////
1124
+
1125
+ proc sortvars (def id, list #)
1126
+ "USAGE: sortvars(id[,n1,p1,n2,p2,...]);@*
1127
+ id=poly/ideal/vector/module,@*
1128
+ p1,p2,...= polynomials (product of vars),@*
1129
+ n1,n2,...= integers@*
1130
+ (default: p1=product of all vars, n1=0)
1131
+ the last pi (containing the remaining vars) may be omitted
1132
+ COMPUTE: sort variables with respect to their complexity in id
1133
+ RETURN: list of two elements, an ideal and a list:
1134
+ @format
1135
+ [1]: ideal, variables of basering sorted w.r.t their complexity in id
1136
+ ni controls the ordering in i-th block (= vars occurring in pi):
1137
+ ni=0 (resp. ni!=0) means that less (resp. more) complex vars come first
1138
+ [2]: a list with 4 entries for each pi:
1139
+ _[1]: ideal ai : vars of pi in correct order,
1140
+ _[2]: intvec vi: permutation vector describing the ordering in ai,
1141
+ _[3]: intmat Mi: valuation matrix of ai, the columns of Mi being the
1142
+ valuation vectors of the vars in ai
1143
+ _[4]: intvec wi: size of 1-st, 2-nd,... block of identical columns of Mi
1144
+ (vars with same valuation)
1145
+ @end format
1146
+ NOTE: We define a variable x to be more complex than y (with respect to id)
1147
+ if val(x) > val(y) lexicographically, where val(x) denotes the
1148
+ valuation vector of x:@*
1149
+ consider id as list of polynomials in x with coefficients in the
1150
+ remaining variables. Then:@*
1151
+ val(x) = (maximal occurring power of x, # of all monomials in leading
1152
+ coefficient, # of all monomials in coefficient of next smaller power
1153
+ of x,...).
1154
+ EXAMPLE: example sortvars; shows an example
1155
+ "
1156
+ {
1157
+ int ii,jj,n,s;
1158
+ list L = valvars(id,#);
1159
+ list L2, L3 = L[2], L[3];
1160
+ list K; intmat M; intvec v1,v2,w;
1161
+ ideal i = sort(maxideal(1),L[1])[1];
1162
+ for ( ii=1; ii<=size(L2); ii++ )
1163
+ {
1164
+ M = transpose(L3[2*ii]);
1165
+ M = M[L2[ii],1..nrows(L3[2*ii])];
1166
+ w = 0; s = 0;
1167
+ for ( jj=1; jj<=nrows(M)-1; jj++ )
1168
+ {
1169
+ v1 = M[jj,1..ncols(M)];
1170
+ v2 = M[jj+1,1..ncols(M)];
1171
+ if ( v1 != v2 ) { n=jj-s; s=s+n; w = w,n; }
1172
+ }
1173
+ w=w,nrows(M)-s; w=w[2..size(w)];
1174
+ K = K+sort(L3[2*ii-1],L2[ii])+list(transpose(M))+list(w);
1175
+ }
1176
+ L = i,K;
1177
+ return(L);
1178
+ }
1179
+ example
1180
+ { "EXAMPLE:"; echo = 2;
1181
+ ring s=0,(x,y,z,w),dp;
1182
+ ideal i = x3+y2+yw2,xz+z2,xyz-w2;
1183
+ sortvars(i,0,xy,1,zw);
1184
+ }
1185
+ ///////////////////////////////////////////////////////////////////////////////
1186
+
1187
+ proc valvars (def id, list #)
1188
+ "USAGE: valvars(id[,n1,p1,n2,p2,...]);@*
1189
+ id=poly/ideal/vector/module,@*
1190
+ p1,p2,...= polynomials (product of vars),@*
1191
+ n1,n2,...= integers,
1192
+
1193
+ ni controls the ordering of vars occurring in pi: ni=0 (resp. ni!=0)
1194
+ means that less (resp. more) complex vars come first (default: p1=product of all vars, n1=0),@*
1195
+ the last pi (containing the remaining vars) may be omitted
1196
+ COMPUTE: valuation (complexity) of variables with respect to id.@*
1197
+ ni controls the ordering of vars occurring in pi:@*
1198
+ ni=0 (resp. ni!=0) means that less (resp. more) complex vars come first.
1199
+ RETURN: list with 3 entries:
1200
+ @format
1201
+ [1]: intvec, say v, describing the permutation such that the permuted
1202
+ ring variables are ordered with respect to their complexity in id
1203
+ [2]: list of intvecs, i-th intvec, say v(i) describing permutation
1204
+ of vars in a(i) such that v=v(1),v(2),...
1205
+ [3]: list of ideals and intmat's, say a(i) and M(i), where
1206
+ a(i): factors of pi,
1207
+ M(i): valuation matrix of a(i), such that the j-th column of M(i)
1208
+ is the valuation vector of j-th generator of a(i)
1209
+ @end format
1210
+ NOTE: Use @code{sortvars} in order to actually sort the variables!
1211
+ We define a variable x to be more complex than y (with respect to id)
1212
+ if val(x) > val(y) lexicographically, where val(x) denotes the
1213
+ valuation vector of x:@*
1214
+ consider id as list of polynomials in x with coefficients in the
1215
+ remaining variables. Then:@*
1216
+ val(x) = (maximal occurring power of x, # of all monomials in leading
1217
+ coefficient, # of all monomials in coefficient of next smaller power
1218
+ of x,...).
1219
+ EXAMPLE: example valvars; shows an example
1220
+ "
1221
+ {
1222
+ //---------------------------- initialization ---------------------------------
1223
+ int ii,jj,kk,n;
1224
+ list L; // list of valuation vectors in one block
1225
+ intvec vec; // describes permutation of vars (in one block)
1226
+ list blockvec; // i-th element = vec of i-th block
1227
+ intvec varvec; // result intvector
1228
+ list Li; // result list of ideals
1229
+ list LM; // result list of intmat's
1230
+ intvec v,w,s; // w valuation vector for one variable
1231
+ matrix C; // coefficient matrix for different variables
1232
+ ideal i = simplify(ideal(matrix(id)),10);
1233
+
1234
+ //---- for each pii in # create ideal a(ii) intvec v(ii) and list L(ii) -------
1235
+ // a(ii) = ideal of vars in product, v(ii)[j]=k <=> a(ii)[j]=var(k)
1236
+
1237
+ v = 1..nvars(basering);
1238
+ int l = size(#);
1239
+ if ( l >= 2 )
1240
+ {
1241
+ ideal m=maxideal(1);
1242
+ for ( ii=2; ii<=l; ii=ii+2 )
1243
+ {
1244
+ int n(ii) = #[ii-1];
1245
+ ideal a(ii);
1246
+ intvec v(ii);
1247
+ for ( jj=1; jj<=nvars(basering); jj++ )
1248
+ {
1249
+ if ( #[ii]/var(jj) != 0)
1250
+ {
1251
+ a(ii) = a(ii) + var(jj);
1252
+ v(ii)=v(ii),jj;
1253
+ m[jj]=0;
1254
+ v[jj]=0;
1255
+ }
1256
+ }
1257
+ v(ii)=v(ii)[2..size(v(ii))];
1258
+ }
1259
+ if ( size(m)!=0 )
1260
+ {
1261
+ l = 2*(l div 2)+2;
1262
+ ideal a(l) = simplify(m,2);
1263
+ intvec v(l) = compress(v);
1264
+ int n(l);
1265
+ if ( size(#)==l-1 ) { n(l) = #[l-1]; }
1266
+ }
1267
+ }
1268
+ else
1269
+ {
1270
+ l = 2;
1271
+ ideal a(2) = maxideal(1);
1272
+ intvec v(2) = v;
1273
+ int n(2);
1274
+ if ( size(#)==1 ) { n(2) = #[1]; }
1275
+ }
1276
+ //------------- start loop to order variables in each a(ii) -------------------
1277
+
1278
+ for ( kk=2; kk<=l; kk=kk+2 )
1279
+ {
1280
+ L = list();
1281
+ n = 0;
1282
+ //---------------- get valuation of all variables in a(kk) --------------------
1283
+ for ( ii=1; ii<=size(a(kk)); ii++ )
1284
+ {
1285
+ C = coeffs(i,a(kk)[ii]);
1286
+ w = nrows(C); // =(maximal occurring power of a(kk)[ii])+1
1287
+ for ( jj=w[1]; jj>1; jj-- )
1288
+ {
1289
+ s = size(C[jj,1..ncols(C)]);
1290
+ w[w[1]-jj+2] = sum(s);
1291
+ }
1292
+ // w[1] should represent the maximal occurring power of a(kk)[ii] so it
1293
+ // has to be decreased by 1 since otherwise the constant term is also
1294
+ // counted
1295
+ w[1]=w[1]-1;
1296
+
1297
+ L[ii]=w;
1298
+ n = size(w)*(size(w) > n) + n*(size(w) <= n);
1299
+ }
1300
+ intmat M(kk)[size(a(kk))][n];
1301
+ for ( ii=1; ii<=size(a(kk)); ii++ )
1302
+ {
1303
+ if ( n==1 ) { w = L[ii]; M(kk)[ii,1] = w[1]; }
1304
+ else { M(kk)[ii,1..n] = L[ii]; }
1305
+ }
1306
+ LM[kk-1] = a(kk);
1307
+ LM[kk] = transpose(compress(M(kk)));
1308
+ //------------------- compare valuation and insert in vec ---------------------
1309
+ vec = sort(L)[2];
1310
+ if ( n(kk) != 0 ) { vec = vec[size(vec)..1]; }
1311
+ blockvec[kk div 2] = vec;
1312
+ vec = sort(v(kk),vec)[1];
1313
+ varvec = varvec,vec;
1314
+ }
1315
+ varvec = varvec[2..size(varvec)];
1316
+ list result = varvec,blockvec,LM;
1317
+ return(result);
1318
+ }
1319
+ example
1320
+ { "EXAMPLE:"; echo = 2;
1321
+ ring s=0,(x,y,z,a,b),dp;
1322
+ ideal i=ax2+ay3-b2x,abz+by2;
1323
+ valvars (i,0,xyz);
1324
+ }
1325
+ ///////////////////////////////////////////////////////////////////////////////
1326
+ proc idealSplit(ideal I,list #)
1327
+ "USAGE: idealSplit(id,timeF,timeS); id ideal and optional
1328
+ timeF, timeS integers to bound the time which can be used
1329
+ for factorization resp. standard basis computation
1330
+ RETURN: a list of ideals such that their intersection
1331
+ has the same radical as id
1332
+ EXAMPLE: example idealSplit; shows an example
1333
+ "
1334
+ {
1335
+ option(redSB);
1336
+ int j,k,e;
1337
+ int i=1;
1338
+ int l=attrib(I,"isSB");
1339
+ ideal J;
1340
+ int timeF;
1341
+ int timeS;
1342
+ list re,fac,te;
1343
+
1344
+ if(size(#)==1)
1345
+ {
1346
+ if(typeof(#[1])=="ideal")
1347
+ {
1348
+ re=#;
1349
+ }
1350
+ else
1351
+ {
1352
+ timeF=#[1];
1353
+ }
1354
+ }
1355
+ if(size(#)==2)
1356
+ {
1357
+ if(typeof(#[1])=="list")
1358
+ {
1359
+ re=#[1];
1360
+ timeF=#[2];
1361
+ }
1362
+ else
1363
+ {
1364
+ timeF=#[1];
1365
+ timeS=#[2];
1366
+ }
1367
+ }
1368
+ if(size(#)==3){re=#[1];timeF=#[2];timeS=#[3];}
1369
+
1370
+ fac=timeFactorize(I[1],timeF);
1371
+
1372
+ while((size(fac[1])==2)&&(i<size(I)))
1373
+ {
1374
+ i++;
1375
+ fac=timeFactorize(I[i],timeF);
1376
+ }
1377
+ if(size(fac[1])>2)
1378
+ {
1379
+ for(j=2;j<=size(fac[1]);j++)
1380
+ {
1381
+ I[i]=fac[1][j];
1382
+ attrib(I,"isSB",1);
1383
+ e=1;
1384
+ k=0;
1385
+ while(k<size(re))
1386
+ {
1387
+ k++;
1388
+ if(size(reduce(re[k],I,5))==0){e=0;break;}
1389
+ attrib(re[k],"isSB",1);
1390
+ if(size(reduce(I,re[k],5))==0){re=delete(re,k);k--;}
1391
+ }
1392
+ if(e)
1393
+ {
1394
+ if(l)
1395
+ {
1396
+ J=I;
1397
+ J[i]=0;
1398
+ J=simplify(J,2);
1399
+ attrib(J,"isSB",1);
1400
+ re=idealSplit(std(J,fac[1][j]),re,timeF,timeS);
1401
+ }
1402
+ else
1403
+ {
1404
+ re=idealSplit(timeStd(I,timeS),re,timeF,timeS);
1405
+ }
1406
+ }
1407
+ }
1408
+ return(re);
1409
+ }
1410
+ J=timeStd(I,timeS);
1411
+ attrib(I,"isSB",1);
1412
+ if(size(reduce(J,I,5))==0){return(re+list(I));}
1413
+ return(re+idealSplit(J,re,timeF,timeS));
1414
+ }
1415
+ example
1416
+ { "EXAMPLE:"; echo = 2;
1417
+ ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
1418
+ ideal i=
1419
+ bv+su,
1420
+ bw+tu,
1421
+ sw+tv,
1422
+ by+sx,
1423
+ bz+tx,
1424
+ sz+ty,
1425
+ uy+vx,
1426
+ uz+wx,
1427
+ vz+wy,
1428
+ bvz;
1429
+ idealSplit(i);
1430
+ }
1431
+ ///////////////////////////////////////////////////////////////////////////////
1432
+ proc idealSimplify(ideal J,list #)
1433
+ "USAGE: idealSimplify(id); id ideal
1434
+ RETURN: ideal I = eliminate(Id,m) m is a product of variables
1435
+ which are only linearly involved in the generators of id
1436
+ EXAMPLE: example idealSimplify; shows an example
1437
+ "
1438
+ {
1439
+ ideal I=J;
1440
+ if(size(#)!=0){I=#[1];}
1441
+ def R=basering;
1442
+ matrix M=jacob(I);
1443
+ ideal ma=maxideal(1);
1444
+ int i,j,k;
1445
+ map phi;
1446
+
1447
+ for(i=1;i<=nrows(M);i++)
1448
+ {
1449
+ for(j=1;j<=ncols(M);j++)
1450
+ {
1451
+ if(deg(M[i,j])==0)
1452
+ {
1453
+ ma[j]=(-1/M[i,j])*(I[i]-M[i,j]*var(j));
1454
+ phi=R,ma;
1455
+ I=phi(I);
1456
+ J=phi(J);
1457
+ for(k=1;k<=ncols(I);k++){I[k]=cleardenom(I[k]);}
1458
+ M=jacob(I);
1459
+ }
1460
+ }
1461
+ }
1462
+ J=simplify(J,2);
1463
+ for(i=1;i<=size(J);i++){J[i]=cleardenom(J[i]);}
1464
+ return(J);
1465
+ }
1466
+ example
1467
+ { "EXAMPLE:"; echo = 2;
1468
+ ring r=0,(x,y,z,w,t),dp;
1469
+ ideal i=
1470
+ t,
1471
+ x3+y2+2z,
1472
+ x2+3y,
1473
+ x2+y2+z2,
1474
+ w2+z;
1475
+ ideal j=idealSimplify(i);
1476
+ ideal k=eliminate(i,zyt);
1477
+ reduce(k,std(j));
1478
+ reduce(j,std(k));
1479
+ }
1480
+
1481
+ ///////////////////////////////////////////////////////////////////////////////
1482
+
1483
+ /*
1484
+
1485
+ ring s=31991,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp;
1486
+ ring s=31991,(x,y,z,t,u,v,w,a,b,c,d,f,e,h),dp; //standard
1487
+ ring s1=31991,(y,u,b,c,a,z,t,x,v,d,w,e,f,h),dp; //gut
1488
+ v;
1489
+ 13,12,11,10,8,7,6,5,4,3,2,1,9,14
1490
+ print(matrix(sort(maxideal(1),v)));
1491
+ f,e,w,d,x,t,z,a,c,b,u,y,v,h
1492
+ print(matrix(maxideal(1)));
1493
+ y,u,b,c,a,z,t,x,v,d,w,e,f,h
1494
+ v0;
1495
+ 14,9,12,11,10,8,7,6,5,4,3,2,1,13
1496
+ print(matrix(sort(maxideal(1),v0)));
1497
+ h,v,e,w,d,x,t,z,a,c,b,u,y,f
1498
+ v1;v2;
1499
+ 9,12,11,10,8,7,6,5,4,3,2,1,13,14
1500
+ 13,12,11,10,8,7,6,5,4,3,2,1,9,14
1501
+
1502
+ Ev. Gute Ordnung fuer i:
1503
+ ========================
1504
+ i=ad*x^d+ad-1*x^(d-1)+...+a1*x+a0, ad!=0
1505
+ mit ar=(ar1,...,ark), k=size(i)
1506
+ arj in K[..x^..]
1507
+ d=deg_x(i) := max{deg_x(i[k]) | k=1..size(i)}
1508
+ size_x(i,deg_x(i)..0) := size(ad),...,size(a0)
1509
+ x>y <==
1510
+ 1. deg_x(i)>deg_y(i)
1511
+ 2. "=" in 1. und size_x lexikographisch
1512
+
1513
+ hier im Beispiel:
1514
+ f: 5,1,0,1,2
1515
+
1516
+ u: 3,1,4
1517
+
1518
+ y: 3,1,3
1519
+ b: 3,1,3
1520
+ c: 3,1,3
1521
+ a: 3,1,3
1522
+ z: 3,1,3
1523
+ t: 3,1,3
1524
+
1525
+ x: 3,1,2
1526
+ v: 3,1,2
1527
+ d: 3,1,2
1528
+ w: 3,1,2
1529
+ e: 3,1,2
1530
+ probier mal:
1531
+ ring s=31991,(f,u,y,z,t,a,b,c,v,w,d,e,h),dp; //standard
1532
+
1533
+ */