passagemath-singular 10.6.30__cp310-cp310-macosx_13_0_arm64.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 (488) hide show
  1. PySingular.cpython-310-darwin.so +0 -0
  2. passagemath_singular-10.6.30.dist-info/METADATA +182 -0
  3. passagemath_singular-10.6.30.dist-info/RECORD +488 -0
  4. passagemath_singular-10.6.30.dist-info/WHEEL +6 -0
  5. passagemath_singular-10.6.30.dist-info/top_level.txt +3 -0
  6. passagemath_singular.dylibs/libSingular-4.4.1.dylib +0 -0
  7. passagemath_singular.dylibs/libcddgmp.0.dylib +0 -0
  8. passagemath_singular.dylibs/libfactory-4.4.1.dylib +0 -0
  9. passagemath_singular.dylibs/libflint.21.0.dylib +0 -0
  10. passagemath_singular.dylibs/libgf2x.3.dylib +0 -0
  11. passagemath_singular.dylibs/libgfortran.5.dylib +0 -0
  12. passagemath_singular.dylibs/libgmp.10.dylib +0 -0
  13. passagemath_singular.dylibs/libgsl.28.dylib +0 -0
  14. passagemath_singular.dylibs/libmpfr.6.dylib +0 -0
  15. passagemath_singular.dylibs/libntl.44.dylib +0 -0
  16. passagemath_singular.dylibs/libomalloc-0.9.6.dylib +0 -0
  17. passagemath_singular.dylibs/libopenblasp-r0.3.29.dylib +0 -0
  18. passagemath_singular.dylibs/libpolys-4.4.1.dylib +0 -0
  19. passagemath_singular.dylibs/libquadmath.0.dylib +0 -0
  20. passagemath_singular.dylibs/libreadline.8.2.dylib +0 -0
  21. passagemath_singular.dylibs/libsingular_resources-4.4.1.dylib +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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.so +0 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  52. sage/algebras/quatalg/quaternion_algebra_element.cpython-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.so +0 -0
  71. sage/libs/singular/option.pyx +671 -0
  72. sage/libs/singular/polynomial.cpython-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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-310-darwin.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 +187111 -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 +769 -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 +1927 -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 +1258 -0
  367. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  368. sage_wheels/share/singular/LIB/modstd.lib +1025 -0
  369. sage_wheels/share/singular/LIB/modular.lib +438 -0
  370. sage_wheels/share/singular/LIB/modules.lib +2553 -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 +2140 -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 +305 -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 +9593 -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 +169 -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 +1498 -0
  443. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  444. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  445. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  446. sage_wheels/share/singular/LIB/sets.lib +524 -0
  447. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  448. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  449. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  450. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  451. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  452. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  453. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  454. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  455. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  456. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  457. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  458. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  459. sage_wheels/share/singular/LIB/surf.lib +506 -0
  460. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  461. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  462. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  463. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  464. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  465. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  466. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  467. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  468. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  469. sage_wheels/share/singular/LIB/template.lib +116 -0
  470. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  471. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  472. sage_wheels/share/singular/LIB/triang.lib +1195 -0
  473. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  474. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  475. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  476. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  477. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  478. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  479. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  480. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  481. sage_wheels/share/singular/emacs/COPYING +44 -0
  482. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  483. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  484. sage_wheels/share/singular/emacs/hlp-cmpl.el +4310 -0
  485. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  486. sage_wheels/share/singular/emacs/singular.el +4273 -0
  487. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  488. sage_wheels/share/singular/singular.idx +4986 -0
@@ -0,0 +1,2140 @@
1
+ //// Singular library normaliz.lib
2
+ version="version normaliz.lib 4.3.1.0 June_2022 "; // $Id: e4de2ef9d38ebc698e86bc054dbee8a4456b5e70 $
3
+ category="Commutative Algebra";
4
+ info="
5
+ LIBRARY: normaliz.lib Provides an interface for the use of Normaliz 3.10.0 or
6
+ newer within SINGULAR.
7
+ AUTHORS: Winfried Bruns, wbruns@uos.de
8
+ Christof Soeger, Christof.Soeger@Uni-Osnabrueck.de
9
+
10
+ OVERVIEW:
11
+ @texinfo
12
+ The library normaliz.lib provides an interface for the use of Normaliz 3.10.0 or
13
+ newer within SINGULAR. The exchange of data is via files.
14
+ In addition to the top level
15
+ functions that aim at objects of type ideal or ring, several other auxiliary
16
+ functions allow the user to apply Normaliz to data of type intmat. Options
17
+ such as compoutationn goals or algorithmic variants can be activated.To some extent,
18
+ SINGULAR can therefore be used as an environment for interactive access to Normaliz.
19
+ @* Please see the @code{Normaliz.pdf} (included in the Normaliz
20
+ distribution) for a more extensive documentation of Normaliz.
21
+
22
+ Normaliz allows the use of a grading. In the Singular functions that access
23
+ Normaliz the parameter grading is an intvec that assigns a (not necessarily
24
+ positive) degree to every variable of the ambient polynomial ring.
25
+ But it must give positive degrees to the generators given to the function.
26
+
27
+ Singular and Normaliz exchange data via files. The input files use the Normaliz 3 syntax.
28
+ These files are automatically
29
+ created and erased behind the scenes. As long as one wants to use only the
30
+ ring-theoretic functions there is no need for file management.
31
+ @*Note that the numerical invariants computed by Normaliz can be
32
+ accessed in this \"automatic file mode\".
33
+ @*However, if Singular is used as a frontend for Normaliz or the user
34
+ wants to inspect data not automatically returned to Singular, then
35
+ an explicit filename and a path can be specified for the exchange of
36
+ data. Moreover, the library provides functions for access to these files.
37
+ Deletion of the files is left to the user. (Not all output files
38
+ of Normaliz can be read by this library.)
39
+
40
+ Use of this library requires the program Normaliz to be installed.
41
+ You can download it from
42
+ @uref{https://github.com/Normaliz/Normaliz/releases}. Please make sure
43
+ that the executable is in the search path or use setNmzExecPath
44
+ (@ref{setNmzExecPath}).
45
+ @end texinfo
46
+
47
+ KEYWORDS: integral closure; normalization; toric ring
48
+
49
+ PROCEDURES:
50
+ intclToricRing(ideal I) computes the integral closure of the toric ring
51
+ generated by the leading monomials of the
52
+ elements of I in the basering
53
+ normalToricRing(ideal I) computes the normalization of the toric ring
54
+ generated by the leading monomials of the
55
+ elements of I
56
+ proc hilbertSeriesToricRing(ideal I) computes the Hilbert series of the toric ring
57
+ generated by the lead monomials of the elements in I.
58
+ A grading can be specified
59
+ normalToricRingFromBinomials(ideal I) computes the normalization of the
60
+ polynomial ring modulo the unique minimal binomial
61
+ prime ideal of the binomial ideal I
62
+ toricRingFromBinomials(ideal I) computes the polynomial ring modulo the unique
63
+ inimal binomial prime ideal of the binomial ideal I
64
+ ehrhartRing(ideal I) considers the exponent vectors of the elements of I
65
+ as points of a lattice polytope and computes the
66
+ integral cloure of the polytopal algebra
67
+ intclMonIdeal(ideal I) Computes the integral closure of the Rees algebra
68
+ of the ideal generated by the leading monomials of
69
+ the elements of I
70
+ definingBinomialIdeal(ideal I) computes the defining binomail ideal of the toric ring
71
+ generated by the leading monomials of the elements of I
72
+ latticeIdeal(ideal I) computes the lattice ideal defined by the binomial ideal I
73
+ groebnerBasis(ideal I) computes a Gröbner basis of the lattice ideal defined by
74
+ the binomial ideal I
75
+ torusInvariants(intmat T) computes the ring of invariants of a torus action
76
+ finiteDiagInvariants(intmat C) computes the ring of invariants of a finite
77
+ abelian group acting diagonally on a polynomial
78
+ ring
79
+ diagInvariants(intmat C) computes the ring of invariants of a
80
+ diagonalizable group
81
+ intersectionValRings(intmat V) computes the intersection of the polynomial
82
+ ring with the valuation rings of monomial
83
+ valuations
84
+ intersectionValRingIdeals(intmat V) computes ideals of monomial valuations
85
+ showNuminvs() prints the numerical invariants found by Normaliz
86
+ exportNuminvs() exports the numerical invariants found by Normaliz
87
+
88
+ allNmzOptions() prints all available Normaliz options with thei naming string,
89
+ the default value and the string passed to Normaliz
90
+ setNmzOption(string s, int onoff) sets the option s to onoff
91
+ addNmzOption(string short_cut, string nmz_oprion) adds a Normaliz option to the list
92
+ of predefined ones and activates it
93
+ showNmzOptions() prints the enabled options to the standard output
94
+ resetNmzOptions() resets the options to the default choice
95
+
96
+ normaliz(intmat input_mat,string nmz_type,...) applies Normaliz to the input matrix
97
+ of type nmz_type. Further arguments can be additional matrices and integer parameters.
98
+ setNmzExecPath(string nmz_exec_path_name) sets the path to the Normaliz
99
+ executable
100
+
101
+ writeNmzData(intmat sgr, string nmz_type) creates an input file for Normaliz
102
+ (also from a list of pairs sgr, nmz_type)
103
+ readNmzData(string nmz_suffix) reads the Normaliz output file with the
104
+ specified suffix
105
+
106
+ setNmzFilename(string nmz_filename_name) sets the filename for the exchange
107
+ of data
108
+ setNmzDataPath(string nmz_data_path_name) sets the directory for the exchange
109
+ of data
110
+ writeNmzPaths() writes the path names into two files
111
+ startNmz() retrieves the path names written by writeNmzPaths
112
+ rmNmzFiles() removes the files created for and by Normaliz
113
+
114
+ mons2intmat(ideal I) returns the intmat whose rows represent the
115
+ leading exponents of the elements of I
116
+ intmat2mons(intmat expo_vecs) returns the ideal generated by the monomials
117
+ which have the rows of expo_vecs as
118
+ exponent vector
119
+ binomials2intmat(ideal I) returns the intmat whose rows represent the
120
+ exponents of the elements of the binomial ideal I
121
+ intmat2binomials(intmat expo_vecs) returns the ideal generated by the binomials
122
+ represent by the rows of the intmat expo_vecs
123
+ ";
124
+
125
+
126
+ // helpers
127
+ static proc fileExists(string f)
128
+ {
129
+ return(status (f,"exists")=="yes");
130
+ }
131
+
132
+ static proc appendSlash(string s)
133
+ // if nonempty and / is not the terminating char
134
+ {
135
+ if(size(s)>0)
136
+ {
137
+ if(s[size(s)]!="/")
138
+ {
139
+ s=s+"/";
140
+ return(s);
141
+ }
142
+ }
143
+ return(s);
144
+ }
145
+
146
+ // filenames and paths
147
+
148
+ proc setNmzExecPath(string nmz_exec_path_name)
149
+ "USAGE: setNmzExecPath(string s); @code{s} path to the Normaliz executable
150
+ CREATE: @code{Normaliz::nmz_exec_path} to save the given path @code{s}
151
+ NOTE: It is not necessary to use this function if the Normaliz executable
152
+ is in the search path of the system.
153
+ SEE ALSO: setNmzOption
154
+ EXAMPLE: example setNmzExecPath; shows an example"
155
+ {
156
+ nmz_exec_path=nmz_exec_path_name;
157
+ nmz_exec_path=appendSlash(nmz_exec_path);
158
+ }
159
+ example
160
+ { "EXAMPLE:";echo = 2;
161
+ setNmzExecPath("../Normaliz/");
162
+ }
163
+
164
+ proc setNmzFilename(string nmz_filename_name)
165
+ "USAGE: setNmzFilename(string s);
166
+ CREATE: @code{Normaliz::nmz_filename} to save the given filename @code{s}
167
+ NOTE: The function sets the filename for the exchange of data. Unless a
168
+ path is set by setNmzDataPath, files will be created in the current
169
+ directory.
170
+ @* If a non-empty filename is set, the files created for and by
171
+ Normaliz are kept. This is mandatory for the data access functions
172
+ (see @ref{writeNmzData} and @ref{readNmzData}).
173
+ @* Resetting the filename by setNmzFilename(\"\") forces the library
174
+ to return to deletion of temporary files, but the files created
175
+ while the filename had been set will not be erased.
176
+ SEE ALSO: writeNmzData, readNmzData, setNmzDataPath, rmNmzFiles
177
+ EXAMPLE: example setNmzFilename; shows an example"
178
+ {
179
+ nmz_filename=nmz_filename_name;
180
+ if(nmz_filename_name!="")
181
+ {
182
+ nmz_files_keep_switch=1;
183
+ }
184
+ else
185
+ {
186
+ nmz_files_keep_switch=0;
187
+ }
188
+ }
189
+ example
190
+ { "EXAMPLE:";echo = 2;
191
+ setNmzDataPath("examples/");
192
+ setNmzFilename("example1");
193
+ //now the files for the exchange with Normaliz are examples/example1.SUFFIX
194
+ }
195
+
196
+ proc setNmzDataPath(string nmz_data_path_name)
197
+ "USAGE: setNmzDataPath(string s);
198
+ CREATE: @code{Normaliz::nmz_data_path} to save the given path @code{s}
199
+ NOTE: The function sets the path for the exchange of data. By default the
200
+ files will be created in the current directory.
201
+ @* It seems that Singular cannot use filenames starting with @code{~}
202
+ or @code{$HOME} in its input/output functions.
203
+ @* You must also avoid path names starting with @code{/} if you work
204
+ under Cygwin, since Singular and Normaliz interpret them in
205
+ different ways.
206
+ SEE ALSO: writeNmzData, readNmzData, rmNmzFiles, setNmzFilename
207
+ EXAMPLE: example setNmzDataPath; shows an example"
208
+ {
209
+ nmz_data_path=nmz_data_path_name;
210
+ nmz_data_path=appendSlash(nmz_data_path);
211
+ }
212
+ example
213
+ { "EXAMPLE:";echo = 2;
214
+ setNmzDataPath("examples/");
215
+ setNmzFilename("example1");
216
+ //now the files for the exchange with Normalize are examples/example1.SUFFIX
217
+ }
218
+
219
+ proc writeNmzPaths();
220
+ "USAGE: writeNmzPaths();
221
+ CREATE: the file nmz_sing_exec.path where the path to the Normaliz executable
222
+ is saved
223
+ @* the file nmz_sing_data.path where the directory for the exchange
224
+ of data is saved
225
+ NOTE: Both files are saved in the current directory. If one of the names
226
+ has not been defined, the corresponding file is created, but
227
+ contains nothing.
228
+ SEE ALSO: setNmzDataPath, setNmzExecPath, startNmz
229
+ EXAMPLE: example writeNmzPaths; shows an example
230
+ "{
231
+ link outf=":w nmz_sing_exec.path";
232
+ write(outf, nmz_exec_path);
233
+ close(outf);
234
+
235
+ outf=":w nmz_sing_data.path";
236
+ write(outf, nmz_data_path);
237
+ close(outf);
238
+ }
239
+ example
240
+ { "EXAMPLE:";echo = 2;
241
+ setNmzExecPath("../Normaliz/");
242
+ writeNmzPaths();
243
+ int dummy=system("sh","cat nmz_sing_exec.path");
244
+ dummy=system("sh","cat nmz_sing_data.path");
245
+ }
246
+
247
+ proc startNmz()
248
+ "USAGE: startNmz();
249
+ PURPOSE: This function reads the files written by @code{writeNmzPaths()},
250
+ retrieves the path names, and types them on the standard output
251
+ (as far as they have been set). Thus, once the path names have been
252
+ stored, a Normaliz session can simply be opened by this function.
253
+ SEE ALSO: setNmzDataPath, setNmzExecPath, writeNmzPaths
254
+ EXAMPLE: example startNmz; shows an example
255
+ "
256
+ {
257
+ link inf=":r nmz_sing_exec.path";
258
+ string s=read(inf);
259
+ int i,p;
260
+ p=findWord("/",s,1);
261
+ if(p!=-1)
262
+ {
263
+ for(i=size(s);i>=1;i--)
264
+ {
265
+ if(s[i]=="/")
266
+ {
267
+ s=s[1..i];
268
+ break;
269
+ }
270
+ }
271
+ nmz_exec_path=s;
272
+ "nmz_exec_path is",nmz_exec_path;
273
+ }
274
+ else
275
+ {
276
+ "nmz_exec_path not set";
277
+ }
278
+
279
+ inf=":r nmz_sing_data.path";
280
+ s=read(inf);
281
+ p=findWord("/",s,1);
282
+ if(p!=-1)
283
+ {
284
+ for(i=size(s);i>=1;i--)
285
+ {
286
+ if(s[i]=="/")
287
+ {
288
+ s=s[1..i];
289
+ break;
290
+ }
291
+ }
292
+ nmz_data_path=s;
293
+ "nmz_data_path is",nmz_data_path;
294
+ }
295
+ else
296
+ {
297
+ "nmz_data_path not set";
298
+ }
299
+ }
300
+ example
301
+ { "EXAMPLE:"; echo=2;
302
+ writeNmzPaths();
303
+ startNmz();
304
+ }
305
+
306
+ static proc getNmzFile()
307
+ {
308
+ if(nmz_files_keep_switch)
309
+ {
310
+ return(nmz_data_path+nmz_filename);
311
+ }
312
+ else
313
+ {
314
+ return(nmz_filename);
315
+ }
316
+ }
317
+
318
+ static proc makeTempNmzDataPath()
319
+ {
320
+ string testdir, testdir1;
321
+ int i,dummy;
322
+
323
+ testdir1="/tmp/nmz_sing_"+string(system("pid"));
324
+ testdir=testdir1;
325
+ while(fileExists(testdir))
326
+ {
327
+ i = i +1;
328
+ testdir=testdir1+string(i);
329
+ }
330
+ dummy=system("sh","mkdir "+ testdir);
331
+ nmz_filename=testdir+"/nmz"; //files are nmz+suffix in testdir
332
+ }
333
+
334
+ static proc eraseTempNmzDataPath();
335
+ {
336
+ int dummy;
337
+
338
+ string tmpdir=getNmzFile();
339
+ tmpdir=tmpdir[1..size(tmpdir)-4]; // remove "/nmz"
340
+ dummy=system("sh","rm -r "+tmpdir);
341
+ setNmzFilename("");
342
+ }
343
+
344
+ static proc setNmzExec()
345
+ {
346
+ return(nmz_exec_path+"normaliz");
347
+ }
348
+
349
+ proc rmNmzFiles()
350
+ "USAGE: rmNmzFiles();
351
+ PURPOSE: This function removes the files created for and by Normaliz, using
352
+ the last filename specified.
353
+ It needs an explicit filename set (see @ref{setNmzFilename}).
354
+ SEE ALSO: writeNmzData, readNmzData, setNmzFilename, setNmzDataPath
355
+ EXAMPLE: example rmNmzFiles; shows an example
356
+ "{
357
+
358
+ if(!nmz_files_keep_switch)
359
+ {
360
+ ERROR("rmNmzFiles: no filename specified");
361
+ }
362
+
363
+ list suffixes="in","gen","out","cst","typ","egn","esp","inv","tri","ht1",
364
+ "ext","dec", "lat", "mod", "tgn", "msp", "inc", "fac", "aut",
365
+ "IntHull.out", "symm.out", ".ProjectCone.out, grb, mrk, rep", "ogn";
366
+ int i,dummy;
367
+ string f;
368
+
369
+ for(i=1;i<=size(suffixes);i++)
370
+ {
371
+ f=getNmzFile()+"."+suffixes[i];
372
+ if (fileExists(f))
373
+ {
374
+ dummy=system("sh","rm "+f+ "&> /dev/null");
375
+ }
376
+ }
377
+ }
378
+ example
379
+ { "EXAMPLE:"; echo=2;
380
+ setNmzFilename("VeryInteresting");
381
+ rmNmzFiles();
382
+ }
383
+
384
+
385
+
386
+ // parsing normaliz output
387
+
388
+ static proc digit(string s)
389
+ {
390
+ if(s==" ") // skip blanks quickly
391
+ {
392
+ return(0);
393
+ }
394
+
395
+ if((s[1]>="0" && s[1]<="9")||s[1]=="-")
396
+ {
397
+ return(1);
398
+ }
399
+ return(0);
400
+ }
401
+
402
+ static proc nextWord(string s, int p)
403
+ {
404
+ int j,sw,ew;
405
+
406
+ for(;p<=size(s);p++) // must start with a letter
407
+ {
408
+
409
+ if((s[p]>="a" && s[p]<="z")||
410
+ (s[p]>="A" && s[p]<="Z"))
411
+ {
412
+ sw=p; break;
413
+ }
414
+ }
415
+ if(p>size(s))
416
+ {
417
+ return(-1,-1); // no word found
418
+ }
419
+
420
+ for(;p<=size(s);p++) // now numerals and -_ allowed
421
+ {
422
+ if(!((s[p]>="a" && s[p]<="z")||
423
+ (s[p]>="A" && s[p]<="Z")||
424
+ (s[p]>="0" && s[p]<="9")||
425
+ s[p]=="_"||s[p]=="-"))
426
+ {
427
+ break;
428
+ }
429
+ }
430
+ return(sw,p);
431
+ }
432
+
433
+ static proc getInt(string s, int p)
434
+ {
435
+ string nst;
436
+ int i,j,en,sn;
437
+
438
+ for(;p<=size(s);p++)
439
+ {
440
+
441
+ if(digit(s[p]))
442
+ {
443
+ sn=p; break;
444
+ }
445
+ }
446
+ if(not(sn))
447
+ {
448
+ return(0,-1); // -1 indicates: no number found
449
+ }
450
+ p++;
451
+ for(;p<=size(s);p++)
452
+ {
453
+ if(!digit(s[p]))
454
+ {
455
+ en=p-1; break;
456
+ }
457
+ }
458
+ if(p>size(s))
459
+ {
460
+ en=size(s);
461
+ }
462
+ nst="i="+s[sn,en-sn+1];
463
+ execute(nst);
464
+ return(i,p);
465
+ }
466
+
467
+
468
+ static proc getRational(string s, int p)
469
+ {
470
+ string nst;
471
+ int i,j,en,sn;
472
+
473
+ for(;p<=size(s);p++)
474
+ {
475
+ if(digit(s[p]))
476
+ {
477
+ sn=p; break;
478
+ }
479
+ }
480
+ if(not(sn))
481
+ {
482
+ return(0,-1); // -1 indicates: no number found
483
+ }
484
+ p++;
485
+ int slash_at;
486
+ for(;p<=size(s);p++)
487
+ {
488
+ if(s[p]=="/")
489
+ {
490
+ slash_at=p;
491
+ p++;
492
+ continue;
493
+ }
494
+ if(!digit(s[p]))
495
+ {
496
+ en=p-1; break;
497
+ }
498
+ }
499
+ if(p>size(s))
500
+ {
501
+ en=size(s);
502
+ }
503
+ if(slash_at)
504
+ {
505
+ nst="i="+s[sn,slash_at-sn];
506
+ execute(nst);
507
+ nst="j="+s[slash_at+1,en-slash_at];
508
+ execute(nst);
509
+ return(i,p,j);
510
+ }
511
+ nst="i="+s[sn,en-sn+1];
512
+ execute(nst);
513
+ return(i,p);
514
+ }
515
+
516
+
517
+ static proc findWord(string s, string t, int p)
518
+ {
519
+ for(;p<=size(t)-size(s)+1;p++)
520
+ {
521
+ if(t[p]==s[1])
522
+ {
523
+ if(t[p,size(s)]==s)
524
+ {
525
+ return(p+size(s));
526
+ }
527
+ }
528
+ }
529
+ return(-1);
530
+ }
531
+
532
+
533
+ static proc skipEqualsign(string s,int p)
534
+ {
535
+ for(;p<=size(s);p++)
536
+ {
537
+ if(s[p]=="=")
538
+ {
539
+ break;
540
+ }
541
+ }
542
+ return(p+1);
543
+ }
544
+
545
+
546
+ // input and output to/from normaliz
547
+
548
+ // for backward compatibility:
549
+ static proc num_type_to_string(int nmz_type)
550
+ {
551
+ if (nmz_type == 20) {
552
+ return("grading");}
553
+ if (nmz_type == 0) {
554
+ return("integral_closure");}
555
+ if (nmz_type == 1) {
556
+ return("normalization");}
557
+ if (nmz_type == 2) {
558
+ return("polytope");}
559
+ if (nmz_type == 3) {
560
+ return("rees_algebra");}
561
+ if (nmz_type == 4) {
562
+ return("inequalities");}
563
+ if (nmz_type == 5) {
564
+ return("equations");}
565
+ if (nmz_type == 6) {
566
+ return("congruences");}
567
+ if (nmz_type == 10) {
568
+ return("lattice_ideal");}
569
+ if (nmz_type == -1) {
570
+ return("-1");}
571
+ }
572
+
573
+ //list must have pairs of intmat, nmz_type
574
+ static proc doWriteNmzData(list #)
575
+ {
576
+ string s;
577
+ int i,j;
578
+ link outf=":w "+ getNmzFile() +".in"; // also sets the filename
579
+
580
+ intmat sgr;
581
+ intvec vecinput;
582
+ int num_rows, num_cols;
583
+ string nmz_type;
584
+
585
+ write(outf,"amb_space auto");
586
+
587
+ for (int k=1; k<=size(#); k=k+2) {
588
+ //get data from the parameter list
589
+ if(typeof(#[k+1]) == "int"){
590
+ nmz_type = num_type_to_string(#[k+1]);}
591
+ else{
592
+ nmz_type = #[k+1];}
593
+
594
+ if (nmz_type != "-1") { //skip -1 type
595
+
596
+ if(typeof(#[k]) == "int"){
597
+ s= nmz_type + " ";
598
+ s= s + string(#[k]);
599
+ write(outf, s);
600
+ }
601
+ if(typeof(#[k]) == "intvec"){
602
+ vecinput = #[k];
603
+ s= nmz_type;
604
+ write(outf, s);
605
+ write(outf,"[");
606
+ s = "";
607
+ for(i=1;i<= size(vecinput);i++){
608
+ s= s + string(vecinput[i]);
609
+ }
610
+ write(outf,s);
611
+ write(outf,"]");
612
+ }
613
+ if(typeof(#[k]) != "int" && typeof(#[k]) != "intvec"){
614
+ write(outf, nmz_type);
615
+ sgr = #[k];
616
+ num_rows = nrows(sgr);
617
+ num_cols = ncols(sgr);
618
+
619
+ if(nmz_type != "grading")
620
+ {
621
+ write(outf,"[");
622
+ }
623
+
624
+ for(i=1;i<=nrows(sgr);i++)
625
+ {
626
+ s="[";
627
+ for(j=1;j<=num_cols -1;j++)
628
+ {
629
+ s= s + string(sgr[i,j]);
630
+ s = s + ", ";
631
+ }
632
+ s= s + string(sgr[i,num_cols]);
633
+ s = s + "]";
634
+ write(outf,s);
635
+ }
636
+ if(nmz_type != "grading")
637
+ {
638
+ write(outf,"]");
639
+ }
640
+ }
641
+ }
642
+ }
643
+ close(outf);
644
+ }
645
+
646
+ static proc prepareGrading(list #)
647
+ {
648
+ if (size(#)==0) {
649
+ return(0,-1); // type -1 specifies discard the matrix
650
+ }
651
+ if (size(#)>1) {
652
+ print(#);
653
+ ERROR("To many parameters!");
654
+ }
655
+ intmat g = intmat(#[1],1,size(#[1]));
656
+ return (g,"grading");
657
+ }
658
+
659
+
660
+ proc writeNmzData(list #)
661
+ "USAGE: writeNmzData(intmat M, string nmz_type);
662
+ writeNmzData(intmat M, string nmz_type, intmat M2, string nmz_type2, ...);
663
+ CREATE: Creates an input file for Normaliz from the matrix M. The second
664
+ parameter sets the type. How the matrix is interpreted depends on the
665
+ type. See the Normaliz documentation for more information.
666
+
667
+ It is also possible to give more than one pair of matrix and type. In
668
+ NOTE: Needs an explicit filename set. The filename is created from the
669
+ current filename.
670
+ @* Note that all high level functions in normaliz.lib write and read their
671
+ data automatically to and from the hard disk so that writeNmzData will
672
+ hardly ever be used explicitly.
673
+ SEE ALSO: readNmzData, rmNmzFiles, setNmzFilename, setNmzDataPath
674
+ EXAMPLE: example writeNmzData; shows an example"
675
+ {
676
+ if(nmz_filename=="")
677
+ {
678
+ ERROR("writeNmzData: no filename specified");
679
+ }
680
+ doWriteNmzData(#);
681
+ }
682
+ example
683
+ { "EXAMPLE:"; echo=2;
684
+ setNmzFilename("VeryInteresting");
685
+ intmat sgr[3][3]=1,2,3,4,5,6,7,8,10;
686
+ writeNmzData(sgr,"cone_and_lattice");
687
+ int dummy=system("sh","cat VeryInteresting.in");
688
+
689
+ intmat Inequalities[2][3] = 2,-1,0, // 2x-y >= 0
690
+ 1, 1,0; // x+y >= 0
691
+ intmat Equation[1][3] = 0,1,-1; // y = z
692
+ intmat Congruence[1][4] = 1,0,0,3; // x = 0 (3)
693
+ writeNmzData(Inequalities,"inequalities",Equation,"equations",Congruence,"congruences");
694
+ dummy=system("sh","cat VeryInteresting.in");
695
+ }
696
+
697
+ static proc readNmzSparseMatrix(string nmz_suffix)
698
+ {
699
+ string s;
700
+ int n_rows,n_cols; //number of rows/columns
701
+ int p; //position
702
+ int i,j;
703
+
704
+ string filename = getNmzFile() + "."+ nmz_suffix;
705
+ link in_f=":r "+ filename;
706
+ s=read(in_f);
707
+ close(in_f);
708
+
709
+ p=1;
710
+
711
+ (n_rows,p)=getInt(s,p);
712
+ n_rows = - n_rows;
713
+ (n_cols,p)=getInt(s,p);
714
+
715
+ intmat nmz_gen[n_rows][n_cols];
716
+ int nr_nonzero_entries;
717
+ int k;
718
+ for(i=1;i<=n_rows;i++)
719
+ {
720
+ (nr_nonzero_entries,p)=getInt(s,p);
721
+ for(j=1;j<=nr_nonzero_entries;j++)
722
+ {
723
+ (k,p)=getInt(s,p);
724
+ (nmz_gen[i,k],p) = getInt(s,p);
725
+ }
726
+ }
727
+
728
+ return(nmz_gen);
729
+ }
730
+
731
+
732
+ proc readNmzData(string nmz_suffix)
733
+ "USAGE: readNmzData(string suffix);
734
+ RETURN: Reads an output file of Normaliz containing an integer matrix and
735
+ returns it as an intmat. For example, this function is useful if one
736
+ wants to inspect the support hyperplanes. The filename is created
737
+ from the current filename and the suffix given to the function.
738
+ In addition to file suffixes, also sup, equ and cgr are allowed.
739
+ They extract the support hyperplanes, equations and congruences,
740
+ respectively, from the cst file.
741
+ NOTE: Needs an explicit filename set by setNmzFilename.
742
+ @* Note that all functions in normaliz.lib write and read their data
743
+ automatically so that readNmzData will usually not be used explicitly.
744
+ @* This function reads only the first matrix in a file! But see su, equ, cgr above.)
745
+ @* It is the responsability of the user to make sure that an output file
746
+ read by this function has been created for the current input file of Normaliz.
747
+ Files are not automatically removed before a new computation starts.
748
+ @* Not every output file can be read by this function.
749
+ SEE ALSO: writeNmzData, rmNmzFiles, setNmzFilename, setNmzDataPath
750
+ EXAMPLE: example readNmzData; shows an example"
751
+ {
752
+ if(nmz_filename=="")
753
+ {
754
+ ERROR("readNmzData: no filename specified");
755
+ }
756
+
757
+ if(nmz_suffix == "rep" || nmz_suffix == "grb" || nmz_suffix == "mrk"){
758
+ return(readNmzSparseMatrix(nmz_suffix));
759
+ }
760
+
761
+ string s;
762
+ int n_rows,n_cols; //number of rows/columns
763
+ int p; //position
764
+ int i,j;
765
+ int returnvalue;
766
+
767
+ int which_matrix = 1;
768
+ if(nmz_suffix == "sup"){
769
+ nmz_suffix = "cst";
770
+ }
771
+ if(nmz_suffix == "equ"){
772
+ nmz_suffix = "cst";
773
+ which_matrix = 2;
774
+ }
775
+ if(nmz_suffix == "cgr"){
776
+ nmz_suffix = "cst";
777
+ which_matrix = 3;
778
+ }
779
+
780
+ string filename = getNmzFile() + "."+ nmz_suffix;
781
+ link in_f=":r "+ filename;
782
+ s=read(in_f);
783
+ close(in_f);
784
+
785
+ p=1;
786
+ for(int mm = 1; mm <= which_matrix; mm = mm + 1)
787
+ {
788
+ (n_rows,p)=getInt(s,p);
789
+ (n_cols,p)=getInt(s,p);
790
+ if( mm > 1){
791
+ kill nmz_gen;
792
+ }
793
+ intmat nmz_gen[n_rows][n_cols];
794
+ for(i=1;i<=n_rows;i++)
795
+ {
796
+ for(j=1;j<=n_cols;j++)
797
+ {
798
+ (nmz_gen[i,j],p) = getInt(s,p);
799
+ }
800
+ }
801
+ }
802
+ return(nmz_gen);
803
+ }
804
+ example
805
+ { "EXAMPLE:"; echo=2;
806
+ setNmzFilename("VeryInteresting");
807
+ intmat sgr[3][3]=1,2,3,4,5,6,7,8,9;
808
+ intmat sgrnormal=normaliz(sgr,"cone");
809
+ readNmzData("sup");
810
+ readNmzData("equ");
811
+ }
812
+
813
+
814
+
815
+ proc setNmzOption(string s, int onoff)
816
+ "USAGE: setNmzOption(string s, int onoff);
817
+ PURPOSE: If @code{onoff=1} the option @code{s} is activated, and
818
+ if @code{onoff=0} it is deactivated.
819
+ The predefined Normaliz options are accessible via the following names:
820
+ @* @code{-s: supp}
821
+ @* @code{-t: triang}
822
+ @* @code{-v: volume}
823
+ @* @code{-p: hvect} deprecated, replacement:
824
+ @* @code{-p: hvect_deg1}
825
+ @* @code{-q: only_hvect}
826
+ @* @code{--FVector: fvect}
827
+ @* @code{-1: height1}
828
+ @* @code{-G: Gorenst}
829
+ @* @code{-w: witness}
830
+ @* @code{--IsIntegrallyClosed: intclosed}
831
+ @* @code{-C: classgroup}
832
+ @* @code{-n: normal} deprecated, replacement:
833
+ @* @code{-n: hilbbasvol}
834
+ @* @code{-N: normal_l} deprecated, replacement:
835
+ @* @code{-N: hilbbas}
836
+ @* @code{-h: hilb} deprecated, replacement:
837
+ @* @code{-h: hilbbas_hvect}
838
+ @* @code{--MarkovBasis: groebner}
839
+ @* @code{--GroebnerBasis: markov}
840
+ @* @code{--Lex: lex}
841
+ @* @code{--RevLex: revlex}
842
+ @* @code{--DegLex: deglex}
843
+ @* @code{-d: dual}
844
+ @* @code{-M: genoverori}
845
+ @* @code{-a: allf}
846
+ @* @code{--typ: type}
847
+ @* @code{-c: control} deprecated, replacement:
848
+ @* @code{-c: verbose}
849
+ @* @code{-e: errorcheck} allowed, but ignored
850
+ @* @code{-B: bigint} Use GMP for arbitrary precision integers
851
+ @* @code{-x=N: threads} In this case the int parameter is used to set the
852
+ number of threads N, deafult 8, 0 means no explicit limiting.
853
+
854
+ Further Normaliz otions can be adeded to tzhe nlist by addNmzOption.
855
+
856
+ SEE ALSO: allNmzOptions,showNmzOptions, addNmzOption, resetNmzOptions
857
+ EXAMPLE: example setNmzOption; shows an example
858
+ "
859
+ {
860
+ for(int i=1;i<=size(nmz_options);i++)
861
+ {
862
+ if(s==nmz_options[i][1])
863
+ {
864
+ nmz_options[i][2]=onoff;
865
+ return(1);
866
+ }
867
+ }
868
+ "Invalid option ", s;
869
+ return(0);
870
+ }
871
+ example
872
+ { "EXAMPLE:"; echo=2;
873
+ setNmzOption("only_hvect",1);
874
+ showNmzOptions();
875
+ setNmzOption("only_hvect",0);
876
+ showNmzOptions();
877
+ }
878
+
879
+ proc resetNmzOptions()
880
+ "USAGE: resetNmzOptions();
881
+ PURPOSE: Resets the options to the dafault value.
882
+ SEE ALSO: showNmzOptions, setNmzOption, allNmzOptions, addNmzOption
883
+ EXAMPLE: example resetNmzOptions; shows an example
884
+ "
885
+ {
886
+ nmz_options = default_options;
887
+ }
888
+ example
889
+ { "EXAMPLE:"; echo=2;
890
+ setNmzOption("only_hvect",1);
891
+ showNmzOptions();
892
+ resetNmzOptions();
893
+ showNmzOptions();
894
+ }
895
+
896
+ static proc collectNmzOptions()
897
+ {
898
+ string run_options=" -f ";
899
+ for(int i=1;i<=size(nmz_options);i++)
900
+ {
901
+ if(nmz_options[i][2])
902
+ {
903
+ run_options=run_options+nmz_options[i][3];
904
+ if (nmz_options[i][1]=="threads") {
905
+ run_options=run_options+string(nmz_options[i][2]);
906
+ }
907
+ run_options=run_options+" ";
908
+ }
909
+ }
910
+ return(run_options+" ");
911
+ }
912
+
913
+ proc addNmzOption(string short_cut, string nmz_option)
914
+ "USAGE: addNmzOption(string short_cut, string nmz_option)
915
+ NOTE: This function allows the addition of Normaliz options
916
+ in addition to the predefined ones. Adding an option does not
917
+ activate it.
918
+ @* Note: The function prefixes a single letter option by - and
919
+ multiletter options by --.
920
+ SEE ALSO: allNmzOptions,showNmzOptions, setNmzOption, resetNmzOptions
921
+ EXAMPLE: example addNmzOption; shows an example
922
+ "
923
+ {
924
+ if(size(nmz_option) == 1){
925
+ nmz_option = "-" + nmz_option;
926
+ }
927
+ else{
928
+ nmz_option = "--" + nmz_option;
929
+ }
930
+ list new_option = list(short_cut, 0, nmz_option);
931
+ nmz_options = nmz_options + list(new_option);
932
+ }
933
+ example
934
+ { "EXAMPLE:"; echo=2;
935
+ addNmzOption("FL", "FaceLattice");
936
+ setNmzOption("FL", 1);
937
+ showNmzOptions();
938
+ resetNmzOptions();
939
+ }
940
+
941
+ proc showNmzOptions()
942
+ "USAGE: showNmzOptions();
943
+ RETURN: Returns the string of activated options.
944
+ NOTE: This string is used as parameter when calling Normaliz.
945
+ SEE ALSO: setNmzOption
946
+ EXAMPLE: example showNmzOptions; shows an example
947
+ "
948
+ {
949
+ return(collectNmzOptions());
950
+ }
951
+ example
952
+ { "EXAMPLE:"; echo=2;
953
+ setNmzOption("hilb",1);
954
+ showNmzOptions();
955
+ setNmzOption("hilb",0);
956
+ showNmzOptions();
957
+ }
958
+
959
+
960
+ static proc runNormaliz(list #)
961
+ {
962
+ if(!nmz_files_keep_switch)
963
+ {
964
+ makeTempNmzDataPath();
965
+ }
966
+
967
+ doWriteNmzData(#);
968
+
969
+ if(nmz_files_keep_switch)
970
+ {
971
+ int dummy=system("sh",setNmzExec()+ collectNmzOptions() + getNmzFile());
972
+ }
973
+ else
974
+ {
975
+ string gotodir="/tmp";
976
+ string fname=getNmzFile();
977
+ fname=fname[6..size(fname)];
978
+ string exec="cd "+gotodir+" ; ";
979
+ exec=exec+setNmzExec()+ collectNmzOptions()+" ";
980
+ exec=exec+fname+" ;";
981
+ int dummy=system("sh",exec);
982
+ }
983
+
984
+ Num_Invs=getNuminvs();
985
+ int gens_computed = 0;
986
+ for( int i = 1; i <= size(Num_Invs); i = i+1){
987
+ if(Num_Invs[i][1] == "hilbert_basis_elements"){
988
+ gens_computed = 1;
989
+ }
990
+ }
991
+
992
+ if(!gens_computed) // return input matrix if "gen" has not been generated
993
+ {
994
+ if(!nmz_files_keep_switch)
995
+ {
996
+ eraseTempNmzDataPath();
997
+ }
998
+ return(#[1]);
999
+ }
1000
+
1001
+ intmat Gen=readNmzData("gen");
1002
+
1003
+ if(!nmz_files_keep_switch)
1004
+ {
1005
+ eraseTempNmzDataPath();
1006
+ }
1007
+
1008
+ return(Gen);
1009
+
1010
+ }
1011
+
1012
+ proc normaliz(list #)
1013
+ "USAGE: normaliz(intmat input_mat,string nmz_type);
1014
+ normaliz(intmat input_mat, string nmz_type, ...);
1015
+ RETURN: The function applies Normaliz to the matrix input_mat ofe type nmz_type.
1016
+ One can add further pairs "value, type" such as vectors or numerical
1017
+ parameters. See Normaliz manual for possible types and values.
1018
+ The function returns the intmat defined by the file ith suffix gen, provided it has been computed. Otherwise it returns the input_mat.
1019
+ NOTE: You will find procedures for many applications of Normaliz in this
1020
+ library, so the explicit call of this procedure may not be necessary.
1021
+ SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal,
1022
+ torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRings,
1023
+ intersectionValRingIdeals
1024
+ EXAMPLE: example normaliz; shows an example
1025
+ "
1026
+ {
1027
+ return(runNormaliz(#));
1028
+ }
1029
+ example
1030
+ { "EXAMPLE:"; echo=2;
1031
+ ring R=0,(x,y,z),dp;
1032
+ intmat M[3][2]=3,1,
1033
+ 3,2,
1034
+ 1,3;
1035
+ normaliz(M,"cone");
1036
+ intmat Inequalities[2][3] = 2,-1,0, // 2x-y >= 0
1037
+ 1, 1,0; // x+y >= 0
1038
+ intmat Equation[1][3] = 0,1,-1; // y = z
1039
+ intmat Congruence[1][4] = 1,0,0,3; // x = 0 (3)
1040
+ normaliz(Inequalities,"inequalities",Equation,"equations",Congruence,"congruences");
1041
+ }
1042
+
1043
+
1044
+ // retrieving normaliz numerical invariants
1045
+
1046
+ static proc getNuminvs()
1047
+ {
1048
+ string s;
1049
+ list num_invs;
1050
+ int p,sw,v_length,i,dummy_int;
1051
+ intvec dummy_vec;
1052
+ string type_inv,name_inv,dummy_bool;
1053
+
1054
+ link in_f=":r "+ getNmzFile() + "."+"inv";
1055
+ s=read(in_f);
1056
+
1057
+ p=1;
1058
+ while(p<size(s))
1059
+ {
1060
+ (sw,p)=nextWord(s,p);
1061
+ if(sw==-1)
1062
+ {
1063
+ break;
1064
+ }
1065
+ type_inv=s[sw..p-1];
1066
+ if(type_inv=="vector")
1067
+ {
1068
+ (v_length,p)=getInt(s,p);
1069
+ (sw,p)=nextWord(s,p);
1070
+ name_inv=s[sw..p-1];
1071
+ if(name_inv=="h-vector")
1072
+ {
1073
+ name_inv="h_vector";
1074
+ }
1075
+ if(name_inv!="hilbert_polynomial"
1076
+ && name_inv!="hilbert_quasipolynomial")
1077
+ {
1078
+ for(i=1;i<=v_length;i++)
1079
+ {
1080
+ if(i==1)
1081
+ {
1082
+ (dummy_int,p)=getInt(s,p);
1083
+ dummy_vec=dummy_int;
1084
+ }
1085
+ else
1086
+ {
1087
+ (dummy_int,p)=getInt(s,p);
1088
+ dummy_vec=dummy_vec,dummy_int;
1089
+ }
1090
+ }
1091
+ num_invs=num_invs+list(list(name_inv,dummy_vec,"intvec"));
1092
+ }
1093
+ else
1094
+ {
1095
+ p=skipEqualsign(s,p);
1096
+ }
1097
+ }
1098
+ if(type_inv=="integer")
1099
+ {
1100
+ (sw,p)=nextWord(s,p);
1101
+ name_inv=s[sw..p-1];
1102
+ if (name_inv!="hilbert_quasipolynomial_denom") {
1103
+ (dummy_int,p)=getInt(s,p);
1104
+ num_invs=num_invs+list(list(name_inv,dummy_int,"int"));
1105
+ }
1106
+ }
1107
+ if(type_inv=="boolean")
1108
+ {
1109
+ (sw,p)=nextWord(s,p);
1110
+ name_inv=s[sw..p-1];
1111
+ p=skipEqualsign(s,p);
1112
+ (sw,p)=nextWord(s,p);
1113
+ dummy_bool=s[sw..p-1];
1114
+ dummy_int=0;
1115
+ if(dummy_bool=="true")
1116
+ {
1117
+ dummy_int=1;
1118
+ }
1119
+ num_invs=num_invs+list(list(name_inv,dummy_int,"int"));
1120
+ }
1121
+ }
1122
+ return(num_invs);
1123
+ }
1124
+
1125
+ proc showNuminvs()
1126
+ "USAGE: showNuminvs();
1127
+ PURPOSE: prints the numerical invariants
1128
+ SEE ALSO: exportNuminvs
1129
+ EXAMPLE: example showNuminvs(); shows an example
1130
+ "
1131
+ {
1132
+ list dummy;
1133
+ int i;
1134
+ for(i=1;i<=size(Num_Invs);i++)
1135
+ {
1136
+ dummy=Num_Invs[i];
1137
+ dummy[1],":", dummy[2];
1138
+ }
1139
+ }
1140
+ example
1141
+ { "EXAMPLE:"; echo=2;
1142
+ ring R=0,(x,y,z,t),dp;
1143
+ ideal I=x3,x2y,y3;
1144
+ list l=intclMonIdeal(I);
1145
+ showNuminvs();
1146
+ }
1147
+
1148
+
1149
+ proc exportNuminvs()
1150
+ "USAGE: exportNuminvs();
1151
+ CREATE: Creates top-level variables which contain the numerical invariants.
1152
+ Depending on the options of normaliz different invariants are
1153
+ calculated. Use showNuminvs (@ref{showNuminvs}) to see which
1154
+ invariants are available.
1155
+ SEE ALSO: showNuminvs
1156
+ EXAMPLE: example exportNuminvs; shows an example
1157
+ "
1158
+ {
1159
+ list dummy;
1160
+ int i;
1161
+ string s;
1162
+ for(i=1;i<=size(Exported_Num_Invs);i++)
1163
+ {
1164
+ dummy=Exported_Num_Invs[i];
1165
+ s="kill nmz_" + dummy[1];
1166
+ execute(s);
1167
+ }
1168
+ for(i=1;i<=size(Num_Invs);i++)
1169
+ {
1170
+ dummy=Num_Invs[i];
1171
+ s=dummy[3]+" nmz_" + dummy[1] + "=dummy[2]; exportto(Top," + "nmz_" + dummy[1] + ");";
1172
+ execute(s);
1173
+ }
1174
+ Exported_Num_Invs = Num_Invs;
1175
+ }
1176
+ example
1177
+ { "EXAMPLE:"; echo=2;
1178
+ ring R=0,(x,y,z,t),dp;
1179
+ ideal I=x3,x2y,y3;
1180
+ list l=intclMonIdeal(I);
1181
+ exportNuminvs();
1182
+ // for example, now the following variables are set:
1183
+ nmz_hilbert_basis_elements;
1184
+ nmz_number_extreme_rays;
1185
+ nmz_rank;
1186
+ nmz_number_support_hyperplanes;
1187
+ nmz_multiplicity;
1188
+ nmz_primary;
1189
+ }
1190
+
1191
+
1192
+ // intmats to/from monomials
1193
+
1194
+ proc mons2intmat(ideal I)
1195
+ "USAGE: mons2intmat(ideal I);
1196
+ RETURN: Returns the intmat whose rows represent the leading exponents of the
1197
+ (non-zero) elements of I. The length of each row is nvars(basering).
1198
+ SEE ALSO: intmat2mons
1199
+ EXAMPLE: example mons2intmat; shows an example"
1200
+ {
1201
+ int i,j,k;
1202
+ intmat expo_vecs[size(I)][nvars(basering)];
1203
+ intvec expo_v;
1204
+
1205
+ k=0;
1206
+ for(i=1;i<=ncols(I);i++)
1207
+ {
1208
+ if(I[i]!=0)
1209
+ {
1210
+ k++;
1211
+ expo_v=leadexp(I[i]);
1212
+ for(j=1;j<=nvars(basering);j++)
1213
+ {
1214
+ expo_vecs[k,j]=expo_v[j];
1215
+ }
1216
+ }
1217
+ }
1218
+ return(expo_vecs);
1219
+ }
1220
+ example
1221
+ { "EXAMPLE:"; echo=2;
1222
+ ring R=0,(x,y,z),dp;
1223
+ ideal I=x2,y2,x2yz3;
1224
+ mons2intmat(I);
1225
+ }
1226
+
1227
+ proc intmat2mons(intmat expo_vecs)
1228
+ "USAGE: intmat2mons(intmat M);
1229
+ RETURN: an ideal generated by the monomials which correspond to the exponent
1230
+ vectors given by the rows of @code{M}
1231
+ NOTE: The number of variables in the basering @code{nvars(basering)} has to
1232
+ be at least the number of columns @code{ncols(M)}, otherwise the
1233
+ function exits with an error.
1234
+ is thrown (see @ref{ERROR}).
1235
+ SEE ALSO: mons2intmat
1236
+ EXAMPLE: example intmat2mons; shows an example
1237
+ "
1238
+ {
1239
+ int i,j;
1240
+ poly m;
1241
+ ideal mons;
1242
+
1243
+ if(nvars(basering)<ncols(expo_vecs))
1244
+ {
1245
+ ERROR("intmat2mons: not enough variables in ring");
1246
+ }
1247
+
1248
+ for(i=1;i<=nrows(expo_vecs);i++)
1249
+ {
1250
+ m=1;
1251
+ for(j=1;j<=ncols(expo_vecs);j++)
1252
+ {
1253
+ m=m*var(j)^expo_vecs[i,j];
1254
+ }
1255
+ mons=mons,m;
1256
+ }
1257
+ mons=simplify(mons,2); // get rid of starting 0
1258
+ return(mons);
1259
+ }
1260
+ example
1261
+ { "EXAMPLE:"; echo=2;
1262
+ ring R=0,(x,y,z),dp;
1263
+ intmat expo_vecs[3][3] =
1264
+ 2,0,0,
1265
+ 0,2,0,
1266
+ 2,1,3;
1267
+ intmat2mons(expo_vecs);
1268
+ }
1269
+
1270
+ static proc intmat2monsSel(intmat expo_vecs, int d)
1271
+ {
1272
+ int i,j;
1273
+ poly m;
1274
+ ideal mons;
1275
+
1276
+ if(nvars(basering)<ncols(expo_vecs)-1)
1277
+ {
1278
+ ERROR("intmat2monsSel: not enough variables in ring");
1279
+ }
1280
+
1281
+ for(i=1;i<=nrows(expo_vecs);i++)
1282
+ {
1283
+ if(expo_vecs[i,ncols(expo_vecs)]==d)
1284
+ {
1285
+ m=1;
1286
+ for(j=1;j<=ncols(expo_vecs)-1;j++)
1287
+ {
1288
+ m=m*var(j)^expo_vecs[i,j];
1289
+ }
1290
+ mons=mons,m;
1291
+ }
1292
+ }
1293
+ mons=simplify(mons,2); // get rid of starting 0
1294
+ return(mons);
1295
+ }
1296
+
1297
+
1298
+ proc binomials2intmat(ideal I)
1299
+ "USAGE: binomials2intmat(ideal I);
1300
+ RETURN: Returns the intmat whose rows represent the exponents of the
1301
+ (non-zero) elements of I which have to be binomials.
1302
+ The length of each row is nvars(basering).
1303
+ SEE ALSO: intmat2binomials, mons2intmat, intmat2mons
1304
+ EXAMPLE: example binomials2intmat; shows an example"
1305
+ {
1306
+ int i,j,k;
1307
+ intmat expo_vecs[size(I)][nvars(basering)];
1308
+ intvec expo_v;
1309
+
1310
+ k=0;
1311
+ poly f;
1312
+
1313
+ for(i=1; i<=ncols(I); i++)
1314
+ {
1315
+ if( I[i] != 0 )
1316
+ {
1317
+ k++;
1318
+ f = I[i];
1319
+ if (leadcoef(f) != 1) {f = -f;} //works in all characteristics
1320
+ if (size(f)!=2 || leadcoef(f)!=1 || leadcoef(f[2])!=-1)
1321
+ {
1322
+ ERROR(string("normalToricRing: binomial ideal expected: generator ",i,": ",I[i]));
1323
+ }
1324
+
1325
+ expo_v = leadexp(f)-leadexp(f[2]);
1326
+ for(j=1;j<=nvars(basering);j++)
1327
+ {
1328
+ expo_vecs[k,j]=expo_v[j];
1329
+ }
1330
+ }
1331
+ }
1332
+ return(expo_vecs);
1333
+ }
1334
+ example
1335
+ { "EXAMPLE:"; echo=2;
1336
+ ring S = 37,(u,v,w,x,y,z),dp;
1337
+ ideal I = u2v-xyz, ux2-vyz, uvw-y2z;
1338
+ binomials2intmat(I);
1339
+ }
1340
+
1341
+ proc intmat2binomials(intmat expo_vecs)
1342
+ "USAGE: intmat2binomials(intmat M);
1343
+ RETURN: an ideal generated by the binomials which correspond to the exponent
1344
+ vectors given by the rows of @code{M}
1345
+ NOTE: The number of variables in the basering @code{nvars(basering)} has to
1346
+ be at least the number of columns @code{ncols(M)}, otherwise the
1347
+ function exits with an error is thrown (see @ref{ERROR}).
1348
+ The vector with all entries zero represents 1.
1349
+ SEE ALSO: binomials2intmat
1350
+ EXAMPLE: example intmat2binomials; shows an example"
1351
+ {
1352
+ int i,j;
1353
+ poly f,g;
1354
+ ideal binoms;
1355
+ // expo_vecs;
1356
+
1357
+ if(nvars(basering)<ncols(expo_vecs))
1358
+ {
1359
+ ERROR("intmat2binomilals: not enough variables in ring");
1360
+ }
1361
+
1362
+ for(i=1;i<=nrows(expo_vecs);i++)
1363
+ {
1364
+ f=1;
1365
+ g=1;
1366
+ for(j=1;j<=ncols(expo_vecs);j++)
1367
+ {
1368
+ if(expo_vecs[i,j]>0)
1369
+ {
1370
+ f=f*var(j)^expo_vecs[i,j];
1371
+ }
1372
+ if(expo_vecs[i,j]<0)
1373
+ {
1374
+ g=g*var(j)^(-expo_vecs[i,j]);
1375
+ }
1376
+ }
1377
+ binoms=binoms,f-g;
1378
+ }
1379
+ binoms = simplify(binoms,2); // get rid of starting 0
1380
+ return(binoms);
1381
+ }
1382
+ example
1383
+ { "EXAMPLE:"; echo=2;
1384
+ ring S = 37,(u,v,w,x,y,z),dp;
1385
+ intmat M[2][6] = 1,0,1,-1,-2,0, -3,4,5,0,0,1;
1386
+ intmat2binomials(M);
1387
+ }
1388
+
1389
+ // integral closure of rings and ideals
1390
+
1391
+ static proc runIntclToricRing(ideal I, string nmz_type, list #)
1392
+ {
1393
+ intmat expo_vecs=mons2intmat(I);
1394
+ return( intmat2mons( runNormaliz(expo_vecs,nmz_type, prepareGrading(#)) ) );
1395
+ }
1396
+
1397
+ proc intclToricRing(ideal I, list #)
1398
+ "USAGE: intclToricRing(ideal I);
1399
+ intclToricRing(ideal I, intvec grading);
1400
+ RETURN: The toric ring S is the subalgebra of the basering generated by
1401
+ the leading monomials of the elements of I (considered as a list
1402
+ of polynomials). The function computes the integral
1403
+ closure T of S in the basering and returns an ideal listing
1404
+ the algebra generators of T over the coefficient field.
1405
+ @* The function returns the input ideal I if an option
1406
+ blocking the computation of Hilbert bases has been activated.
1407
+ However, in this case some numerical invariants are computed, and
1408
+ some other data may be contained in files that you can read into
1409
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1410
+ NOTE: A mathematical remark: the toric ring depends on the list of
1411
+ monomials given, and not only on the ideal they generate!
1412
+ SEE ALSO: normalToricRing, ehrhartRing, intclMonIdeal
1413
+ EXAMPLE: example intclToricRing; shows an example
1414
+ "
1415
+ {
1416
+ return(runIntclToricRing(I,"cone",#));
1417
+ }
1418
+ example
1419
+ { "EXAMPLE:"; echo=2;
1420
+ ring R=37,(x,y,t),dp;
1421
+ ideal I=x3,x2y,y3;
1422
+ intclToricRing(I);
1423
+ showNuminvs();
1424
+ //now the same example with another grading
1425
+ intvec grading = 2,3,1;
1426
+ intclToricRing(I,grading);
1427
+ showNuminvs();
1428
+
1429
+ }
1430
+
1431
+ proc normalToricRing(ideal I, list #)
1432
+ "USAGE: normalToricRing(ideal I);
1433
+ normalToricRing(ideal I, intvec grading);
1434
+ RETURN: The toric ring S is the subalgebra of the basering generated by the
1435
+ leading monomials of the elements of I (considered as a list of
1436
+ polynomials). The function computes the
1437
+ normalisation T of S and returns an ideal listing the algebra
1438
+ generators of T over the coefficient field.
1439
+ @* The function returns the input ideal I if one of the options
1440
+ blocking the computation of Hilbert bases has been activated.
1441
+ However, in this case some numerical invariants are computed, and
1442
+ some other data may be contained in files that you can read into
1443
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1444
+ NOTE: A mathematical remark: the toric ring depends on the list of
1445
+ monomials given, and not only on the ideal they generate!
1446
+ SEE ALSO: toricRingFromBinomials, intclToricRing, ehrhartRing, intclMonIdeal, normalToricRingFromBinomials
1447
+ EXAMPLE: example normalToricRing; shows an example
1448
+ "
1449
+ {
1450
+ return(runIntclToricRing(I,"cone_and_lattice",#));
1451
+ }
1452
+ example
1453
+ { "EXAMPLE:"; echo=2;
1454
+ ring R = 37,(x,y,t),dp;
1455
+ ideal I = x3,x2y,y3;
1456
+ normalToricRing(I);
1457
+ }
1458
+
1459
+ proc hilbertSeriesToricRing(ideal I, list #)
1460
+ "USAGE: hilbertSeriesToricRing(ideal I);
1461
+ hilbertSeriesToricRing(ideal I, intvec grading);
1462
+ RETURN: The toric ring is the subalgebra of the ring generated by the
1463
+ leading monomials of the elements of I (considered as a list of
1464
+ polynomials). The function computes the Hilbert series of the toric
1465
+ ring with respect to the grading. It assumes the standard grading on
1466
+ the ambient polynomial ring is none is given explicitly.
1467
+ The grading is normalized, i.e. diided by the gcd of the degrees of the
1468
+ generators.
1469
+ The return value is the pair of numerator polynomial encoded as an
1470
+ intvec and the denomionator, also encoded as an intvec, whose components
1471
+ e stand nfor the factors (1-t^e) of the denominator,
1472
+ NOTE: A mathematical remark: the toric ring depends on the list of
1473
+ monomials given, and not only on the ideal they generate!
1474
+ SEE ALSO: toricRingFromBinomials, normalToricRing, intclToricRing
1475
+ "
1476
+ EXAMPLE: example hilbertSeriesToricRing; shows an example
1477
+ {
1478
+ intmat U = mons2intmat(I);
1479
+ int swallow = setNmzOption("only_hvect",1);
1480
+ intmat Dummy = runNormaliz(U,"monoid", prepareGrading(#));
1481
+ swallow = setNmzOption("only_hvect",0);
1482
+ exportNuminvs();
1483
+ return(nmz_hilbert_series_num,nmz_hilbert_series_denom);
1484
+ }
1485
+ example
1486
+ { "EXAMPLE:"; echo=2;
1487
+ ring R = 37,(x,y),dp;
1488
+ ideal I = x3, x2y,y3;
1489
+ intvec hilb_num, hilb_denom;
1490
+ (hilb_num, hilb_denom) = hilbertSeriesToricRing(I);
1491
+ "num", hilb_num, " denom",hilb_denom;
1492
+ }
1493
+
1494
+ proc normalToricRingFromBinomials(ideal I, list #)
1495
+ "USAGE: normalToricRingFromBinomials(ideal I);
1496
+ normalToricRingFromBinomials(ideal I, intvec grading);
1497
+ RETURN: @texinfo
1498
+ @tex
1499
+ The ideal $I$ is generated by binomials of type $X^a-X^b$ (multiindex notation)
1500
+ in the surrounding polynomial ring $K[X]=K[X_1,...,X_n]$. The binomials
1501
+ represent a congruence on the monoid ${Z}^n$ with residue monoid $M$.
1502
+ Let $N$ be the image of $M$ in gp($M$)/torsion. Then $N$ is universal in the
1503
+ sense that every homomorphism from $M$ to an affine monoid factors through $N$.
1504
+ If $I$ is a prime ideal, then $K[N]= K[X]/I$. In general, $K[N]=K[X]/P$ where
1505
+ $P$ is the unique minimal prime ideal of $I$ generated by binomials of type
1506
+ $X^a-X^b$.
1507
+
1508
+ The function computes the normalization of $K[N]$ and returns a newly created
1509
+ polynomial ring of the same Krull dimension, whose variables are
1510
+ $x(1),...,x(n-r)$, where $r$ is the rank of the matrix with rows $a-b$.
1511
+ (In general there is no canonical choice for such an embedding.)
1512
+ Inside this polynomial ring there is an ideal $I$ which lists the algebra
1513
+ generators of the normalization of $K[N]$.
1514
+ @end tex
1515
+ @end texinfo
1516
+ @* The function returns the input ideal I if an option blocking
1517
+ the computation of Hilbert bases has been activated.
1518
+ However, in this case some numerical invariants are computed, and
1519
+ some other data may be contained in files that you can read into
1520
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1521
+ SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal
1522
+ EXAMPLE: example normalToricRing; shows an example
1523
+ "
1524
+ {
1525
+ intmat expo_vecs = binomials2intmat(I);
1526
+ intmat result = runNormaliz(expo_vecs,"normal_toric_ideal",prepareGrading(#));
1527
+
1528
+ list baseringlist = ringlist(basering);
1529
+ ring S = (baseringlist[1]),(x(1..ncols(result))),dp;
1530
+ ideal I = intmat2mons(result);
1531
+ export(I);
1532
+ return (S);
1533
+ }
1534
+ example
1535
+ { "EXAMPLE:"; echo=2;
1536
+ ring R = 37,(u,v,w,x,y,z),dp;
1537
+ ideal I = u2v-xyz, ux2-wyz, uvw-y2z;
1538
+ def S = normalToricRingFromBinomials(I);
1539
+ setring S;
1540
+ I;
1541
+ }
1542
+
1543
+ proc toricRingFromBinomials(ideal I, list #)
1544
+ "USAGE: toricRingFromBinomials(ideal I);
1545
+ toricRingFromBinomials(ideal I, intvec grading);
1546
+ RETURN: @texinfo
1547
+ @tex
1548
+ The ideal $I$ is generated by binomials of type $X^a-X^b$ (multiindex notation)
1549
+ in the surrounding polynomial ring $K[X]=K[X_1,...,X_n]$. The binomials
1550
+ represent a congruence on the monoid ${Z}^n$ with residue monoid $M$.
1551
+ Let $N$ be the image of $M$ in gp($M$)/torsion. Then $N$ is universal in the
1552
+ sense that every homomorphism from $M$ to an affine monoid factors through $N$.
1553
+ If $I$ is a prime ideal, then $K[N]= K[X]/I$. In general, $K[N]=K[X]/P$ where
1554
+ $P$ is the unique minimal prime ideal of $I$ generated by binomials of type
1555
+ $X^a-X^b$.
1556
+
1557
+ The function computes $K[N]$ and returns a newly created
1558
+ polynomial ring of the same Krull dimension, whose variables are
1559
+ $x(1),...,x(n-r)$, where $r$ is the rank of the matrix with rows $a-b$.
1560
+ (In general there is no canonical choice for such an embedding.)
1561
+ @end tex
1562
+ @end texinfo
1563
+ @* The function returns the input ideal I if an option blocking
1564
+ the computation of Hilbert bases has been activated.
1565
+ However, in this case some numerical invariants are computed, and
1566
+ some other data may be contained in files that you can read into
1567
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1568
+ SEE ALSO: toricRingFromBinomials, normalToricRingFromBinomials
1569
+ EXAMPLE: example normalToricRing; shows an example"
1570
+ {
1571
+ intmat expo_vecs = binomials2intmat(I);
1572
+ intmat result = runNormaliz(expo_vecs,"toric_ideal",prepareGrading(#));
1573
+
1574
+ list baseringlist = ringlist(basering);
1575
+ ring S = (baseringlist[1]),(x(1..ncols(result))),dp;
1576
+ ideal I = intmat2mons(result);
1577
+ export(I);
1578
+ return (S);
1579
+ }
1580
+ example
1581
+ { "EXAMPLE:"; echo=2;
1582
+ ring R = 37,(u,v,w,x,y,z),dp;
1583
+ ideal I = u2v-xyz, ux2-wyz, uvw-y2z;
1584
+ def S = toricRingFromBinomials(I);
1585
+ setring S;
1586
+ I;
1587
+ }
1588
+
1589
+ proc definingBinomialIdeal(ideal I)
1590
+ "USAGE: definingBinomialIdeal(ideal I);
1591
+ RETURN: The toric ring S is the subalgebra of the basering generated by the
1592
+ leading monomials of the elements of I (considered as a list of
1593
+ polynomials). The function computes the computes the definig binomial
1594
+ ideal J of S with respect to the generators and returns it, together with
1595
+ J. See eample.
1596
+ NOTE: A mathematical remark: the toric ring depends on the list of
1597
+ monomials given, and not only on the ideal they generate!
1598
+ This function requires the previous setting of an NmzFilename.
1599
+ The function does not delete the written files.
1600
+ SEE ALSO: normalToricRingFromBinomials
1601
+ EXAMPLE: example definingBinomialIdeal; shows an example"
1602
+ {
1603
+ if(!nmz_files_keep_switch){
1604
+ ERROR("definingBinomialIdeal requires a filename");
1605
+ }
1606
+ setNmzOption("markov",1);
1607
+ intmat Dummy = normaliz(mons2intmat(I), "monoid");
1608
+ setNmzOption("markov",0);
1609
+ intmat bin = readNmzData("mrk");
1610
+ list baseringlist = ringlist(basering);
1611
+ ring S = (baseringlist[1]),(x(1..ncols(bin))),dp;
1612
+ ideal J = intmat2binomials(bin);
1613
+ export(J);
1614
+ return(S);
1615
+ }
1616
+ example
1617
+ { "EXAMPLE:"; echo=2;
1618
+ ring R = 37,(x,y,z,w),dp;
1619
+ ideal I = x4,x3y,x2y2,xy3,y4;
1620
+ setNmzFilename("binomials");
1621
+ def S = definingBinomialIdeal(I);
1622
+ setring S;
1623
+ J;
1624
+ }
1625
+
1626
+
1627
+ proc latticeIdeal(ideal I)
1628
+ "USAGE: latticeIdeal(ideal I);
1629
+ RETURN: Returns the lattice ideal defined by the elements of I
1630
+ which have to be binomials. The lattice ideal is
1631
+ the restriction to the polynomial ring of the ideal of
1632
+ the Laurent polynomial ring generated by I
1633
+ NOTE: This function requires the previous setting of an NmzFilename.
1634
+ The function does not delete the written files.
1635
+ SEE ALSO: intmat2binomials
1636
+ EXAMPLE: example latticeIdeal; shows an example
1637
+ "
1638
+ {
1639
+ if(!nmz_files_keep_switch){
1640
+ ERROR("latticeIdeal requires a filename");
1641
+ }
1642
+ intmat B = binomials2intmat(I);
1643
+ setNmzOption("markov",1);
1644
+ intmat Dummy = normaliz(B, "lattice_ideal");
1645
+ setNmzOption("markov",0);
1646
+ intmat bin = readNmzData("mrk");
1647
+ return(intmat2binomials(bin));
1648
+ }
1649
+ example
1650
+ { "EXAMPLE:"; echo=2;
1651
+ setNmzFilename("binomials");
1652
+ ring S = 37,(u,v,w,x,y,z),dp;
1653
+ ideal I = u2-v2, x2-y2, y2-vw, z2-xy;
1654
+ latticeIdeal(I);
1655
+ }
1656
+
1657
+ proc groebnerBasis(ideal I)
1658
+ "USAGE: groebnerBasis(ideal I);
1659
+ RETURN: Returns a Gr\"obner basis of the lattice ideal defined by the
1660
+ elements of I which have to be binomials. The lattice ideal is
1661
+ the restriction to the polynomial ring of the ideal of
1662
+ the Laurent polynomial ring generated by I. The default monomial
1663
+ order is DegRevLex where Deg is the total degree on the ambient
1664
+ polynomial ring. Lex and DegLex orders can be chosen via options.
1665
+ NOTE: This function requires the previous setting of an NmzFilename.
1666
+ The function does not delete the written files.
1667
+ SEE ALSO: latticeIdeal
1668
+ EXAMPLE: example groebnerBasis; shows an example"
1669
+ {
1670
+
1671
+ if(!nmz_files_keep_switch){
1672
+ ERROR("groebnerBasis requires a filename");
1673
+ }
1674
+ intmat B = binomials2intmat(I);
1675
+ int swallow = setNmzOption("groebner",1);
1676
+ intmat Dummy = normaliz(B, "lattice_ideal");
1677
+ swallow = setNmzOption("groebner",0);
1678
+ intmat bin = readNmzData("grb");
1679
+ return(intmat2binomials(bin));
1680
+ }
1681
+ example
1682
+ { "EXAMPLE:"; echo=2;
1683
+ setNmzFilename("binomials");
1684
+ ring S = 37,(u,v,w,x,y,z),dp;
1685
+ ideal I = u2-v2, x2-y2, y2-vw, z2-xy;
1686
+ groebnerBasis(I);
1687
+ setNmzOption("lex",1);
1688
+ groebnerBasis(I);
1689
+ setNmzOption("lex",0);
1690
+ }
1691
+
1692
+ static proc runIntclMonIdeal(ideal I, string nmz_type, list #)
1693
+ {
1694
+ intmat expo_vecs=mons2intmat(I);
1695
+ int i,last_comp;
1696
+
1697
+ // we test if there is room for the Rees algebra
1698
+
1699
+ for(i=1;i<=nrows(expo_vecs);i++)
1700
+ {
1701
+ if(expo_vecs[i,ncols(expo_vecs)]!=0)
1702
+ {
1703
+ last_comp=1; break; // no
1704
+ }
1705
+ }
1706
+
1707
+ //adjust size of input matrix
1708
+ if (!last_comp) { // remove last component
1709
+ intmat tmp[nrows(expo_vecs)][ncols(expo_vecs)-1]
1710
+ = expo_vecs[1..nrows(expo_vecs),1..(ncols(expo_vecs)-1)];
1711
+ expo_vecs = tmp;
1712
+ }
1713
+ intmat nmz_data=runNormaliz(expo_vecs,nmz_type,prepareGrading(#));
1714
+
1715
+ if(last_comp)
1716
+ {
1717
+ ideal I1=intmat2monsSel(nmz_data,1);
1718
+ return(list(I1));
1719
+ }
1720
+ else
1721
+ {
1722
+ ideal I1=intmat2monsSel(nmz_data,1);
1723
+ ideal I2=intmat2mons(nmz_data);
1724
+ return(list(I1,I2));
1725
+ }
1726
+ }
1727
+
1728
+ proc ehrhartRing(ideal I)
1729
+ "USAGE: ehrhartRing(ideal I);
1730
+ RETURN: The exponent vectors of the leading monomials of the elements of I
1731
+ are considered as points of a lattice polytope P.
1732
+ The Ehrhart ring of a (lattice) polytope P is the monoid algebra
1733
+ defined by the monoid of lattice points in the cone over the
1734
+ polytope P; see Bruns and Gubeladze, Polytopes, Rings, and K-theory,
1735
+ Springer 2009, pp. 228, 229.
1736
+ The function returns a list of ideals:
1737
+ @* (i) If the last ring variable is not used by the monomials, it is
1738
+ treated as the auxiliary variable of the Ehrhart ring. The
1739
+ function returns two ideals, the first containing the monomials
1740
+ representing all the lattice points of the polytope, the second
1741
+ containing the algebra generators of the Ehrhart ring over the
1742
+ coefficient field.
1743
+ @* (ii) If the last ring variable is used by the monomials, the list
1744
+ returned contains only one ideal, namely the monomials
1745
+ representing the lattice points of the polytope.
1746
+ @*
1747
+ @* The function returns the a list containing the input ideal I if
1748
+ an option blocking the computation of the Hilbert basis has been activated.
1749
+ However, in this case some numerical invariants are computed, and
1750
+ some other data may be contained in files that you can read into
1751
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1752
+ NOTE: A mathematical remark: the Ehrhart ring depends on the list of
1753
+ monomials given, and not only on the ideal they generate!
1754
+ SEE ALSO: intclToricRing, normalToricRing, intclMonIdeal
1755
+ EXAMPLE: example ehrhartRing; shows an example
1756
+ "
1757
+ {
1758
+ return(runIntclMonIdeal(I,"polytope"));
1759
+ }
1760
+ example
1761
+ { "EXAMPLE:"; echo=2;
1762
+ ring R=37,(x,y,t),dp;
1763
+ ideal J=x3,x2y,y3,xy2t7;
1764
+ ehrhartRing(J);
1765
+ }
1766
+
1767
+ proc intclMonIdeal(ideal I, list #)
1768
+ "USAGE: intclMonIdeal(ideal I);
1769
+ intclMonIdeal(ideal I, intvec grading);
1770
+ RETURN: The exponent vectors of the leading monomials of the elements of I
1771
+ are considered as generators of a monomial ideal for which the
1772
+ normalization of its Rees algebra is computed. For a Definition of the
1773
+ Rees algebra (or Rees ring) see Bruns and Herzog, Cohen-Macaulay
1774
+ rings, Cambridge University Press 1998, p. 182.
1775
+ The function returns a list of ideals:
1776
+ @* (i) If the last ring variable is not used by the monomials, it is treated
1777
+ as the auxiliary variable of the Rees algebra. The function returns two
1778
+ ideals, the first containing the monomials generating the integral
1779
+ closure of the monomial ideal, the second containing the algebra
1780
+ generators of the normalization of the Rees algebra.
1781
+ @* (ii) If the last ring variable is used by the monomials, the list returned
1782
+ contains only one ideal, namely the monomials generating the integral
1783
+ closure of the ideal.
1784
+ @* The function returns the a list containing the input ideal I if an option
1785
+ blocking the computation of Hilbert bases has been activated.
1786
+ However, in this case some numerical invariants are computed, and
1787
+ some other data may be contained in files that you can read into
1788
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1789
+ SEE ALSO: intclToricRing, normalToricRing, ehrhartRing
1790
+ EXAMPLE: example intclMonIdeal; shows an example
1791
+ "
1792
+ {
1793
+ return(runIntclMonIdeal(I,"rees_algebra",#));
1794
+ }
1795
+ example
1796
+ { "EXAMPLE:"; echo=2;
1797
+ ring R=0,(x,y,z,t),dp;
1798
+ ideal I=x^2,y^2,z^3;
1799
+ list l=intclMonIdeal(I);
1800
+ l[1]; // integral closure of I
1801
+ l[2]; // monomials generating the integral closure of the Rees algebra
1802
+ }
1803
+
1804
+ // torus invariants and valuation rings and ideals
1805
+
1806
+ proc torusInvariants(intmat E, list #)
1807
+ "USAGE: torusInvariants(intmat A);
1808
+ torusInvariants(intmat A, intvec grading);
1809
+ RETURN: @texinfo
1810
+ Returns an ideal representing the list of monomials generating the ring of
1811
+ invariants as an algebra over the coefficient field.
1812
+ @tex
1813
+ $R^T$.
1814
+ @end tex
1815
+ @* The function returns the ideal given by the input matrix A if one of
1816
+ the options @code{supp}, @code{triang}, @code{volume}, or
1817
+ @code{hseries} has been activated.
1818
+ However, in this case some numerical invariants are computed, and
1819
+ some other data may be contained in files that you can read into
1820
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1821
+ @end texinfo
1822
+ BACKGROUND: @texinfo
1823
+ @tex
1824
+ Let $T = (K^*)^r$ be the $r$-dimensional torus acting on the polynomial ring
1825
+ $R = K[X_1 ,\ldots,X_n]$ diagonally. Such an action can be described as
1826
+ follows: there are integers $a_{i,j}$, $i=1,\ldots,r$, $j=1,\ldots,n$, such
1827
+ that $(\lambda_1,\ldots,\lambda_r)\in T$ acts by the substitution
1828
+ $$ X_j \mapsto \lambda_1^{a_{1,j}} \cdots \lambda_r^{a_{r,j}}X_j,
1829
+ \quad j=1,\ldots,n.$$
1830
+ In order to compute the ring of invariants $R^T$ one must specify the matrix
1831
+ $A=(a_{i,j})$.
1832
+ @end tex
1833
+ @end texinfo
1834
+ SEE ALSO: diagInvariants, finiteDiagInvariants, intersectionValRings,
1835
+ intersectionValRingIdeals
1836
+ EXAMPLE: example torusInvariants; shows an example
1837
+ "
1838
+ {
1839
+ if(nvars(basering)!=ncols(E))
1840
+ {
1841
+ ERROR("torusInvariants: wrong number of columns in matrix");
1842
+ }
1843
+ return( intmat2mons( runNormaliz(E,"equations",prepareGrading(#)) ) );
1844
+ }
1845
+ example
1846
+ { "EXAMPLE:"; echo=2;
1847
+ ring R=0,(x,y,z,w),dp;
1848
+ intmat E[2][4] = -1,-1,2,0, 1,1,-2,-1;
1849
+ torusInvariants(E);
1850
+ }
1851
+
1852
+ proc finiteDiagInvariants(intmat C, list #)
1853
+ "USAGE: finiteDiagInvariants(intmat U);
1854
+ finiteDiagInvariants(intmat U, intvec grading);
1855
+ RETURN: @texinfo
1856
+ @tex
1857
+ This function computes the ring of invariants of a finite abelian group $G$
1858
+ acting diagonally on the surrounding polynomial ring $K[X_1,...,X_n]$. The
1859
+ group is the direct product of cyclic groups generated by finitely many
1860
+ elements $g_1,...,g_w$. The element $g_i$ acts on the indeterminate $X_j$ by
1861
+ $g_i(X_j)=\lambda_i^{u_{ij}}X_j$ where $\lambda_i$ is a primitive root of
1862
+ unity of order equal to $ord(g_i)$. The ring of invariants is generated by all
1863
+ monomials satisfying the system
1864
+ $u_{i1}a_1+\ldots+u_{in} a_n \equiv 0$ mod ord$(g_i)$, $i=1,\ldots,w$.
1865
+ The input to the function is the $w\times(n+1)$ matrix $U$ with rows
1866
+ $u_{i1}\ldots u_{in}$ ord$(gi)$, $i=1,\ldots,w$. The output is a monomial ideal
1867
+ listing the algebra generators of the subalgebra of invariants
1868
+ {$R^G=\{f\in R : g_i f = f$ for all $i=1,\ldots,w\}$}.
1869
+ @end tex
1870
+ @end texinfo
1871
+ @* The function returns the ideal given by the input matrix C if one of
1872
+ the options @code{supp}, @code{triang}, @code{volume}, or
1873
+ @code{hseries} has been activated.
1874
+ However, in this case some numerical invariants are computed, and
1875
+ some other data may be contained in files that you can read into
1876
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1877
+ NOTE:
1878
+ SEE ALSO: torusInvariants, diagInvariants, intersectionValRings,
1879
+ intersectionValRingIdeals
1880
+ EXAMPLE: example finiteDiagInvariants; shows an example
1881
+ "
1882
+ {
1883
+ if(nvars(basering)!=ncols(C)-1)
1884
+ {
1885
+ ERROR("finiteDiagInvariants: wrong number of columns in matrix");
1886
+ }
1887
+ return( intmat2mons( runNormaliz(C,"congruences",prepareGrading(#)) ) );
1888
+ }
1889
+ example
1890
+ { "EXAMPLE:"; echo=2;
1891
+ ring R = 0,(x,y,z,w),dp;
1892
+ intmat C[2][5] = 1,1,1,1,5, 1,0,2,0,7;
1893
+ finiteDiagInvariants(C);
1894
+ }
1895
+
1896
+ proc diagInvariants(intmat E, intmat C, list #)
1897
+ "USAGE: diagInvariants(intmat A, intmat U);
1898
+ diagInvariants(intmat A, intmat U, intvec grading);
1899
+ RETURN: @texinfo
1900
+ @tex
1901
+ This function computes the ring of invariants of a diagonalizable group
1902
+ $D = T\times G$ where $T$ is a torus and $G$ is a finite abelian group, both
1903
+ acting diagonally on the polynomial ring $K[X_1,\ldots,X_n]$. The group
1904
+ actions are specified by the input matrices A and U. The first matrix specifies
1905
+ the torus action, the second the action of the finite group. See
1906
+ torusInvariants and finiteDiagInvariants for more detail. The output is a
1907
+ monomial ideal listing the algebra generators of the subalgebra of invariants.
1908
+ @end tex
1909
+ @end texinfo
1910
+ @* The function returns the ideal given by the input matrix A if one of
1911
+ the options @code{supp}, @code{triang}, @code{volume}, or
1912
+ @code{hseries} has been activated.
1913
+ However, in this case some numerical invariants are computed, and
1914
+ some other data may be contained in files that you can read into
1915
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1916
+ SEE ALSO: torusInvariants, finiteDiagInvariants, intersectionValRings, intersectionValRingIdeals
1917
+ EXAMPLE: example diagInvariants; shows an example
1918
+ "
1919
+ {
1920
+ if(nvars(basering)!=ncols(E) || nvars(basering)!=ncols(C)-1)
1921
+ {
1922
+ ERROR("diagInvariants: wrong number of columns in matrix");
1923
+ }
1924
+ return( intmat2mons( runNormaliz(E,"equations",C,"congruences",prepareGrading(#)) ) );
1925
+ }
1926
+ example
1927
+ { "EXAMPLE:"; echo=2;
1928
+ ring R=0,(x,y,z,w),dp;
1929
+ intmat E[2][4] = -1,-1,2,0, 1,1,-2,-1;
1930
+ intmat C[2][5] = 1,1,1,1,5, 1,0,2,0,7;
1931
+ diagInvariants(E,C);
1932
+ }
1933
+
1934
+ proc intersectionValRings(intmat V, list #)
1935
+ "USAGE: intersectionValRings(intmat V, intvec grading);
1936
+ RETURN: The function returns a monomial ideal, to be considered as the list
1937
+ of monomials generating @math{S} as an algebra over the coefficient
1938
+ field.
1939
+ BACKGROUND: @texinfo
1940
+ @tex
1941
+ A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by
1942
+ the values $v(X_j)$ of the indeterminates. This function computes the
1943
+ subalgebra $S = \{ f \in R : v_i ( f ) \geq 0,\ i = 1,\ldots,r\}$ for several
1944
+ such valuations $v_i$, $i=1,\ldots,r$. It needs the matrix $V = (v_i(X_j))$ as
1945
+ its input.
1946
+ @end tex
1947
+ @end texinfo
1948
+ @* The function returns the ideal given by the input matrix V if one of
1949
+ the options @code{supp}, @code{triang}, @code{volume}, or
1950
+ @code{hseries} has been activated.
1951
+ However, in this case some numerical invariants are computed, and
1952
+ some other data may be contained in files that you can read into
1953
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
1954
+ SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRingIdeals
1955
+ EXAMPLE: example intersectionValRings; shows an example
1956
+ "
1957
+ {
1958
+
1959
+ if(nvars(basering)!=ncols(V))
1960
+ {
1961
+ ERROR("intersectionValRings: wrong number of columns in matrix");
1962
+ }
1963
+
1964
+ intmat V1[nrows(V)+ncols(V)][ncols(V)];
1965
+ int i,j;
1966
+
1967
+ for(i=1;i<=ncols(V);i++)
1968
+ {
1969
+ V1[i,i]=1;
1970
+ }
1971
+ for(i=1;i<=nrows(V);i++)
1972
+ {
1973
+ for(j=1;j<=ncols(V);j++)
1974
+ {
1975
+ V1[i+ncols(V),j]=V[i,j];
1976
+ }
1977
+ }
1978
+
1979
+ /* if(!GenGen) // return V
1980
+ {
1981
+ runNormaliz(V1,4,prepareGrading(#));
1982
+ return(V);
1983
+ }
1984
+ */
1985
+ return(intmat2mons(runNormaliz(V1,"inequalities",prepareGrading(#))));
1986
+ }
1987
+ example
1988
+ { "EXAMPLE:"; echo=2;
1989
+ ring R=0,(x,y,z,w),dp;
1990
+ intmat V0[2][4]=0,1,2,3, -1,1,2,1;
1991
+ intersectionValRings(V0);
1992
+ }
1993
+
1994
+ proc intersectionValRingIdeals(intmat V, list #)
1995
+ "USAGE: intersectionValRingIdeals(intmat V);
1996
+ intersectionValRingIdeals(intmat V, intvec grading);
1997
+ RETURN: The function returns two ideals, both to be considered as lists of
1998
+ monomials. The
1999
+ first is the system of monomial generators of @math{S}, the second
2000
+ the system of generators of @math{M}.
2001
+ @* The function returns a list consisting of the ideal given by the
2002
+ blocking the computation of Hilbert bases has been activated.
2003
+ However, in this case some numerical invariants are computed, and
2004
+ some other data may be contained in files that you can read into
2005
+ Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
2006
+ BACKGROUND: @texinfo
2007
+ @tex
2008
+ A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by
2009
+ the values $v(X_j)$ of the indeterminates. This function computes the
2010
+ subalgebra $S = \{ f \in R : v_i ( f ) \geq 0,\ i = 1,\ldots,r\}$ for several
2011
+ such valuations $v_i$, $i=1,\ldots,r$. It needs the matrix $V = (v_i(X_j))$ as
2012
+ its input.
2013
+
2014
+ This function simultaneously determines the $S$-submodule
2015
+ $M = \{ f \in R : v_i(f) \geq w_i ,\ i = 1,\ldots,r\}$ for integers
2016
+ $w_1,\ldots\,w_r$. (If $w_i \geq 0$ for all $i$, $M$ is an ideal of $S$.)
2017
+ The numbers $w_i$ form the $(n+1)$th column of the input matrix.
2018
+ @end tex
2019
+ @end texinfo
2020
+ NOTE: The function also gives an error message if the matrix V has the
2021
+ wrong number of columns.
2022
+ SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRings
2023
+ EXAMPLE: example intersectionValRingIdeals; shows an example
2024
+ "
2025
+ {
2026
+ if(nvars(basering)!=ncols(V)-1)
2027
+ {
2028
+ ERROR("intersectionValRingIdeals: wrong number of columns in matrix");
2029
+ }
2030
+
2031
+ intmat V1[nrows(V)+ncols(V)][ncols(V)];
2032
+ int i,j;
2033
+
2034
+ for(i=1;i<=ncols(V);i++)
2035
+ {
2036
+ V1[i,i]=1;
2037
+ }
2038
+ for(i=1;i<=nrows(V);i++)
2039
+ {
2040
+ for(j=1;j<=ncols(V);j++)
2041
+ {
2042
+ V1[i+ncols(V),j]=V[i,j];
2043
+ }
2044
+ }
2045
+ for(i=1;i<=nrows(V);i++)
2046
+ {
2047
+ V1[i+ncols(V),ncols(V)]=-V1[i+ncols(V),ncols(V)];
2048
+ }
2049
+
2050
+ intmat nmz_data=runNormaliz(V1,"inequalities",prepareGrading(#));
2051
+ ideal I1=intmat2monsSel(nmz_data,0);
2052
+ ideal I2=intmat2monsSel(nmz_data,1);
2053
+ return(list(I1,I2));
2054
+ }
2055
+ example
2056
+ { "EXAMPLE:"; echo=2;
2057
+ ring R=0,(x,y,z,w),dp;
2058
+ intmat V[2][5]=0,1,2,3,4, -1,1,2,1,3;
2059
+ intersectionValRingIdeals(V);
2060
+ }
2061
+
2062
+ proc allNmzOptions()
2063
+ "USAGE: proc alNmzOptions();
2064
+ PURPOSE: The function prints a list of the Normaliz options that
2065
+ are available in this library: the string naming the option,
2066
+ the default value, and the option sent to Normaliz.
2067
+ SEE ALSO: setNmzOption, showNmzOptions
2068
+ EXAMPLE: example allNmzOptions; shows an example
2069
+ "
2070
+ {
2071
+ for(int i=1;i<=size(nmz_options);i++){
2072
+ if(size(nmz_options[i]) == 3){
2073
+ nmz_options[i][1], nmz_options[i][2], nmz_options[i][3];
2074
+ }
2075
+ else{
2076
+ nmz_options[i][1], nmz_options[i][2], nmz_options[i][3], nmz_options[i][4] ;
2077
+ }
2078
+ }
2079
+ " ";
2080
+ }
2081
+ example
2082
+ { "EXAMPLE:"; echo=2;
2083
+ allNmzOptions();
2084
+ }
2085
+
2086
+ static proc mod_init()
2087
+ {
2088
+ string nmz_exec_path; export nmz_exec_path;
2089
+ string nmz_filename; export nmz_filename;
2090
+ int nmz_files_keep_switch;export nmz_files_keep_switch;
2091
+ string nmz_data_path; export nmz_data_path;
2092
+ // int GenGen=1; export GenGen; // indicates whether "gen" is generated // no longer used
2093
+ list Num_Invs; export Num_Invs;
2094
+ list Exported_Num_Invs; export Exported_Num_Invs;
2095
+ // running normaliz (with options)
2096
+
2097
+ // component 1 is name of option
2098
+ // 2 is default value
2099
+ // 3 is command line option to be passed to Normaliz
2100
+ // 4 indicates whether file "gen" is generated
2101
+ // value 2 of 4 indicates "no influence"
2102
+
2103
+ list nmz_options=
2104
+ list("supp",0,"-s"),
2105
+ list("triang",0,"-T"),
2106
+ list("volume",0,"-v"),
2107
+ list("hvect",0,"-p"," -- name deprecated, use hvect_deg1"),
2108
+ list("hvect_deg1",0, "-p"),
2109
+ list("only_hvect",0,"-q"),
2110
+ list("fvect",0,"--FVector"),
2111
+ list("height1",0,"-1"),
2112
+ list("Gorenst",0,"-G"),
2113
+ list("intclosed",0,"--IsIntegrallyClosed"),
2114
+ list("witness",0,"--w"),
2115
+ list("classgroup",0,"-C"),
2116
+ list("normal",0,"-n"," -- name deprecated, use hilbbasvol"),
2117
+ list("hilbbasvol",0,"-n"),
2118
+ list("normal_l",0,"-N"," -- name deprecated, use hilbbas"),
2119
+ list("hilbbas",0,"-N"),
2120
+ list("hilb",0,"-h"," -- name deprecated, use hilbbas_hvect"),
2121
+ list("hilbbas_hvect",0,"-h"),
2122
+ list("dual",0,"-d"),
2123
+ list("markov", 0, "--MarkovBasis --BinomialsPacked"),
2124
+ list("groebner", 0, "--GroebnerBasis --BinomialsPacked"),
2125
+ list("lex", 0, "--Lex"),
2126
+ list("revlex", 0, "--RevLex"),
2127
+ list("lex", 0, "--Lex"),
2128
+ list("deglex", 0, "--DegLex"),
2129
+ list("genoverori",0,"-M --mod"),
2130
+ list("type",0,"--typ"),
2131
+ list("control",0,"-c"," -- name deprecated, use verbose"),
2132
+ list("verbose",0,"-c"),
2133
+ list("allf",0,"-a"),
2134
+ list("bigint",0,"-B"),
2135
+ list("threads",8,"-x="),
2136
+ list("errorcheck",0,"-e", " -- allowed, but ignored by Normaliz");
2137
+ export nmz_options;
2138
+ list default_options = nmz_options;
2139
+ export default_options;
2140
+ }