passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-singular might be problematic. Click here for more details.
- PySingular.cpython-314-aarch64-linux-gnu.so +0 -0
- passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
- passagemath_singular-10.6.31rc3.dist-info/RECORD +490 -0
- passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
- passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
- passagemath_singular.libs/libSingular-4-6a2a8666.4.1.so +0 -0
- passagemath_singular.libs/libcddgmp-ac579979.so.0.1.3 +0 -0
- passagemath_singular.libs/libfactory-4-66e33516.4.1.so +0 -0
- passagemath_singular.libs/libflint-81de1160.so.21.0.0 +0 -0
- passagemath_singular.libs/libgf2x-fbd36f80.so.3.0.0 +0 -0
- passagemath_singular.libs/libgfortran-e1b7dfc8.so.5.0.0 +0 -0
- passagemath_singular.libs/libgmp-93ebf16a.so.10.5.0 +0 -0
- passagemath_singular.libs/libgsl-e3525837.so.28.0.0 +0 -0
- passagemath_singular.libs/libmpfr-e0f11cf3.so.6.2.1 +0 -0
- passagemath_singular.libs/libntl-0043a3a2.so.44.0.1 +0 -0
- passagemath_singular.libs/libomalloc-0-06512335.9.6.so +0 -0
- passagemath_singular.libs/libopenblasp-r0-4c5b64b1.3.29.so +0 -0
- passagemath_singular.libs/libpolys-4-cb7246b5.4.1.so +0 -0
- passagemath_singular.libs/libreadline-28330744.so.8.2 +0 -0
- passagemath_singular.libs/libsingular_resources-4-8c425241.4.1.so +0 -0
- passagemath_singular.libs/libtinfo-f81c2d16.so.6.3 +0 -0
- sage/algebras/all__sagemath_singular.py +3 -0
- sage/algebras/fusion_rings/all.py +19 -0
- sage/algebras/fusion_rings/f_matrix.py +2448 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
- sage/algebras/fusion_rings/fusion_double.py +899 -0
- sage/algebras/fusion_rings/fusion_ring.py +1580 -0
- sage/algebras/fusion_rings/poly_tup_engine.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
- sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
- sage/algebras/fusion_rings/shm_managers.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/shm_managers.pxd +24 -0
- sage/algebras/fusion_rings/shm_managers.pyx +780 -0
- sage/algebras/letterplace/all.py +1 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
- sage/algebras/letterplace/free_algebra_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
- sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
- sage/algebras/letterplace/letterplace_ideal.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
- sage/algebras/quatalg/all.py +2 -0
- sage/algebras/quatalg/quaternion_algebra.py +4778 -0
- sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
- sage/algebras/quatalg/quaternion_algebra_element.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
- sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
- sage/all__sagemath_singular.py +11 -0
- sage/ext_data/all__sagemath_singular.py +1 -0
- sage/ext_data/singular/function_field/core.lib +98 -0
- sage/interfaces/all__sagemath_singular.py +1 -0
- sage/interfaces/singular.py +2835 -0
- sage/libs/all__sagemath_singular.py +1 -0
- sage/libs/singular/__init__.py +1 -0
- sage/libs/singular/decl.pxd +1168 -0
- sage/libs/singular/function.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/function.pxd +87 -0
- sage/libs/singular/function.pyx +1901 -0
- sage/libs/singular/function_factory.py +61 -0
- sage/libs/singular/groebner_strategy.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/groebner_strategy.pxd +22 -0
- sage/libs/singular/groebner_strategy.pyx +582 -0
- sage/libs/singular/option.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/option.pyx +671 -0
- sage/libs/singular/polynomial.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/polynomial.pxd +39 -0
- sage/libs/singular/polynomial.pyx +661 -0
- sage/libs/singular/ring.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/ring.pxd +58 -0
- sage/libs/singular/ring.pyx +893 -0
- sage/libs/singular/singular.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/singular.pxd +72 -0
- sage/libs/singular/singular.pyx +1944 -0
- sage/libs/singular/standard_options.py +145 -0
- sage/matrix/all__sagemath_singular.py +1 -0
- sage/matrix/matrix_mpolynomial_dense.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
- sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
- sage/rings/all__sagemath_singular.py +1 -0
- sage/rings/function_field/all__sagemath_singular.py +1 -0
- sage/rings/function_field/derivations_polymod.py +911 -0
- sage/rings/function_field/element_polymod.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/function_field/element_polymod.pyx +406 -0
- sage/rings/function_field/function_field_polymod.py +2611 -0
- sage/rings/function_field/ideal_polymod.py +1775 -0
- sage/rings/function_field/order_polymod.py +1475 -0
- sage/rings/function_field/place_polymod.py +681 -0
- sage/rings/polynomial/all__sagemath_singular.py +1 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
- sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
- sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
- sage/rings/polynomial/plural.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/plural.pxd +48 -0
- sage/rings/polynomial/plural.pyx +3171 -0
- sage/symbolic/all__sagemath_singular.py +1 -0
- sage/symbolic/comparison_impl.pxi +428 -0
- sage/symbolic/constants_c_impl.pxi +178 -0
- sage/symbolic/expression.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/symbolic/expression.pxd +7 -0
- sage/symbolic/expression.pyx +14200 -0
- sage/symbolic/getitem_impl.pxi +202 -0
- sage/symbolic/pynac.pxi +572 -0
- sage/symbolic/pynac_constant_impl.pxi +133 -0
- sage/symbolic/pynac_function_impl.pxi +206 -0
- sage/symbolic/pynac_impl.pxi +2576 -0
- sage/symbolic/pynac_wrap.h +124 -0
- sage/symbolic/series_impl.pxi +272 -0
- sage/symbolic/substitution_map_impl.pxi +94 -0
- sage_wheels/bin/ESingular +0 -0
- sage_wheels/bin/Singular +0 -0
- sage_wheels/bin/TSingular +0 -0
- sage_wheels/lib/singular/MOD/cohomo.la +41 -0
- sage_wheels/lib/singular/MOD/cohomo.so +0 -0
- sage_wheels/lib/singular/MOD/customstd.la +41 -0
- sage_wheels/lib/singular/MOD/customstd.so +0 -0
- sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
- sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
- sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
- sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
- sage_wheels/lib/singular/MOD/gitfan.la +41 -0
- sage_wheels/lib/singular/MOD/gitfan.so +0 -0
- sage_wheels/lib/singular/MOD/interval.la +41 -0
- sage_wheels/lib/singular/MOD/interval.so +0 -0
- sage_wheels/lib/singular/MOD/loctriv.la +41 -0
- sage_wheels/lib/singular/MOD/loctriv.so +0 -0
- sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
- sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
- sage_wheels/lib/singular/MOD/partialgb.la +41 -0
- sage_wheels/lib/singular/MOD/partialgb.so +0 -0
- sage_wheels/lib/singular/MOD/pyobject.la +41 -0
- sage_wheels/lib/singular/MOD/pyobject.so +0 -0
- sage_wheels/lib/singular/MOD/singmathic.la +41 -0
- sage_wheels/lib/singular/MOD/singmathic.so +0 -0
- sage_wheels/lib/singular/MOD/sispasm.la +41 -0
- sage_wheels/lib/singular/MOD/sispasm.so +0 -0
- sage_wheels/lib/singular/MOD/subsets.la +41 -0
- sage_wheels/lib/singular/MOD/subsets.so +0 -0
- sage_wheels/lib/singular/MOD/systhreads.la +41 -0
- sage_wheels/lib/singular/MOD/systhreads.so +0 -0
- sage_wheels/lib/singular/MOD/syzextra.la +41 -0
- sage_wheels/lib/singular/MOD/syzextra.so +0 -0
- sage_wheels/libexec/singular/MOD/change_cost +0 -0
- sage_wheels/libexec/singular/MOD/singularsurf +11 -0
- sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
- sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
- sage_wheels/libexec/singular/MOD/solve_IP +0 -0
- sage_wheels/libexec/singular/MOD/surfex +16 -0
- sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
- sage_wheels/share/factory/gftables/10201 +342 -0
- sage_wheels/share/factory/gftables/1024 +37 -0
- sage_wheels/share/factory/gftables/10609 +356 -0
- sage_wheels/share/factory/gftables/11449 +384 -0
- sage_wheels/share/factory/gftables/11881 +398 -0
- sage_wheels/share/factory/gftables/121 +6 -0
- sage_wheels/share/factory/gftables/12167 +408 -0
- sage_wheels/share/factory/gftables/125 +7 -0
- sage_wheels/share/factory/gftables/12769 +428 -0
- sage_wheels/share/factory/gftables/128 +7 -0
- sage_wheels/share/factory/gftables/1331 +47 -0
- sage_wheels/share/factory/gftables/1369 +48 -0
- sage_wheels/share/factory/gftables/14641 +490 -0
- sage_wheels/share/factory/gftables/15625 +523 -0
- sage_wheels/share/factory/gftables/16 +3 -0
- sage_wheels/share/factory/gftables/16129 +540 -0
- sage_wheels/share/factory/gftables/16384 +549 -0
- sage_wheels/share/factory/gftables/16807 +563 -0
- sage_wheels/share/factory/gftables/1681 +58 -0
- sage_wheels/share/factory/gftables/169 +8 -0
- sage_wheels/share/factory/gftables/17161 +574 -0
- sage_wheels/share/factory/gftables/1849 +64 -0
- sage_wheels/share/factory/gftables/18769 +628 -0
- sage_wheels/share/factory/gftables/19321 +646 -0
- sage_wheels/share/factory/gftables/19683 +659 -0
- sage_wheels/share/factory/gftables/2048 +71 -0
- sage_wheels/share/factory/gftables/2187 +75 -0
- sage_wheels/share/factory/gftables/2197 +76 -0
- sage_wheels/share/factory/gftables/2209 +76 -0
- sage_wheels/share/factory/gftables/22201 +742 -0
- sage_wheels/share/factory/gftables/22801 +762 -0
- sage_wheels/share/factory/gftables/2401 +82 -0
- sage_wheels/share/factory/gftables/243 +11 -0
- sage_wheels/share/factory/gftables/24389 +815 -0
- sage_wheels/share/factory/gftables/24649 +824 -0
- sage_wheels/share/factory/gftables/25 +3 -0
- sage_wheels/share/factory/gftables/256 +11 -0
- sage_wheels/share/factory/gftables/26569 +888 -0
- sage_wheels/share/factory/gftables/27 +3 -0
- sage_wheels/share/factory/gftables/27889 +932 -0
- sage_wheels/share/factory/gftables/2809 +96 -0
- sage_wheels/share/factory/gftables/28561 +954 -0
- sage_wheels/share/factory/gftables/289 +12 -0
- sage_wheels/share/factory/gftables/29791 +995 -0
- sage_wheels/share/factory/gftables/29929 +1000 -0
- sage_wheels/share/factory/gftables/3125 +107 -0
- sage_wheels/share/factory/gftables/32 +4 -0
- sage_wheels/share/factory/gftables/32041 +1070 -0
- sage_wheels/share/factory/gftables/32761 +1094 -0
- sage_wheels/share/factory/gftables/32768 +1095 -0
- sage_wheels/share/factory/gftables/343 +14 -0
- sage_wheels/share/factory/gftables/3481 +118 -0
- sage_wheels/share/factory/gftables/361 +14 -0
- sage_wheels/share/factory/gftables/36481 +1218 -0
- sage_wheels/share/factory/gftables/3721 +126 -0
- sage_wheels/share/factory/gftables/37249 +1244 -0
- sage_wheels/share/factory/gftables/38809 +1296 -0
- sage_wheels/share/factory/gftables/39601 +1322 -0
- sage_wheels/share/factory/gftables/4 +3 -0
- sage_wheels/share/factory/gftables/4096 +139 -0
- sage_wheels/share/factory/gftables/44521 +1486 -0
- sage_wheels/share/factory/gftables/4489 +152 -0
- sage_wheels/share/factory/gftables/49 +4 -0
- sage_wheels/share/factory/gftables/4913 +166 -0
- sage_wheels/share/factory/gftables/49729 +1660 -0
- sage_wheels/share/factory/gftables/5041 +170 -0
- sage_wheels/share/factory/gftables/50653 +1691 -0
- sage_wheels/share/factory/gftables/512 +20 -0
- sage_wheels/share/factory/gftables/51529 +1720 -0
- sage_wheels/share/factory/gftables/52441 +1750 -0
- sage_wheels/share/factory/gftables/529 +20 -0
- sage_wheels/share/factory/gftables/5329 +180 -0
- sage_wheels/share/factory/gftables/54289 +1812 -0
- sage_wheels/share/factory/gftables/57121 +1906 -0
- sage_wheels/share/factory/gftables/58081 +1938 -0
- sage_wheels/share/factory/gftables/59049 +1971 -0
- sage_wheels/share/factory/gftables/6241 +210 -0
- sage_wheels/share/factory/gftables/625 +23 -0
- sage_wheels/share/factory/gftables/63001 +2102 -0
- sage_wheels/share/factory/gftables/64 +5 -0
- sage_wheels/share/factory/gftables/6561 +221 -0
- sage_wheels/share/factory/gftables/6859 +231 -0
- sage_wheels/share/factory/gftables/6889 +232 -0
- sage_wheels/share/factory/gftables/729 +27 -0
- sage_wheels/share/factory/gftables/7921 +266 -0
- sage_wheels/share/factory/gftables/8 +3 -0
- sage_wheels/share/factory/gftables/81 +5 -0
- sage_wheels/share/factory/gftables/8192 +276 -0
- sage_wheels/share/factory/gftables/841 +30 -0
- sage_wheels/share/factory/gftables/9 +3 -0
- sage_wheels/share/factory/gftables/9409 +316 -0
- sage_wheels/share/factory/gftables/961 +34 -0
- sage_wheels/share/info/singular.info +191898 -0
- sage_wheels/share/singular/LIB/GND.lib +1359 -0
- sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
- sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
- sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
- sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
- sage_wheels/share/singular/LIB/VecField.lib +1542 -0
- sage_wheels/share/singular/LIB/absfact.lib +959 -0
- sage_wheels/share/singular/LIB/ainvar.lib +730 -0
- sage_wheels/share/singular/LIB/aksaka.lib +419 -0
- sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
- sage_wheels/share/singular/LIB/algebra.lib +1193 -0
- sage_wheels/share/singular/LIB/all.lib +136 -0
- sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
- sage_wheels/share/singular/LIB/arnold.lib +4553 -0
- sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
- sage_wheels/share/singular/LIB/arr.lib +3486 -0
- sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
- sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
- sage_wheels/share/singular/LIB/bfun.lib +1964 -0
- sage_wheels/share/singular/LIB/bimodules.lib +774 -0
- sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
- sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
- sage_wheels/share/singular/LIB/central.lib +2169 -0
- sage_wheels/share/singular/LIB/chern.lib +4162 -0
- sage_wheels/share/singular/LIB/cimonom.lib +571 -0
- sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
- sage_wheels/share/singular/LIB/classify.lib +3239 -0
- sage_wheels/share/singular/LIB/classify2.lib +1462 -0
- sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
- sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
- sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
- sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
- sage_wheels/share/singular/LIB/combinat.lib +91 -0
- sage_wheels/share/singular/LIB/compregb.lib +276 -0
- sage_wheels/share/singular/LIB/control.lib +1636 -0
- sage_wheels/share/singular/LIB/crypto.lib +3795 -0
- sage_wheels/share/singular/LIB/curveInv.lib +667 -0
- sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
- sage_wheels/share/singular/LIB/customstd.lib +100 -0
- sage_wheels/share/singular/LIB/deRham.lib +5979 -0
- sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
- sage_wheels/share/singular/LIB/decomp.lib +1655 -0
- sage_wheels/share/singular/LIB/deflation.lib +872 -0
- sage_wheels/share/singular/LIB/deform.lib +925 -0
- sage_wheels/share/singular/LIB/difform.lib +3055 -0
- sage_wheels/share/singular/LIB/divisors.lib +750 -0
- sage_wheels/share/singular/LIB/dmod.lib +5817 -0
- sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
- sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
- sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
- sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
- sage_wheels/share/singular/LIB/dummy.lib +17 -0
- sage_wheels/share/singular/LIB/elim.lib +1009 -0
- sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
- sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
- sage_wheels/share/singular/LIB/equising.lib +2127 -0
- sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
- sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
- sage_wheels/share/singular/LIB/findifs.lib +778 -0
- sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
- sage_wheels/share/singular/LIB/finvar.lib +7989 -0
- sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
- sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
- sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
- sage_wheels/share/singular/LIB/freegb.lib +3853 -0
- sage_wheels/share/singular/LIB/general.lib +1350 -0
- sage_wheels/share/singular/LIB/gfan.lib +1768 -0
- sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
- sage_wheels/share/singular/LIB/gkdim.lib +99 -0
- sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
- sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
- sage_wheels/share/singular/LIB/goettsche.lib +909 -0
- sage_wheels/share/singular/LIB/graal.lib +1366 -0
- sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
- sage_wheels/share/singular/LIB/graphics.lib +360 -0
- sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
- sage_wheels/share/singular/LIB/groups.lib +1123 -0
- sage_wheels/share/singular/LIB/grwalk.lib +507 -0
- sage_wheels/share/singular/LIB/hdepth.lib +194 -0
- sage_wheels/share/singular/LIB/help.cnf +57 -0
- sage_wheels/share/singular/LIB/hess.lib +1946 -0
- sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
- sage_wheels/share/singular/LIB/hodge.lib +400 -0
- sage_wheels/share/singular/LIB/homolog.lib +1965 -0
- sage_wheels/share/singular/LIB/hyperel.lib +975 -0
- sage_wheels/share/singular/LIB/inout.lib +679 -0
- sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
- sage_wheels/share/singular/LIB/interval.lib +1418 -0
- sage_wheels/share/singular/LIB/intprog.lib +778 -0
- sage_wheels/share/singular/LIB/invar.lib +443 -0
- sage_wheels/share/singular/LIB/involut.lib +980 -0
- sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
- sage_wheels/share/singular/LIB/kskernel.lib +534 -0
- sage_wheels/share/singular/LIB/latex.lib +3146 -0
- sage_wheels/share/singular/LIB/lejeune.lib +651 -0
- sage_wheels/share/singular/LIB/linalg.lib +2040 -0
- sage_wheels/share/singular/LIB/locnormal.lib +212 -0
- sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
- sage_wheels/share/singular/LIB/makedbm.lib +294 -0
- sage_wheels/share/singular/LIB/mathml.lib +813 -0
- sage_wheels/share/singular/LIB/matrix.lib +1372 -0
- sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
- sage_wheels/share/singular/LIB/methods.lib +212 -0
- sage_wheels/share/singular/LIB/moddiq.lib +322 -0
- sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
- sage_wheels/share/singular/LIB/modnormal.lib +218 -0
- sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
- sage_wheels/share/singular/LIB/modquotient.lib +269 -0
- sage_wheels/share/singular/LIB/modstd.lib +1024 -0
- sage_wheels/share/singular/LIB/modular.lib +545 -0
- sage_wheels/share/singular/LIB/modules.lib +2561 -0
- sage_wheels/share/singular/LIB/modwalk.lib +609 -0
- sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
- sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
- sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
- sage_wheels/share/singular/LIB/mregular.lib +1863 -0
- sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
- sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
- sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
- sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
- sage_wheels/share/singular/LIB/ncall.lib +31 -0
- sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
- sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
- sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
- sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
- sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
- sage_wheels/share/singular/LIB/ncloc.lib +361 -0
- sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
- sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
- sage_wheels/share/singular/LIB/nctools.lib +1887 -0
- sage_wheels/share/singular/LIB/nets.lib +1456 -0
- sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
- sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
- sage_wheels/share/singular/LIB/noether.lib +1106 -0
- sage_wheels/share/singular/LIB/normal.lib +8700 -0
- sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
- sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
- sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
- sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
- sage_wheels/share/singular/LIB/olga.lib +1933 -0
- sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
- sage_wheels/share/singular/LIB/parallel.lib +319 -0
- sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
- sage_wheels/share/singular/LIB/perron.lib +202 -0
- sage_wheels/share/singular/LIB/pfd.lib +2223 -0
- sage_wheels/share/singular/LIB/phindex.lib +642 -0
- sage_wheels/share/singular/LIB/pointid.lib +673 -0
- sage_wheels/share/singular/LIB/polybori.lib +1430 -0
- sage_wheels/share/singular/LIB/polyclass.lib +525 -0
- sage_wheels/share/singular/LIB/polylib.lib +1174 -0
- sage_wheels/share/singular/LIB/polymake.lib +1902 -0
- sage_wheels/share/singular/LIB/presolve.lib +1533 -0
- sage_wheels/share/singular/LIB/primdec.lib +9576 -0
- sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
- sage_wheels/share/singular/LIB/primitiv.lib +401 -0
- sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
- sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
- sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
- sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
- sage_wheels/share/singular/LIB/random.lib +455 -0
- sage_wheels/share/singular/LIB/ratgb.lib +489 -0
- sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
- sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
- sage_wheels/share/singular/LIB/realrad.lib +1197 -0
- sage_wheels/share/singular/LIB/recover.lib +2628 -0
- sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
- sage_wheels/share/singular/LIB/reesclos.lib +465 -0
- sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
- sage_wheels/share/singular/LIB/resgraph.lib +789 -0
- sage_wheels/share/singular/LIB/resjung.lib +820 -0
- sage_wheels/share/singular/LIB/resolve.lib +5110 -0
- sage_wheels/share/singular/LIB/resources.lib +170 -0
- sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
- sage_wheels/share/singular/LIB/ring.lib +1328 -0
- sage_wheels/share/singular/LIB/ringgb.lib +343 -0
- sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
- sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
- sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
- sage_wheels/share/singular/LIB/rootsur.lib +886 -0
- sage_wheels/share/singular/LIB/rstandard.lib +607 -0
- sage_wheels/share/singular/LIB/rwalk.lib +336 -0
- sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
- sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
- sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
- sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
- sage_wheels/share/singular/LIB/schreyer.lib +321 -0
- sage_wheels/share/singular/LIB/schubert.lib +2551 -0
- sage_wheels/share/singular/LIB/sets.lib +524 -0
- sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
- sage_wheels/share/singular/LIB/signcond.lib +437 -0
- sage_wheels/share/singular/LIB/sing.lib +1094 -0
- sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
- sage_wheels/share/singular/LIB/solve.lib +2243 -0
- sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
- sage_wheels/share/singular/LIB/spectrum.lib +62 -0
- sage_wheels/share/singular/LIB/sresext.lib +757 -0
- sage_wheels/share/singular/LIB/ssi.lib +143 -0
- sage_wheels/share/singular/LIB/standard.lib +2769 -0
- sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
- sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
- sage_wheels/share/singular/LIB/stratify.lib +1070 -0
- sage_wheels/share/singular/LIB/surf.lib +506 -0
- sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
- sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
- sage_wheels/share/singular/LIB/surfex.lib +1462 -0
- sage_wheels/share/singular/LIB/swalk.lib +877 -0
- sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
- sage_wheels/share/singular/LIB/systhreads.lib +74 -0
- sage_wheels/share/singular/LIB/tasks.lib +1324 -0
- sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
- sage_wheels/share/singular/LIB/teachstd.lib +858 -0
- sage_wheels/share/singular/LIB/template.lib +116 -0
- sage_wheels/share/singular/LIB/toric.lib +1119 -0
- sage_wheels/share/singular/LIB/transformation.lib +116 -0
- sage_wheels/share/singular/LIB/triang.lib +1197 -0
- sage_wheels/share/singular/LIB/tropical.lib +8741 -0
- sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
- sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
- sage_wheels/share/singular/LIB/tst.lib +1108 -0
- sage_wheels/share/singular/LIB/weierstr.lib +241 -0
- sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
- sage_wheels/share/singular/emacs/.emacs-general +184 -0
- sage_wheels/share/singular/emacs/.emacs-singular +234 -0
- sage_wheels/share/singular/emacs/COPYING +44 -0
- sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
- sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
- sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
- sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
- sage_wheels/share/singular/emacs/singular.el +4273 -0
- sage_wheels/share/singular/emacs/singular.xpm +39 -0
- sage_wheels/share/singular/singular.idx +5002 -0
|
@@ -0,0 +1,2226 @@
|
|
|
1
|
+
//// Singular library normaliz.lib
|
|
2
|
+
version="version normaliz.lib 4.4.1.2 July_2025 "; // $Id: 92f0b75c305fabbb45fb0054da4108ddb8c9cb52 $
|
|
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
|
+
static proc getBigInt(string s, int p)
|
|
468
|
+
{
|
|
469
|
+
string nst;
|
|
470
|
+
int j,en,sn;
|
|
471
|
+
bigint i;
|
|
472
|
+
|
|
473
|
+
for(;p<=size(s);p++)
|
|
474
|
+
{
|
|
475
|
+
|
|
476
|
+
if(digit(s[p]))
|
|
477
|
+
{
|
|
478
|
+
sn=p; break;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
if(not(sn))
|
|
482
|
+
{
|
|
483
|
+
return(0,-1); // -1 indicates: no number found
|
|
484
|
+
}
|
|
485
|
+
p++;
|
|
486
|
+
for(;p<=size(s);p++)
|
|
487
|
+
{
|
|
488
|
+
if(!digit(s[p]))
|
|
489
|
+
{
|
|
490
|
+
en=p-1; break;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if(p>size(s))
|
|
494
|
+
{
|
|
495
|
+
en=size(s);
|
|
496
|
+
}
|
|
497
|
+
nst="i="+s[sn,en-sn+1];
|
|
498
|
+
execute(nst);
|
|
499
|
+
return(i,p);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
static proc getRational(string s, int p)
|
|
504
|
+
{
|
|
505
|
+
string nst;
|
|
506
|
+
int i,j,en,sn;
|
|
507
|
+
|
|
508
|
+
for(;p<=size(s);p++)
|
|
509
|
+
{
|
|
510
|
+
if(digit(s[p]))
|
|
511
|
+
{
|
|
512
|
+
sn=p; break;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if(not(sn))
|
|
516
|
+
{
|
|
517
|
+
return(0,-1); // -1 indicates: no number found
|
|
518
|
+
}
|
|
519
|
+
p++;
|
|
520
|
+
int slash_at;
|
|
521
|
+
for(;p<=size(s);p++)
|
|
522
|
+
{
|
|
523
|
+
if(s[p]=="/")
|
|
524
|
+
{
|
|
525
|
+
slash_at=p;
|
|
526
|
+
p++;
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
if(!digit(s[p]))
|
|
530
|
+
{
|
|
531
|
+
en=p-1; break;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if(p>size(s))
|
|
535
|
+
{
|
|
536
|
+
en=size(s);
|
|
537
|
+
}
|
|
538
|
+
if(slash_at)
|
|
539
|
+
{
|
|
540
|
+
nst="i="+s[sn,slash_at-sn];
|
|
541
|
+
execute(nst);
|
|
542
|
+
nst="j="+s[slash_at+1,en-slash_at];
|
|
543
|
+
execute(nst);
|
|
544
|
+
return(i,p,j);
|
|
545
|
+
}
|
|
546
|
+
nst="i="+s[sn,en-sn+1];
|
|
547
|
+
execute(nst);
|
|
548
|
+
return(i,p);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
static proc findWord(string s, string t, int p)
|
|
553
|
+
{
|
|
554
|
+
for(;p<=size(t)-size(s)+1;p++)
|
|
555
|
+
{
|
|
556
|
+
if(t[p]==s[1])
|
|
557
|
+
{
|
|
558
|
+
if(t[p,size(s)]==s)
|
|
559
|
+
{
|
|
560
|
+
return(p+size(s));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return(-1);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
static proc skipEqualsign(string s,int p)
|
|
569
|
+
{
|
|
570
|
+
for(;p<=size(s);p++)
|
|
571
|
+
{
|
|
572
|
+
if(s[p]=="=")
|
|
573
|
+
{
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return(p+1);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
// input and output to/from normaliz
|
|
582
|
+
|
|
583
|
+
// for backward compatibility:
|
|
584
|
+
static proc num_type_to_string(int nmz_type)
|
|
585
|
+
{
|
|
586
|
+
if (nmz_type == 20) {
|
|
587
|
+
return("grading");}
|
|
588
|
+
if (nmz_type == 0) {
|
|
589
|
+
return("integral_closure");}
|
|
590
|
+
if (nmz_type == 1) {
|
|
591
|
+
return("normalization");}
|
|
592
|
+
if (nmz_type == 2) {
|
|
593
|
+
return("polytope");}
|
|
594
|
+
if (nmz_type == 3) {
|
|
595
|
+
return("rees_algebra");}
|
|
596
|
+
if (nmz_type == 4) {
|
|
597
|
+
return("inequalities");}
|
|
598
|
+
if (nmz_type == 5) {
|
|
599
|
+
return("equations");}
|
|
600
|
+
if (nmz_type == 6) {
|
|
601
|
+
return("congruences");}
|
|
602
|
+
if (nmz_type == 10) {
|
|
603
|
+
return("lattice_ideal");}
|
|
604
|
+
if (nmz_type == -1) {
|
|
605
|
+
return("-1");}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
//list must have pairs of intmat, nmz_type
|
|
609
|
+
static proc doWriteNmzData(list #)
|
|
610
|
+
{
|
|
611
|
+
string s;
|
|
612
|
+
int i,j;
|
|
613
|
+
link outf=":w "+ getNmzFile() +".in"; // also sets the filename
|
|
614
|
+
|
|
615
|
+
intmat sgr;
|
|
616
|
+
intvec vecinput;
|
|
617
|
+
int num_rows, num_cols;
|
|
618
|
+
string nmz_type;
|
|
619
|
+
|
|
620
|
+
write(outf,"amb_space auto");
|
|
621
|
+
|
|
622
|
+
for (int k=1; k<=size(#); k=k+2) {
|
|
623
|
+
//get data from the parameter list
|
|
624
|
+
if(typeof(#[k+1]) == "int"){
|
|
625
|
+
nmz_type = num_type_to_string(#[k+1]);}
|
|
626
|
+
else{
|
|
627
|
+
nmz_type = #[k+1];}
|
|
628
|
+
|
|
629
|
+
if (nmz_type != "-1") { //skip -1 type
|
|
630
|
+
|
|
631
|
+
if(typeof(#[k]) == "int"){
|
|
632
|
+
s= nmz_type + " ";
|
|
633
|
+
s= s + string(#[k]);
|
|
634
|
+
write(outf, s);
|
|
635
|
+
}
|
|
636
|
+
if(typeof(#[k]) == "intvec"){
|
|
637
|
+
vecinput = #[k];
|
|
638
|
+
s= nmz_type;
|
|
639
|
+
write(outf, s);
|
|
640
|
+
write(outf,"[");
|
|
641
|
+
s = "";
|
|
642
|
+
for(i=1;i<= size(vecinput);i++){
|
|
643
|
+
s= s + string(vecinput[i]);
|
|
644
|
+
}
|
|
645
|
+
write(outf,s);
|
|
646
|
+
write(outf,"]");
|
|
647
|
+
}
|
|
648
|
+
if(typeof(#[k]) != "int" && typeof(#[k]) != "intvec"){
|
|
649
|
+
write(outf, nmz_type);
|
|
650
|
+
sgr = #[k];
|
|
651
|
+
num_rows = nrows(sgr);
|
|
652
|
+
num_cols = ncols(sgr);
|
|
653
|
+
|
|
654
|
+
if(nmz_type != "grading")
|
|
655
|
+
{
|
|
656
|
+
write(outf,"[");
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
for(i=1;i<=nrows(sgr);i++)
|
|
660
|
+
{
|
|
661
|
+
s="[";
|
|
662
|
+
for(j=1;j<=num_cols -1;j++)
|
|
663
|
+
{
|
|
664
|
+
s= s + string(sgr[i,j]);
|
|
665
|
+
s = s + ", ";
|
|
666
|
+
}
|
|
667
|
+
s= s + string(sgr[i,num_cols]);
|
|
668
|
+
s = s + "]";
|
|
669
|
+
write(outf,s);
|
|
670
|
+
}
|
|
671
|
+
if(nmz_type != "grading")
|
|
672
|
+
{
|
|
673
|
+
write(outf,"]");
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
close(outf);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
static proc prepareGrading(list #)
|
|
682
|
+
{
|
|
683
|
+
if (size(#)==0) {
|
|
684
|
+
return(0,-1); // type -1 specifies discard the matrix
|
|
685
|
+
}
|
|
686
|
+
if (size(#)>1) {
|
|
687
|
+
print(#);
|
|
688
|
+
ERROR("To many parameters!");
|
|
689
|
+
}
|
|
690
|
+
intmat g = intmat(#[1],1,size(#[1]));
|
|
691
|
+
return (g,"grading");
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
proc writeNmzData(list #)
|
|
696
|
+
"USAGE: writeNmzData(intmat M, string nmz_type);
|
|
697
|
+
writeNmzData(intmat M, string nmz_type, intmat M2, string nmz_type2, ...);
|
|
698
|
+
CREATE: Creates an input file for Normaliz from the matrix M. The second
|
|
699
|
+
parameter sets the type. How the matrix is interpreted depends on the
|
|
700
|
+
type. See the Normaliz documentation for more information.
|
|
701
|
+
|
|
702
|
+
It is also possible to give more than one pair of matrix and type. In
|
|
703
|
+
NOTE: Needs an explicit filename set. The filename is created from the
|
|
704
|
+
current filename.
|
|
705
|
+
@* Note that all high level functions in normaliz.lib write and read their
|
|
706
|
+
data automatically to and from the hard disk so that writeNmzData will
|
|
707
|
+
hardly ever be used explicitly.
|
|
708
|
+
SEE ALSO: readNmzData, rmNmzFiles, setNmzFilename, setNmzDataPath
|
|
709
|
+
EXAMPLE: example writeNmzData; shows an example"
|
|
710
|
+
{
|
|
711
|
+
if(nmz_filename=="")
|
|
712
|
+
{
|
|
713
|
+
ERROR("writeNmzData: no filename specified");
|
|
714
|
+
}
|
|
715
|
+
doWriteNmzData(#);
|
|
716
|
+
}
|
|
717
|
+
example
|
|
718
|
+
{ "EXAMPLE:"; echo=2;
|
|
719
|
+
setNmzFilename("VeryInteresting");
|
|
720
|
+
intmat sgr[3][3]=1,2,3,4,5,6,7,8,10;
|
|
721
|
+
writeNmzData(sgr,"cone_and_lattice");
|
|
722
|
+
int dummy=system("sh","cat VeryInteresting.in");
|
|
723
|
+
|
|
724
|
+
intmat Inequalities[2][3] = 2,-1,0, // 2x-y >= 0
|
|
725
|
+
1, 1,0; // x+y >= 0
|
|
726
|
+
intmat Equation[1][3] = 0,1,-1; // y = z
|
|
727
|
+
intmat Congruence[1][4] = 1,0,0,3; // x = 0 (3)
|
|
728
|
+
writeNmzData(Inequalities,"inequalities",Equation,"equations",Congruence,"congruences");
|
|
729
|
+
dummy=system("sh","cat VeryInteresting.in");
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
static proc readNmzSparseMatrix(string nmz_suffix)
|
|
733
|
+
{
|
|
734
|
+
string s;
|
|
735
|
+
int n_rows,n_cols; //number of rows/columns
|
|
736
|
+
int p; //position
|
|
737
|
+
int i,j;
|
|
738
|
+
|
|
739
|
+
string filename = getNmzFile() + "."+ nmz_suffix;
|
|
740
|
+
link in_f=":r "+ filename;
|
|
741
|
+
s=read(in_f);
|
|
742
|
+
close(in_f);
|
|
743
|
+
|
|
744
|
+
p=1;
|
|
745
|
+
|
|
746
|
+
(n_rows,p)=getInt(s,p);
|
|
747
|
+
n_rows = - n_rows;
|
|
748
|
+
(n_cols,p)=getInt(s,p);
|
|
749
|
+
|
|
750
|
+
intmat nmz_gen[n_rows][n_cols];
|
|
751
|
+
int nr_nonzero_entries;
|
|
752
|
+
int k;
|
|
753
|
+
for(i=1;i<=n_rows;i++)
|
|
754
|
+
{
|
|
755
|
+
(nr_nonzero_entries,p)=getInt(s,p);
|
|
756
|
+
for(j=1;j<=nr_nonzero_entries;j++)
|
|
757
|
+
{
|
|
758
|
+
(k,p)=getInt(s,p);
|
|
759
|
+
(nmz_gen[i,k],p) = getInt(s,p);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
return(nmz_gen);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
proc readNmzData(string nmz_suffix)
|
|
768
|
+
"USAGE: readNmzData(string suffix);
|
|
769
|
+
RETURN: Reads an output file of Normaliz containing an integer matrix and
|
|
770
|
+
returns it as an intmat. For example, this function is useful if one
|
|
771
|
+
wants to inspect the support hyperplanes. The filename is created
|
|
772
|
+
from the current filename and the suffix given to the function.
|
|
773
|
+
In addition to file suffixes, also sup, equ and cgr are allowed.
|
|
774
|
+
They extract the support hyperplanes, equations and congruences,
|
|
775
|
+
respectively, from the cst file.
|
|
776
|
+
NOTE: Needs an explicit filename set by setNmzFilename.
|
|
777
|
+
@* Note that all functions in normaliz.lib write and read their data
|
|
778
|
+
automatically so that readNmzData will usually not be used explicitly.
|
|
779
|
+
@* This function reads only the first matrix in a file! But see su, equ, cgr above.)
|
|
780
|
+
@* It is the responsability of the user to make sure that an output file
|
|
781
|
+
read by this function has been created for the current input file of Normaliz.
|
|
782
|
+
Files are not automatically removed before a new computation starts.
|
|
783
|
+
@* Not every output file can be read by this function.
|
|
784
|
+
SEE ALSO: writeNmzData, rmNmzFiles, setNmzFilename, setNmzDataPath
|
|
785
|
+
EXAMPLE: example readNmzData; shows an example"
|
|
786
|
+
{
|
|
787
|
+
if(nmz_filename=="")
|
|
788
|
+
{
|
|
789
|
+
ERROR("readNmzData: no filename specified");
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
if(nmz_suffix == "rep" || nmz_suffix == "grb" || nmz_suffix == "mrk"){
|
|
793
|
+
return(readNmzSparseMatrix(nmz_suffix));
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
string s;
|
|
797
|
+
int n_rows,n_cols; //number of rows/columns
|
|
798
|
+
int p; //position
|
|
799
|
+
int i,j;
|
|
800
|
+
int returnvalue;
|
|
801
|
+
|
|
802
|
+
int which_matrix = 1;
|
|
803
|
+
if(nmz_suffix == "sup"){
|
|
804
|
+
nmz_suffix = "cst";
|
|
805
|
+
}
|
|
806
|
+
if(nmz_suffix == "equ"){
|
|
807
|
+
nmz_suffix = "cst";
|
|
808
|
+
which_matrix = 2;
|
|
809
|
+
}
|
|
810
|
+
if(nmz_suffix == "cgr"){
|
|
811
|
+
nmz_suffix = "cst";
|
|
812
|
+
which_matrix = 3;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
string filename = getNmzFile() + "."+ nmz_suffix;
|
|
816
|
+
link in_f=":r "+ filename;
|
|
817
|
+
s=read(in_f);
|
|
818
|
+
close(in_f);
|
|
819
|
+
|
|
820
|
+
p=1;
|
|
821
|
+
for(int mm = 1; mm <= which_matrix; mm = mm + 1)
|
|
822
|
+
{
|
|
823
|
+
(n_rows,p)=getInt(s,p);
|
|
824
|
+
(n_cols,p)=getInt(s,p);
|
|
825
|
+
if( mm > 1){
|
|
826
|
+
kill nmz_gen;
|
|
827
|
+
}
|
|
828
|
+
intmat nmz_gen[n_rows][n_cols];
|
|
829
|
+
for(i=1;i<=n_rows;i++)
|
|
830
|
+
{
|
|
831
|
+
for(j=1;j<=n_cols;j++)
|
|
832
|
+
{
|
|
833
|
+
(nmz_gen[i,j],p) = getInt(s,p);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
return(nmz_gen);
|
|
838
|
+
}
|
|
839
|
+
example
|
|
840
|
+
{ "EXAMPLE:"; echo=2;
|
|
841
|
+
setNmzFilename("VeryInteresting");
|
|
842
|
+
intmat sgr[3][3]=1,2,3,4,5,6,7,8,9;
|
|
843
|
+
intmat sgrnormal=normaliz(sgr,"cone");
|
|
844
|
+
readNmzData("sup");
|
|
845
|
+
readNmzData("equ");
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
proc setNmzOption(string s, int onoff)
|
|
851
|
+
"USAGE: setNmzOption(string s, int onoff);
|
|
852
|
+
PURPOSE: If @code{onoff=1} the option @code{s} is activated, and
|
|
853
|
+
if @code{onoff=0} it is deactivated.
|
|
854
|
+
The predefined Normaliz options are accessible via the following names:
|
|
855
|
+
@* @code{-s: supp}
|
|
856
|
+
@* @code{-t: triang}
|
|
857
|
+
@* @code{-v: volume}
|
|
858
|
+
@* @code{-p: hvect} deprecated, replacement:
|
|
859
|
+
@* @code{-p: hvect_deg1}
|
|
860
|
+
@* @code{-q: only_hvect}
|
|
861
|
+
@* @code{--FVector: fvect}
|
|
862
|
+
@* @code{-1: height1}
|
|
863
|
+
@* @code{-G: Gorenst}
|
|
864
|
+
@* @code{-w: witness}
|
|
865
|
+
@* @code{--IsIntegrallyClosed: intclosed}
|
|
866
|
+
@* @code{-C: classgroup}
|
|
867
|
+
@* @code{-n: normal} deprecated, replacement:
|
|
868
|
+
@* @code{-n: hilbbasvol}
|
|
869
|
+
@* @code{-N: normal_l} deprecated, replacement:
|
|
870
|
+
@* @code{-N: hilbbas}
|
|
871
|
+
@* @code{-h: hilb} deprecated, replacement:
|
|
872
|
+
@* @code{-h: hilbbas_hvect}
|
|
873
|
+
@* @code{--MarkovBasis: groebner}
|
|
874
|
+
@* @code{--GroebnerBasis: markov}
|
|
875
|
+
@* @code{--Lex: lex}
|
|
876
|
+
@* @code{--RevLex: revlex}
|
|
877
|
+
@* @code{--DegLex: deglex}
|
|
878
|
+
@* @code{-d: dual}
|
|
879
|
+
@* @code{-M: genoverori}
|
|
880
|
+
@* @code{-a: allf}
|
|
881
|
+
@* @code{--typ: type}
|
|
882
|
+
@* @code{-c: control} deprecated, replacement:
|
|
883
|
+
@* @code{-c: verbose}
|
|
884
|
+
@* @code{-e: errorcheck} allowed, but ignored
|
|
885
|
+
@* @code{-B: bigint} Use GMP for arbitrary precision integers
|
|
886
|
+
@* @code{-x=N: threads} In this case the int parameter is used to set the
|
|
887
|
+
number of threads N, deafult 8, 0 means no explicit limiting.
|
|
888
|
+
|
|
889
|
+
Further Normaliz otions can be adeded to tzhe nlist by addNmzOption.
|
|
890
|
+
|
|
891
|
+
SEE ALSO: allNmzOptions,showNmzOptions, addNmzOption, resetNmzOptions
|
|
892
|
+
EXAMPLE: example setNmzOption; shows an example
|
|
893
|
+
"
|
|
894
|
+
{
|
|
895
|
+
for(int i=1;i<=size(nmz_options);i++)
|
|
896
|
+
{
|
|
897
|
+
if(s==nmz_options[i][1])
|
|
898
|
+
{
|
|
899
|
+
nmz_options[i][2]=onoff;
|
|
900
|
+
return(1);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
"Invalid option ", s;
|
|
904
|
+
return(0);
|
|
905
|
+
}
|
|
906
|
+
example
|
|
907
|
+
{ "EXAMPLE:"; echo=2;
|
|
908
|
+
setNmzOption("only_hvect",1);
|
|
909
|
+
showNmzOptions();
|
|
910
|
+
setNmzOption("only_hvect",0);
|
|
911
|
+
showNmzOptions();
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
proc resetNmzOptions()
|
|
915
|
+
"USAGE: resetNmzOptions();
|
|
916
|
+
PURPOSE: Resets the options to the dafault value.
|
|
917
|
+
SEE ALSO: showNmzOptions, setNmzOption, allNmzOptions, addNmzOption
|
|
918
|
+
EXAMPLE: example resetNmzOptions; shows an example
|
|
919
|
+
"
|
|
920
|
+
{
|
|
921
|
+
nmz_options = default_options;
|
|
922
|
+
}
|
|
923
|
+
example
|
|
924
|
+
{ "EXAMPLE:"; echo=2;
|
|
925
|
+
setNmzOption("only_hvect",1);
|
|
926
|
+
showNmzOptions();
|
|
927
|
+
resetNmzOptions();
|
|
928
|
+
showNmzOptions();
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
static proc collectNmzOptions()
|
|
932
|
+
{
|
|
933
|
+
string run_options=" -f ";
|
|
934
|
+
for(int i=1;i<=size(nmz_options);i++)
|
|
935
|
+
{
|
|
936
|
+
if(nmz_options[i][2])
|
|
937
|
+
{
|
|
938
|
+
run_options=run_options+nmz_options[i][3];
|
|
939
|
+
if (nmz_options[i][1]=="threads") {
|
|
940
|
+
run_options=run_options+string(nmz_options[i][2]);
|
|
941
|
+
}
|
|
942
|
+
run_options=run_options+" ";
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return(run_options+" ");
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
proc addNmzOption(string short_cut, string nmz_option)
|
|
949
|
+
"USAGE: addNmzOption(string short_cut, string nmz_option)
|
|
950
|
+
NOTE: This function allows the addition of Normaliz options
|
|
951
|
+
in addition to the predefined ones. Adding an option does not
|
|
952
|
+
activate it.
|
|
953
|
+
@* Note: The function prefixes a single letter option by - and
|
|
954
|
+
multiletter options by --.
|
|
955
|
+
SEE ALSO: allNmzOptions,showNmzOptions, setNmzOption, resetNmzOptions
|
|
956
|
+
EXAMPLE: example addNmzOption; shows an example
|
|
957
|
+
"
|
|
958
|
+
{
|
|
959
|
+
if(size(nmz_option) == 1){
|
|
960
|
+
nmz_option = "-" + nmz_option;
|
|
961
|
+
}
|
|
962
|
+
else{
|
|
963
|
+
nmz_option = "--" + nmz_option;
|
|
964
|
+
}
|
|
965
|
+
list new_option = list(short_cut, 0, nmz_option);
|
|
966
|
+
nmz_options = nmz_options + list(new_option);
|
|
967
|
+
}
|
|
968
|
+
example
|
|
969
|
+
{ "EXAMPLE:"; echo=2;
|
|
970
|
+
addNmzOption("FL", "FaceLattice");
|
|
971
|
+
setNmzOption("FL", 1);
|
|
972
|
+
showNmzOptions();
|
|
973
|
+
resetNmzOptions();
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
proc showNmzOptions()
|
|
977
|
+
"USAGE: showNmzOptions();
|
|
978
|
+
RETURN: Returns the string of activated options.
|
|
979
|
+
NOTE: This string is used as parameter when calling Normaliz.
|
|
980
|
+
SEE ALSO: setNmzOption
|
|
981
|
+
EXAMPLE: example showNmzOptions; shows an example
|
|
982
|
+
"
|
|
983
|
+
{
|
|
984
|
+
return(collectNmzOptions());
|
|
985
|
+
}
|
|
986
|
+
example
|
|
987
|
+
{ "EXAMPLE:"; echo=2;
|
|
988
|
+
setNmzOption("hilb",1);
|
|
989
|
+
showNmzOptions();
|
|
990
|
+
setNmzOption("hilb",0);
|
|
991
|
+
showNmzOptions();
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
static proc runNormaliz(list #)
|
|
996
|
+
{
|
|
997
|
+
if(!nmz_files_keep_switch)
|
|
998
|
+
{
|
|
999
|
+
makeTempNmzDataPath();
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
doWriteNmzData(#);
|
|
1003
|
+
|
|
1004
|
+
if(nmz_files_keep_switch)
|
|
1005
|
+
{
|
|
1006
|
+
int dummy=system("sh",setNmzExec()+ collectNmzOptions() + getNmzFile());
|
|
1007
|
+
}
|
|
1008
|
+
else
|
|
1009
|
+
{
|
|
1010
|
+
string gotodir="/tmp";
|
|
1011
|
+
string fname=getNmzFile();
|
|
1012
|
+
fname=fname[6..size(fname)];
|
|
1013
|
+
string exec="cd "+gotodir+" ; ";
|
|
1014
|
+
exec=exec+setNmzExec()+ collectNmzOptions()+" ";
|
|
1015
|
+
exec=exec+fname+" ;";
|
|
1016
|
+
int dummy=system("sh",exec);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
Num_Invs=getNuminvs();
|
|
1020
|
+
|
|
1021
|
+
int gens_computed = 0;
|
|
1022
|
+
for( int i = 1; i <= size(Num_Invs); i = i+1){
|
|
1023
|
+
if(Num_Invs[i][1] == "hilbert_basis_elements"){
|
|
1024
|
+
gens_computed = 1;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
if(!gens_computed) // return input matrix if "gen" has not been generated
|
|
1029
|
+
{
|
|
1030
|
+
if(!nmz_files_keep_switch)
|
|
1031
|
+
{
|
|
1032
|
+
eraseTempNmzDataPath();
|
|
1033
|
+
}
|
|
1034
|
+
return(#[1]);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
intmat Gen=readNmzData("gen");
|
|
1038
|
+
|
|
1039
|
+
if(!nmz_files_keep_switch)
|
|
1040
|
+
{
|
|
1041
|
+
eraseTempNmzDataPath();
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
return(Gen);
|
|
1045
|
+
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
proc normaliz(list #)
|
|
1049
|
+
"USAGE: normaliz(intmat input_mat,string nmz_type);
|
|
1050
|
+
normaliz(intmat input_mat, string nmz_type, ...);
|
|
1051
|
+
RETURN: The function applies Normaliz to the matrix input_mat ofe type nmz_type.
|
|
1052
|
+
One can add further pairs "value, type" such as vectors or numerical
|
|
1053
|
+
parameters. See Normaliz manual for possible types and values.
|
|
1054
|
+
The function returns the intmat defined by the file ith suffix gen, provided it has been computed. Otherwise it returns the input_mat.
|
|
1055
|
+
NOTE: You will find procedures for many applications of Normaliz in this
|
|
1056
|
+
library, so the explicit call of this procedure may not be necessary.
|
|
1057
|
+
|
|
1058
|
+
The function reads the numerical invariants computed by normaliz. The integers among
|
|
1059
|
+
them are converted to the Singular type int. It may to bee too small for
|
|
1060
|
+
the Hilbert function or the multiplicity, especially if computed for a non-standard grading.
|
|
1061
|
+
To prevent a disaster set the predefined global variable BigNumInvs = 1. Returnung to
|
|
1062
|
+
BigNumInvs = 0 switches this feature off.
|
|
1063
|
+
SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal,
|
|
1064
|
+
torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRings,
|
|
1065
|
+
intersectionValRingIdeals
|
|
1066
|
+
EXAMPLE: example normaliz; shows an example
|
|
1067
|
+
"
|
|
1068
|
+
{
|
|
1069
|
+
return(runNormaliz(#));
|
|
1070
|
+
}
|
|
1071
|
+
example
|
|
1072
|
+
{ "EXAMPLE:"; echo=2;
|
|
1073
|
+
ring R=0,(x,y,z),dp;
|
|
1074
|
+
intmat M[3][2]=3,1,
|
|
1075
|
+
3,2,
|
|
1076
|
+
1,3;
|
|
1077
|
+
normaliz(M,"cone");
|
|
1078
|
+
intmat Inequalities[2][3] = 2,-1,0, // 2x-y >= 0
|
|
1079
|
+
1, 1,0; // x+y >= 0
|
|
1080
|
+
intmat Equation[1][3] = 0,1,-1; // y = z
|
|
1081
|
+
intmat Congruence[1][4] = 1,0,0,3; // x = 0 (3)
|
|
1082
|
+
normaliz(Inequalities,"inequalities",Equation,"equations",Congruence,"congruences");
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
// retrieving normaliz numerical invariants
|
|
1087
|
+
|
|
1088
|
+
static proc getNuminvs()
|
|
1089
|
+
{
|
|
1090
|
+
string s;
|
|
1091
|
+
list num_invs;
|
|
1092
|
+
int p,sw,v_length,i,dummy_int;
|
|
1093
|
+
bigint DummyInt;
|
|
1094
|
+
intvec dummy_vec;
|
|
1095
|
+
string type_inv,name_inv,dummy_bool;
|
|
1096
|
+
int make_big_int;
|
|
1097
|
+
|
|
1098
|
+
link in_f=":r "+ getNmzFile() + "."+"inv";
|
|
1099
|
+
s=read(in_f);
|
|
1100
|
+
|
|
1101
|
+
p=1;
|
|
1102
|
+
while(p<size(s))
|
|
1103
|
+
{
|
|
1104
|
+
(sw,p)=nextWord(s,p);
|
|
1105
|
+
if(sw==-1)
|
|
1106
|
+
{
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
type_inv=s[sw..p-1];
|
|
1110
|
+
if(type_inv=="vector")
|
|
1111
|
+
{
|
|
1112
|
+
(v_length,p)=getInt(s,p);
|
|
1113
|
+
(sw,p)=nextWord(s,p);
|
|
1114
|
+
name_inv=s[sw..p-1];
|
|
1115
|
+
if(name_inv=="h-vector")
|
|
1116
|
+
{
|
|
1117
|
+
name_inv="h_vector";
|
|
1118
|
+
}
|
|
1119
|
+
make_big_int = 0;
|
|
1120
|
+
if(name_inv == "hilbert_series_num" || name_inv == "hilbert_series_cyclo_num"){
|
|
1121
|
+
if(BigNumInvs){
|
|
1122
|
+
make_big_int = 1;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
if(defined(DummyMat)==voice){
|
|
1126
|
+
kill(DummyMat);
|
|
1127
|
+
}
|
|
1128
|
+
bigintmat DummyMat[1][v_length];
|
|
1129
|
+
if(name_inv!="hilbert_polynomial"
|
|
1130
|
+
&& name_inv!="hilbert_quasipolynomial")
|
|
1131
|
+
{
|
|
1132
|
+
for(i=1;i<=v_length;i++)
|
|
1133
|
+
{
|
|
1134
|
+
if(i==1 && !make_big_int)
|
|
1135
|
+
{
|
|
1136
|
+
if(!make_big_int){
|
|
1137
|
+
(dummy_int,p)=getInt(s,p);
|
|
1138
|
+
dummy_vec=dummy_int;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
else
|
|
1142
|
+
{
|
|
1143
|
+
if(!make_big_int){
|
|
1144
|
+
(dummy_int,p)=getInt(s,p);
|
|
1145
|
+
dummy_vec=dummy_vec,dummy_int;
|
|
1146
|
+
}
|
|
1147
|
+
else{
|
|
1148
|
+
(DummyInt,p) = getBigInt(s,p);
|
|
1149
|
+
DummyMat[1,i] = DummyInt;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
if(!make_big_int){
|
|
1154
|
+
num_invs=num_invs+list(list(name_inv,dummy_vec,"intvec"));
|
|
1155
|
+
}
|
|
1156
|
+
else{
|
|
1157
|
+
num_invs=num_invs+list(list(name_inv,DummyMat,"bigintvec", v_length));
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
else
|
|
1161
|
+
{
|
|
1162
|
+
p=skipEqualsign(s,p);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
if(type_inv=="integer")
|
|
1166
|
+
{
|
|
1167
|
+
(sw,p)=nextWord(s,p);
|
|
1168
|
+
name_inv=s[sw..p-1];
|
|
1169
|
+
if (name_inv!="hilbert_quasipolynomial_denom") {
|
|
1170
|
+
if(!BigNumInvs || (name_inv != "multiplicity" && name_inv != "multiplicity_num" && name_inv != "multiplicity_denom")){
|
|
1171
|
+
(dummy_int,p)=getInt(s,p);
|
|
1172
|
+
num_invs=num_invs+list(list(name_inv,dummy_int,"int"));
|
|
1173
|
+
}
|
|
1174
|
+
else {
|
|
1175
|
+
(DummyInt,p)=getBigInt(s,p);
|
|
1176
|
+
num_invs=num_invs+list(list(name_inv,dummy_int,"bigint"));
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
if(type_inv=="boolean")
|
|
1181
|
+
{
|
|
1182
|
+
(sw,p)=nextWord(s,p);
|
|
1183
|
+
name_inv=s[sw..p-1];
|
|
1184
|
+
p=skipEqualsign(s,p);
|
|
1185
|
+
(sw,p)=nextWord(s,p);
|
|
1186
|
+
dummy_bool=s[sw..p-1];
|
|
1187
|
+
dummy_int=0;
|
|
1188
|
+
if(dummy_bool=="true")
|
|
1189
|
+
{
|
|
1190
|
+
dummy_int=1;
|
|
1191
|
+
}
|
|
1192
|
+
num_invs=num_invs+list(list(name_inv,dummy_int,"int"));
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
return(num_invs);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
|
|
1199
|
+
proc showNuminvs()
|
|
1200
|
+
"USAGE: showNuminvs();
|
|
1201
|
+
PURPOSE: prints the numerical invariants
|
|
1202
|
+
SEE ALSO: exportNuminvs
|
|
1203
|
+
EXAMPLE: example showNuminvs(); shows an example
|
|
1204
|
+
"
|
|
1205
|
+
{
|
|
1206
|
+
list dummy;
|
|
1207
|
+
int i;
|
|
1208
|
+
for(i=1;i<=size(Num_Invs);i++)
|
|
1209
|
+
{
|
|
1210
|
+
dummy=Num_Invs[i];
|
|
1211
|
+
dummy[1],":", dummy[2];
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
example
|
|
1215
|
+
{ "EXAMPLE:"; echo=2;
|
|
1216
|
+
ring R=0,(x,y,z,t),dp;
|
|
1217
|
+
ideal I=x3,x2y,y3;
|
|
1218
|
+
list l=intclMonIdeal(I);
|
|
1219
|
+
showNuminvs();
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
proc exportNuminvs()
|
|
1224
|
+
"USAGE: exportNuminvs();
|
|
1225
|
+
CREATE: Creates top-level variables which contain the numerical invariants.
|
|
1226
|
+
Depending on the options of normaliz different invariants are
|
|
1227
|
+
calculated. Use showNuminvs (@ref{showNuminvs}) to see which
|
|
1228
|
+
invariants are available.
|
|
1229
|
+
SEE ALSO: showNuminvs
|
|
1230
|
+
EXAMPLE: example exportNuminvs; shows an example
|
|
1231
|
+
"
|
|
1232
|
+
{
|
|
1233
|
+
list dummy;
|
|
1234
|
+
int i;
|
|
1235
|
+
string s;
|
|
1236
|
+
for(i=1;i<=size(Exported_Num_Invs);i++)
|
|
1237
|
+
{
|
|
1238
|
+
dummy=Exported_Num_Invs[i];
|
|
1239
|
+
s="kill nmz_" + dummy[1];
|
|
1240
|
+
execute(s);
|
|
1241
|
+
}
|
|
1242
|
+
for(i=1;i<=size(Num_Invs);i++)
|
|
1243
|
+
{
|
|
1244
|
+
dummy=Num_Invs[i];
|
|
1245
|
+
if(dummy[3] != "bigintvec"){
|
|
1246
|
+
s=dummy[3]+" nmz_" + dummy[1] + "=dummy[2]; exportto(Top," + "nmz_" + dummy[1] + ");";
|
|
1247
|
+
}
|
|
1248
|
+
else{
|
|
1249
|
+
s = "bigintmat " + "nmz_" + dummy[1] + "[1][";
|
|
1250
|
+
s = s + string(dummy[4]) + "]";
|
|
1251
|
+
s = s + " = dummy[2]; exportto(Top," + "nmz_" + dummy[1] + ");";
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
execute(s);
|
|
1255
|
+
}
|
|
1256
|
+
Exported_Num_Invs = Num_Invs;
|
|
1257
|
+
}
|
|
1258
|
+
example
|
|
1259
|
+
{ "EXAMPLE:"; echo=2;
|
|
1260
|
+
ring R=0,(x,y,z,t),dp;
|
|
1261
|
+
ideal I=x3,x2y,y3;
|
|
1262
|
+
list l=intclMonIdeal(I);
|
|
1263
|
+
exportNuminvs();
|
|
1264
|
+
// for example, now the following variables are set:
|
|
1265
|
+
nmz_hilbert_basis_elements;
|
|
1266
|
+
nmz_number_extreme_rays;
|
|
1267
|
+
nmz_rank;
|
|
1268
|
+
nmz_number_support_hyperplanes;
|
|
1269
|
+
if (defined(nmz_multiplicity)) {nmz_multiplicity;}
|
|
1270
|
+
else {nmz_multiplicity_num;}
|
|
1271
|
+
nmz_primary;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
// intmats to/from monomials
|
|
1276
|
+
|
|
1277
|
+
proc mons2intmat(ideal I)
|
|
1278
|
+
"USAGE: mons2intmat(ideal I);
|
|
1279
|
+
RETURN: Returns the intmat whose rows represent the leading exponents of the
|
|
1280
|
+
(non-zero) elements of I. The length of each row is nvars(basering).
|
|
1281
|
+
SEE ALSO: intmat2mons
|
|
1282
|
+
EXAMPLE: example mons2intmat; shows an example"
|
|
1283
|
+
{
|
|
1284
|
+
int i,j,k;
|
|
1285
|
+
intmat expo_vecs[size(I)][nvars(basering)];
|
|
1286
|
+
intvec expo_v;
|
|
1287
|
+
|
|
1288
|
+
k=0;
|
|
1289
|
+
for(i=1;i<=ncols(I);i++)
|
|
1290
|
+
{
|
|
1291
|
+
if(I[i]!=0)
|
|
1292
|
+
{
|
|
1293
|
+
k++;
|
|
1294
|
+
expo_v=leadexp(I[i]);
|
|
1295
|
+
for(j=1;j<=nvars(basering);j++)
|
|
1296
|
+
{
|
|
1297
|
+
expo_vecs[k,j]=expo_v[j];
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
return(expo_vecs);
|
|
1302
|
+
}
|
|
1303
|
+
example
|
|
1304
|
+
{ "EXAMPLE:"; echo=2;
|
|
1305
|
+
ring R=0,(x,y,z),dp;
|
|
1306
|
+
ideal I=x2,y2,x2yz3;
|
|
1307
|
+
mons2intmat(I);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
proc intmat2mons(intmat expo_vecs)
|
|
1311
|
+
"USAGE: intmat2mons(intmat M);
|
|
1312
|
+
RETURN: an ideal generated by the monomials which correspond to the exponent
|
|
1313
|
+
vectors given by the rows of @code{M}
|
|
1314
|
+
NOTE: The number of variables in the basering @code{nvars(basering)} has to
|
|
1315
|
+
be at least the number of columns @code{ncols(M)}, otherwise the
|
|
1316
|
+
function exits with an error.
|
|
1317
|
+
is thrown (see @ref{ERROR}).
|
|
1318
|
+
SEE ALSO: mons2intmat
|
|
1319
|
+
EXAMPLE: example intmat2mons; shows an example
|
|
1320
|
+
"
|
|
1321
|
+
{
|
|
1322
|
+
int i,j;
|
|
1323
|
+
poly m;
|
|
1324
|
+
ideal mons;
|
|
1325
|
+
|
|
1326
|
+
if(nvars(basering)<ncols(expo_vecs))
|
|
1327
|
+
{
|
|
1328
|
+
ERROR("intmat2mons: not enough variables in ring");
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
for(i=1;i<=nrows(expo_vecs);i++)
|
|
1332
|
+
{
|
|
1333
|
+
m=1;
|
|
1334
|
+
for(j=1;j<=ncols(expo_vecs);j++)
|
|
1335
|
+
{
|
|
1336
|
+
m=m*var(j)^expo_vecs[i,j];
|
|
1337
|
+
}
|
|
1338
|
+
mons=mons,m;
|
|
1339
|
+
}
|
|
1340
|
+
mons=simplify(mons,2); // get rid of starting 0
|
|
1341
|
+
return(mons);
|
|
1342
|
+
}
|
|
1343
|
+
example
|
|
1344
|
+
{ "EXAMPLE:"; echo=2;
|
|
1345
|
+
ring R=0,(x,y,z),dp;
|
|
1346
|
+
intmat expo_vecs[3][3] =
|
|
1347
|
+
2,0,0,
|
|
1348
|
+
0,2,0,
|
|
1349
|
+
2,1,3;
|
|
1350
|
+
intmat2mons(expo_vecs);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
static proc intmat2monsSel(intmat expo_vecs, int d)
|
|
1354
|
+
{
|
|
1355
|
+
int i,j;
|
|
1356
|
+
poly m;
|
|
1357
|
+
ideal mons;
|
|
1358
|
+
|
|
1359
|
+
if(nvars(basering)<ncols(expo_vecs)-1)
|
|
1360
|
+
{
|
|
1361
|
+
ERROR("intmat2monsSel: not enough variables in ring");
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
for(i=1;i<=nrows(expo_vecs);i++)
|
|
1365
|
+
{
|
|
1366
|
+
if(expo_vecs[i,ncols(expo_vecs)]==d)
|
|
1367
|
+
{
|
|
1368
|
+
m=1;
|
|
1369
|
+
for(j=1;j<=ncols(expo_vecs)-1;j++)
|
|
1370
|
+
{
|
|
1371
|
+
m=m*var(j)^expo_vecs[i,j];
|
|
1372
|
+
}
|
|
1373
|
+
mons=mons,m;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
mons=simplify(mons,2); // get rid of starting 0
|
|
1377
|
+
return(mons);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
proc binomials2intmat(ideal I)
|
|
1382
|
+
"USAGE: binomials2intmat(ideal I);
|
|
1383
|
+
RETURN: Returns the intmat whose rows represent the exponents of the
|
|
1384
|
+
(non-zero) elements of I which have to be binomials.
|
|
1385
|
+
The length of each row is nvars(basering).
|
|
1386
|
+
SEE ALSO: intmat2binomials, mons2intmat, intmat2mons
|
|
1387
|
+
EXAMPLE: example binomials2intmat; shows an example"
|
|
1388
|
+
{
|
|
1389
|
+
int i,j,k;
|
|
1390
|
+
intmat expo_vecs[size(I)][nvars(basering)];
|
|
1391
|
+
intvec expo_v;
|
|
1392
|
+
|
|
1393
|
+
k=0;
|
|
1394
|
+
poly f;
|
|
1395
|
+
|
|
1396
|
+
for(i=1; i<=ncols(I); i++)
|
|
1397
|
+
{
|
|
1398
|
+
if( I[i] != 0 )
|
|
1399
|
+
{
|
|
1400
|
+
k++;
|
|
1401
|
+
f = I[i];
|
|
1402
|
+
if (leadcoef(f) != 1) {f = -f;} //works in all characteristics
|
|
1403
|
+
if (size(f)!=2 || leadcoef(f)!=1 || leadcoef(f[2])!=-1)
|
|
1404
|
+
{
|
|
1405
|
+
ERROR(string("normalToricRing: binomial ideal expected: generator ",i,": ",I[i]));
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
expo_v = leadexp(f)-leadexp(f[2]);
|
|
1409
|
+
for(j=1;j<=nvars(basering);j++)
|
|
1410
|
+
{
|
|
1411
|
+
expo_vecs[k,j]=expo_v[j];
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
return(expo_vecs);
|
|
1416
|
+
}
|
|
1417
|
+
example
|
|
1418
|
+
{ "EXAMPLE:"; echo=2;
|
|
1419
|
+
ring S = 37,(u,v,w,x,y,z),dp;
|
|
1420
|
+
ideal I = u2v-xyz, ux2-vyz, uvw-y2z;
|
|
1421
|
+
binomials2intmat(I);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
proc intmat2binomials(intmat expo_vecs)
|
|
1425
|
+
"USAGE: intmat2binomials(intmat M);
|
|
1426
|
+
RETURN: an ideal generated by the binomials which correspond to the exponent
|
|
1427
|
+
vectors given by the rows of @code{M}
|
|
1428
|
+
NOTE: The number of variables in the basering @code{nvars(basering)} has to
|
|
1429
|
+
be at least the number of columns @code{ncols(M)}, otherwise the
|
|
1430
|
+
function exits with an error is thrown (see @ref{ERROR}).
|
|
1431
|
+
The vector with all entries zero represents 1.
|
|
1432
|
+
SEE ALSO: binomials2intmat
|
|
1433
|
+
EXAMPLE: example intmat2binomials; shows an example"
|
|
1434
|
+
{
|
|
1435
|
+
int i,j;
|
|
1436
|
+
poly f,g;
|
|
1437
|
+
ideal binoms;
|
|
1438
|
+
// expo_vecs;
|
|
1439
|
+
|
|
1440
|
+
if(nvars(basering)<ncols(expo_vecs))
|
|
1441
|
+
{
|
|
1442
|
+
ERROR("intmat2binomilals: not enough variables in ring");
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
for(i=1;i<=nrows(expo_vecs);i++)
|
|
1446
|
+
{
|
|
1447
|
+
f=1;
|
|
1448
|
+
g=1;
|
|
1449
|
+
for(j=1;j<=ncols(expo_vecs);j++)
|
|
1450
|
+
{
|
|
1451
|
+
if(expo_vecs[i,j]>0)
|
|
1452
|
+
{
|
|
1453
|
+
f=f*var(j)^expo_vecs[i,j];
|
|
1454
|
+
}
|
|
1455
|
+
if(expo_vecs[i,j]<0)
|
|
1456
|
+
{
|
|
1457
|
+
g=g*var(j)^(-expo_vecs[i,j]);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
binoms=binoms,f-g;
|
|
1461
|
+
}
|
|
1462
|
+
binoms = simplify(binoms,2); // get rid of starting 0
|
|
1463
|
+
return(binoms);
|
|
1464
|
+
}
|
|
1465
|
+
example
|
|
1466
|
+
{ "EXAMPLE:"; echo=2;
|
|
1467
|
+
ring S = 37,(u,v,w,x,y,z),dp;
|
|
1468
|
+
intmat M[2][6] = 1,0,1,-1,-2,0, -3,4,5,0,0,1;
|
|
1469
|
+
intmat2binomials(M);
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
// integral closure of rings and ideals
|
|
1473
|
+
|
|
1474
|
+
static proc runIntclToricRing(ideal I, string nmz_type, list #)
|
|
1475
|
+
{
|
|
1476
|
+
intmat expo_vecs=mons2intmat(I);
|
|
1477
|
+
return( intmat2mons( runNormaliz(expo_vecs,nmz_type, prepareGrading(#)) ) );
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
proc intclToricRing(ideal I, list #)
|
|
1481
|
+
"USAGE: intclToricRing(ideal I);
|
|
1482
|
+
intclToricRing(ideal I, intvec grading);
|
|
1483
|
+
RETURN: The toric ring S is the subalgebra of the basering generated by
|
|
1484
|
+
the leading monomials of the elements of I (considered as a list
|
|
1485
|
+
of polynomials). The function computes the integral
|
|
1486
|
+
closure T of S in the basering and returns an ideal listing
|
|
1487
|
+
the algebra generators of T over the coefficient field.
|
|
1488
|
+
@* The function returns the input ideal I if an option
|
|
1489
|
+
blocking the computation of Hilbert bases has been activated.
|
|
1490
|
+
However, in this case some numerical invariants are computed, and
|
|
1491
|
+
some other data may be contained in files that you can read into
|
|
1492
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1493
|
+
NOTE: A mathematical remark: the toric ring depends on the list of
|
|
1494
|
+
monomials given, and not only on the ideal they generate!
|
|
1495
|
+
SEE ALSO: normalToricRing, ehrhartRing, intclMonIdeal
|
|
1496
|
+
EXAMPLE: example intclToricRing; shows an example
|
|
1497
|
+
"
|
|
1498
|
+
{
|
|
1499
|
+
return(runIntclToricRing(I,"cone",#));
|
|
1500
|
+
}
|
|
1501
|
+
example
|
|
1502
|
+
{ "EXAMPLE:"; echo=2;
|
|
1503
|
+
ring R=37,(x,y,t),dp;
|
|
1504
|
+
ideal I=x3,x2y,y3;
|
|
1505
|
+
intclToricRing(I);
|
|
1506
|
+
showNuminvs();
|
|
1507
|
+
//now the same example with another grading
|
|
1508
|
+
intvec grading = 2,3,1;
|
|
1509
|
+
intclToricRing(I,grading);
|
|
1510
|
+
showNuminvs();
|
|
1511
|
+
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
proc normalToricRing(ideal I, list #)
|
|
1515
|
+
"USAGE: normalToricRing(ideal I);
|
|
1516
|
+
normalToricRing(ideal I, intvec grading);
|
|
1517
|
+
RETURN: The toric ring S is the subalgebra of the basering generated by the
|
|
1518
|
+
leading monomials of the elements of I (considered as a list of
|
|
1519
|
+
polynomials). The function computes the
|
|
1520
|
+
normalisation T of S and returns an ideal listing the algebra
|
|
1521
|
+
generators of T over the coefficient field.
|
|
1522
|
+
@* The function returns the input ideal I if one of the options
|
|
1523
|
+
blocking the computation of Hilbert bases has been activated.
|
|
1524
|
+
However, in this case some numerical invariants are computed, and
|
|
1525
|
+
some other data may be contained in files that you can read into
|
|
1526
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1527
|
+
NOTE: A mathematical remark: the toric ring depends on the list of
|
|
1528
|
+
monomials given, and not only on the ideal they generate!
|
|
1529
|
+
SEE ALSO: toricRingFromBinomials, intclToricRing, ehrhartRing, intclMonIdeal, normalToricRingFromBinomials
|
|
1530
|
+
EXAMPLE: example normalToricRing; shows an example
|
|
1531
|
+
"
|
|
1532
|
+
{
|
|
1533
|
+
return(runIntclToricRing(I,"cone_and_lattice",#));
|
|
1534
|
+
}
|
|
1535
|
+
example
|
|
1536
|
+
{ "EXAMPLE:"; echo=2;
|
|
1537
|
+
ring R = 37,(x,y,t),dp;
|
|
1538
|
+
ideal I = x3,x2y,y3;
|
|
1539
|
+
normalToricRing(I);
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
proc hilbertSeriesToricRing(ideal I, list #)
|
|
1543
|
+
"USAGE: hilbertSeriesToricRing(ideal I);
|
|
1544
|
+
hilbertSeriesToricRing(ideal I, intvec grading);
|
|
1545
|
+
RETURN: The toric ring is the subalgebra of the ring generated by the
|
|
1546
|
+
leading monomials of the elements of I (considered as a list of
|
|
1547
|
+
polynomials). The function computes the Hilbert series of the toric
|
|
1548
|
+
ring with respect to the grading. It assumes the standard grading on
|
|
1549
|
+
the ambient polynomial ring is none is given explicitly.
|
|
1550
|
+
The grading is normalized, i.e. diided by the gcd of the degrees of the
|
|
1551
|
+
generators.
|
|
1552
|
+
The return value is the pair of numerator polynomial encoded as an
|
|
1553
|
+
intvec and the denomionator, also encoded as an intvec, whose components
|
|
1554
|
+
e stand nfor the factors (1-t^e) of the denominator,
|
|
1555
|
+
NOTE: A mathematical remark: the toric ring depends on the list of
|
|
1556
|
+
monomials given, and not only on the ideal they generate!
|
|
1557
|
+
SEE ALSO: toricRingFromBinomials, normalToricRing, intclToricRing
|
|
1558
|
+
"
|
|
1559
|
+
EXAMPLE: example hilbertSeriesToricRing; shows an example
|
|
1560
|
+
{
|
|
1561
|
+
intmat U = mons2intmat(I);
|
|
1562
|
+
int swallow = setNmzOption("only_hvect",1);
|
|
1563
|
+
intmat Dummy = runNormaliz(U,"monoid", prepareGrading(#));
|
|
1564
|
+
swallow = setNmzOption("only_hvect",0);
|
|
1565
|
+
exportNuminvs();
|
|
1566
|
+
return(nmz_hilbert_series_num,nmz_hilbert_series_denom);
|
|
1567
|
+
}
|
|
1568
|
+
example
|
|
1569
|
+
{ "EXAMPLE:"; echo=2;
|
|
1570
|
+
ring R = 37,(x,y),dp;
|
|
1571
|
+
ideal I = x3, x2y,y3;
|
|
1572
|
+
intvec hilb_num, hilb_denom;
|
|
1573
|
+
(hilb_num, hilb_denom) = hilbertSeriesToricRing(I);
|
|
1574
|
+
"num", hilb_num, " denom",hilb_denom;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
proc normalToricRingFromBinomials(ideal I, list #)
|
|
1578
|
+
"USAGE: normalToricRingFromBinomials(ideal I);
|
|
1579
|
+
normalToricRingFromBinomials(ideal I, intvec grading);
|
|
1580
|
+
RETURN: @texinfo
|
|
1581
|
+
@tex
|
|
1582
|
+
The ideal $I$ is generated by binomials of type $X^a-X^b$ (multiindex notation)
|
|
1583
|
+
in the surrounding polynomial ring $K[X]=K[X_1,...,X_n]$. The binomials
|
|
1584
|
+
represent a congruence on the monoid ${Z}^n$ with residue monoid $M$.
|
|
1585
|
+
Let $N$ be the image of $M$ in gp($M$)/torsion. Then $N$ is universal in the
|
|
1586
|
+
sense that every homomorphism from $M$ to an affine monoid factors through $N$.
|
|
1587
|
+
If $I$ is a prime ideal, then $K[N]= K[X]/I$. In general, $K[N]=K[X]/P$ where
|
|
1588
|
+
$P$ is the unique minimal prime ideal of $I$ generated by binomials of type
|
|
1589
|
+
$X^a-X^b$.
|
|
1590
|
+
|
|
1591
|
+
The function computes the normalization of $K[N]$ and returns a newly created
|
|
1592
|
+
polynomial ring of the same Krull dimension, whose variables are
|
|
1593
|
+
$x(1),...,x(n-r)$, where $r$ is the rank of the matrix with rows $a-b$.
|
|
1594
|
+
(In general there is no canonical choice for such an embedding.)
|
|
1595
|
+
Inside this polynomial ring there is an ideal $I$ which lists the algebra
|
|
1596
|
+
generators of the normalization of $K[N]$.
|
|
1597
|
+
@end tex
|
|
1598
|
+
@end texinfo
|
|
1599
|
+
@* The function returns the input ideal I if an option blocking
|
|
1600
|
+
the computation of Hilbert bases has been activated.
|
|
1601
|
+
However, in this case some numerical invariants are computed, and
|
|
1602
|
+
some other data may be contained in files that you can read into
|
|
1603
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1604
|
+
SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal
|
|
1605
|
+
EXAMPLE: example normalToricRing; shows an example
|
|
1606
|
+
"
|
|
1607
|
+
{
|
|
1608
|
+
intmat expo_vecs = binomials2intmat(I);
|
|
1609
|
+
intmat result = runNormaliz(expo_vecs,"normal_toric_ideal",prepareGrading(#));
|
|
1610
|
+
|
|
1611
|
+
list baseringlist = ringlist(basering);
|
|
1612
|
+
ring S = (baseringlist[1]),(x(1..ncols(result))),dp;
|
|
1613
|
+
ideal I = intmat2mons(result);
|
|
1614
|
+
export(I);
|
|
1615
|
+
return (S);
|
|
1616
|
+
}
|
|
1617
|
+
example
|
|
1618
|
+
{ "EXAMPLE:"; echo=2;
|
|
1619
|
+
ring R = 37,(u,v,w,x,y,z),dp;
|
|
1620
|
+
ideal I = u2v-xyz, ux2-wyz, uvw-y2z;
|
|
1621
|
+
def S = normalToricRingFromBinomials(I);
|
|
1622
|
+
setring S;
|
|
1623
|
+
I;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
proc toricRingFromBinomials(ideal I, list #)
|
|
1627
|
+
"USAGE: toricRingFromBinomials(ideal I);
|
|
1628
|
+
toricRingFromBinomials(ideal I, intvec grading);
|
|
1629
|
+
RETURN: @texinfo
|
|
1630
|
+
@tex
|
|
1631
|
+
The ideal $I$ is generated by binomials of type $X^a-X^b$ (multiindex notation)
|
|
1632
|
+
in the surrounding polynomial ring $K[X]=K[X_1,...,X_n]$. The binomials
|
|
1633
|
+
represent a congruence on the monoid ${Z}^n$ with residue monoid $M$.
|
|
1634
|
+
Let $N$ be the image of $M$ in gp($M$)/torsion. Then $N$ is universal in the
|
|
1635
|
+
sense that every homomorphism from $M$ to an affine monoid factors through $N$.
|
|
1636
|
+
If $I$ is a prime ideal, then $K[N]= K[X]/I$. In general, $K[N]=K[X]/P$ where
|
|
1637
|
+
$P$ is the unique minimal prime ideal of $I$ generated by binomials of type
|
|
1638
|
+
$X^a-X^b$.
|
|
1639
|
+
|
|
1640
|
+
The function computes $K[N]$ and returns a newly created
|
|
1641
|
+
polynomial ring of the same Krull dimension, whose variables are
|
|
1642
|
+
$x(1),...,x(n-r)$, where $r$ is the rank of the matrix with rows $a-b$.
|
|
1643
|
+
(In general there is no canonical choice for such an embedding.)
|
|
1644
|
+
@end tex
|
|
1645
|
+
@end texinfo
|
|
1646
|
+
@* The function returns the input ideal I if an option blocking
|
|
1647
|
+
the computation of Hilbert bases has been activated.
|
|
1648
|
+
However, in this case some numerical invariants are computed, and
|
|
1649
|
+
some other data may be contained in files that you can read into
|
|
1650
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1651
|
+
SEE ALSO: toricRingFromBinomials, normalToricRingFromBinomials
|
|
1652
|
+
EXAMPLE: example normalToricRing; shows an example"
|
|
1653
|
+
{
|
|
1654
|
+
intmat expo_vecs = binomials2intmat(I);
|
|
1655
|
+
intmat result = runNormaliz(expo_vecs,"toric_ideal",prepareGrading(#));
|
|
1656
|
+
|
|
1657
|
+
list baseringlist = ringlist(basering);
|
|
1658
|
+
ring S = (baseringlist[1]),(x(1..ncols(result))),dp;
|
|
1659
|
+
ideal I = intmat2mons(result);
|
|
1660
|
+
export(I);
|
|
1661
|
+
return (S);
|
|
1662
|
+
}
|
|
1663
|
+
example
|
|
1664
|
+
{ "EXAMPLE:"; echo=2;
|
|
1665
|
+
ring R = 37,(u,v,w,x,y,z),dp;
|
|
1666
|
+
ideal I = u2v-xyz, ux2-wyz, uvw-y2z;
|
|
1667
|
+
def S = toricRingFromBinomials(I);
|
|
1668
|
+
setring S;
|
|
1669
|
+
I;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
proc definingBinomialIdeal(ideal I)
|
|
1673
|
+
"USAGE: definingBinomialIdeal(ideal I);
|
|
1674
|
+
RETURN: The toric ring S is the subalgebra of the basering generated by the
|
|
1675
|
+
leading monomials of the elements of I (considered as a list of
|
|
1676
|
+
polynomials). The function computes the computes the definig binomial
|
|
1677
|
+
ideal J of S with respect to the generators and returns it, together with
|
|
1678
|
+
J. DSee eample.
|
|
1679
|
+
NOTE: A mathematical remark: the toric ring depends on the list of
|
|
1680
|
+
monomials given, and not only on the ideal they generate!
|
|
1681
|
+
This function requires the previous setting of an NmzFilename.
|
|
1682
|
+
The function does not delete the written files.
|
|
1683
|
+
SEE ALSO: normalToricRingFromBinomials
|
|
1684
|
+
EXAMPLE: example definingBinomialIdeal; shows an example"
|
|
1685
|
+
{
|
|
1686
|
+
if(!nmz_files_keep_switch){
|
|
1687
|
+
ERROR("definingBinomialIdeal requires a filename");
|
|
1688
|
+
}
|
|
1689
|
+
setNmzOption("markov",1);
|
|
1690
|
+
intmat Dummy = normaliz(mons2intmat(I), "monoid");
|
|
1691
|
+
setNmzOption("markov",0);
|
|
1692
|
+
intmat bin = readNmzData("mrk");
|
|
1693
|
+
list baseringlist = ringlist(basering);
|
|
1694
|
+
ring S = (baseringlist[1]),(x(1..ncols(bin))),dp;
|
|
1695
|
+
ideal J = intmat2binomials(bin);
|
|
1696
|
+
export(J);
|
|
1697
|
+
return(S);
|
|
1698
|
+
}
|
|
1699
|
+
example
|
|
1700
|
+
{ "EXAMPLE:"; echo=2;
|
|
1701
|
+
ring R = 37,(x,y,z,w),dp;
|
|
1702
|
+
ideal I = x4,x3y,x2y2,xy3,y4;
|
|
1703
|
+
setNmzFilename("binomials");
|
|
1704
|
+
def S = definingBinomialIdeal(I);
|
|
1705
|
+
setring S;
|
|
1706
|
+
J;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
proc latticeIdeal(ideal I)
|
|
1711
|
+
"USAGE: latticeIdeal(ideal I);
|
|
1712
|
+
RETURN: Returns the lattice ideal defined by the elements of I
|
|
1713
|
+
which have to be binomials. The lattice ideal is
|
|
1714
|
+
the restriction to the polynomial ring of the ideal of
|
|
1715
|
+
the Laurent polynomial ring generated by I
|
|
1716
|
+
NOTE: This function requires the previous setting of an NmzFilename.
|
|
1717
|
+
The function does not delete the written files.
|
|
1718
|
+
SEE ALSO: intmat2binomials
|
|
1719
|
+
EXAMPLE: example latticeIdeal; shows an example
|
|
1720
|
+
"
|
|
1721
|
+
{
|
|
1722
|
+
if(!nmz_files_keep_switch){
|
|
1723
|
+
ERROR("latticeIdeal requires a filename");
|
|
1724
|
+
}
|
|
1725
|
+
intmat B = binomials2intmat(I);
|
|
1726
|
+
setNmzOption("markov",1);
|
|
1727
|
+
intmat Dummy = normaliz(B, "lattice_ideal");
|
|
1728
|
+
setNmzOption("markov",0);
|
|
1729
|
+
intmat bin = readNmzData("mrk");
|
|
1730
|
+
return(intmat2binomials(bin));
|
|
1731
|
+
}
|
|
1732
|
+
example
|
|
1733
|
+
{ "EXAMPLE:"; echo=2;
|
|
1734
|
+
setNmzFilename("binomials");
|
|
1735
|
+
ring S = 37,(u,v,w,x,y,z),dp;
|
|
1736
|
+
ideal I = u2-v2, x2-y2, y2-vw, z2-xy;
|
|
1737
|
+
latticeIdeal(I);
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
proc groebnerBasis(ideal I)
|
|
1741
|
+
"USAGE: groebnerBasis(ideal I);
|
|
1742
|
+
RETURN: Returns a Gr\"obner basis of the lattice ideal defined by the
|
|
1743
|
+
elements of I which have to be binomials. The lattice ideal is
|
|
1744
|
+
the restriction to the polynomial ring of the ideal of
|
|
1745
|
+
the Laurent polynomial ring generated by I. The default monomial
|
|
1746
|
+
order is DegRevLex where Deg is the total degree on the ambient
|
|
1747
|
+
polynomial ring. Lex and DegLex orders can be chosen via options.
|
|
1748
|
+
NOTE: This function requires the previous setting of an NmzFilename.
|
|
1749
|
+
The function does not delete the written files.
|
|
1750
|
+
SEE ALSO: latticeIdeal
|
|
1751
|
+
EXAMPLE: example groebnerBasis; shows an example"
|
|
1752
|
+
{
|
|
1753
|
+
|
|
1754
|
+
if(!nmz_files_keep_switch){
|
|
1755
|
+
ERROR("groebnerBasis requires a filename");
|
|
1756
|
+
}
|
|
1757
|
+
intmat B = binomials2intmat(I);
|
|
1758
|
+
int swallow = setNmzOption("groebner",1);
|
|
1759
|
+
intmat Dummy = normaliz(B, "lattice_ideal");
|
|
1760
|
+
swallow = setNmzOption("groebner",0);
|
|
1761
|
+
intmat bin = readNmzData("grb");
|
|
1762
|
+
return(intmat2binomials(bin));
|
|
1763
|
+
}
|
|
1764
|
+
example
|
|
1765
|
+
{ "EXAMPLE:"; echo=2;
|
|
1766
|
+
setNmzFilename("binomials");
|
|
1767
|
+
ring S = 37,(u,v,w,x,y,z),dp;
|
|
1768
|
+
ideal I = u2-v2, x2-y2, y2-vw, z2-xy;
|
|
1769
|
+
groebnerBasis(I);
|
|
1770
|
+
setNmzOption("lex",1);
|
|
1771
|
+
groebnerBasis(I);
|
|
1772
|
+
setNmzOption("lex",0);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
static proc runIntclMonIdeal(ideal I, string nmz_type, list #)
|
|
1776
|
+
{
|
|
1777
|
+
intmat expo_vecs=mons2intmat(I);
|
|
1778
|
+
int i,last_comp;
|
|
1779
|
+
|
|
1780
|
+
// we test if there is room for the Rees algebra
|
|
1781
|
+
|
|
1782
|
+
for(i=1;i<=nrows(expo_vecs);i++)
|
|
1783
|
+
{
|
|
1784
|
+
if(expo_vecs[i,ncols(expo_vecs)]!=0)
|
|
1785
|
+
{
|
|
1786
|
+
last_comp=1; break; // no
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
//adjust size of input matrix
|
|
1791
|
+
if (!last_comp) { // remove last component
|
|
1792
|
+
intmat tmp[nrows(expo_vecs)][ncols(expo_vecs)-1]
|
|
1793
|
+
= expo_vecs[1..nrows(expo_vecs),1..(ncols(expo_vecs)-1)];
|
|
1794
|
+
expo_vecs = tmp;
|
|
1795
|
+
}
|
|
1796
|
+
intmat nmz_data=runNormaliz(expo_vecs,nmz_type,prepareGrading(#));
|
|
1797
|
+
|
|
1798
|
+
if(last_comp)
|
|
1799
|
+
{
|
|
1800
|
+
ideal I1=intmat2monsSel(nmz_data,1);
|
|
1801
|
+
return(list(I1));
|
|
1802
|
+
}
|
|
1803
|
+
else
|
|
1804
|
+
{
|
|
1805
|
+
ideal I1=intmat2monsSel(nmz_data,1);
|
|
1806
|
+
ideal I2=intmat2mons(nmz_data);
|
|
1807
|
+
return(list(I1,I2));
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
proc ehrhartRing(ideal I)
|
|
1812
|
+
"USAGE: ehrhartRing(ideal I);
|
|
1813
|
+
RETURN: The exponent vectors of the leading monomials of the elements of I
|
|
1814
|
+
are considered as points of a lattice polytope P.
|
|
1815
|
+
The Ehrhart ring of a (lattice) polytope P is the monoid algebra
|
|
1816
|
+
defined by the monoid of lattice points in the cone over the
|
|
1817
|
+
polytope P; see Bruns and Gubeladze, Polytopes, Rings, and K-theory,
|
|
1818
|
+
Springer 2009, pp. 228, 229.
|
|
1819
|
+
The function returns a list of ideals:
|
|
1820
|
+
@* (i) If the last ring variable is not used by the monomials, it is
|
|
1821
|
+
treated as the auxiliary variable of the Ehrhart ring. The
|
|
1822
|
+
function returns two ideals, the first containing the monomials
|
|
1823
|
+
representing all the lattice points of the polytope, the second
|
|
1824
|
+
containing the algebra generators of the Ehrhart ring over the
|
|
1825
|
+
coefficient field.
|
|
1826
|
+
@* (ii) If the last ring variable is used by the monomials, the list
|
|
1827
|
+
returned contains only one ideal, namely the monomials
|
|
1828
|
+
representing the lattice points of the polytope.
|
|
1829
|
+
@*
|
|
1830
|
+
@* The function returns the a list containing the input ideal I if
|
|
1831
|
+
an option blocking the computation of the Hilbert basis has been activated.
|
|
1832
|
+
However, in this case some numerical invariants are computed, and
|
|
1833
|
+
some other data may be contained in files that you can read into
|
|
1834
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1835
|
+
NOTE: A mathematical remark: the Ehrhart ring depends on the list of
|
|
1836
|
+
monomials given, and not only on the ideal they generate!
|
|
1837
|
+
SEE ALSO: intclToricRing, normalToricRing, intclMonIdeal
|
|
1838
|
+
EXAMPLE: example ehrhartRing; shows an example
|
|
1839
|
+
"
|
|
1840
|
+
{
|
|
1841
|
+
return(runIntclMonIdeal(I,"polytope"));
|
|
1842
|
+
}
|
|
1843
|
+
example
|
|
1844
|
+
{ "EXAMPLE:"; echo=2;
|
|
1845
|
+
ring R=37,(x,y,t),dp;
|
|
1846
|
+
ideal J=x3,x2y,y3,xy2t7;
|
|
1847
|
+
ehrhartRing(J);
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
proc intclMonIdeal(ideal I, list #)
|
|
1851
|
+
"USAGE: intclMonIdeal(ideal I);
|
|
1852
|
+
intclMonIdeal(ideal I, intvec grading);
|
|
1853
|
+
RETURN: The exponent vectors of the leading monomials of the elements of I
|
|
1854
|
+
are considered as generators of a monomial ideal for which the
|
|
1855
|
+
normalization of its Rees algebra is computed. For a Definition of the
|
|
1856
|
+
Rees algebra (or Rees ring) see Bruns and Herzog, Cohen-Macaulay
|
|
1857
|
+
rings, Cambridge University Press 1998, p. 182.
|
|
1858
|
+
The function returns a list of ideals:
|
|
1859
|
+
@* (i) If the last ring variable is not used by the monomials, it is treated
|
|
1860
|
+
as the auxiliary variable of the Rees algebra. The function returns two
|
|
1861
|
+
ideals, the first containing the monomials generating the integral
|
|
1862
|
+
closure of the monomial ideal, the second containing the algebra
|
|
1863
|
+
generators of the normalization of the Rees algebra.
|
|
1864
|
+
@* (ii) If the last ring variable is used by the monomials, the list returned
|
|
1865
|
+
contains only one ideal, namely the monomials generating the integral
|
|
1866
|
+
closure of the ideal.
|
|
1867
|
+
@* The function returns the a list containing the input ideal I if an option
|
|
1868
|
+
blocking the computation of Hilbert bases has been activated.
|
|
1869
|
+
However, in this case some numerical invariants are computed, and
|
|
1870
|
+
some other data may be contained in files that you can read into
|
|
1871
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1872
|
+
SEE ALSO: intclToricRing, normalToricRing, ehrhartRing
|
|
1873
|
+
EXAMPLE: example intclMonIdeal; shows an example
|
|
1874
|
+
"
|
|
1875
|
+
{
|
|
1876
|
+
return(runIntclMonIdeal(I,"rees_algebra",#));
|
|
1877
|
+
}
|
|
1878
|
+
example
|
|
1879
|
+
{ "EXAMPLE:"; echo=2;
|
|
1880
|
+
ring R=0,(x,y,z,t),dp;
|
|
1881
|
+
ideal I=x^2,y^2,z^3;
|
|
1882
|
+
list l=intclMonIdeal(I);
|
|
1883
|
+
l[1]; // integral closure of I
|
|
1884
|
+
l[2]; // monomials generating the integral closure of the Rees algebra
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
// torus invariants and valuation rings and ideals
|
|
1888
|
+
|
|
1889
|
+
proc torusInvariants(intmat E, list #)
|
|
1890
|
+
"USAGE: torusInvariants(intmat A);
|
|
1891
|
+
torusInvariants(intmat A, intvec grading);
|
|
1892
|
+
RETURN: @texinfo
|
|
1893
|
+
Returns an ideal representing the list of monomials generating the ring of
|
|
1894
|
+
invariants as an algebra over the coefficient field.
|
|
1895
|
+
@tex
|
|
1896
|
+
$R^T$.
|
|
1897
|
+
@end tex
|
|
1898
|
+
@* The function returns the ideal given by the input matrix A if one of
|
|
1899
|
+
the options @code{supp}, @code{triang}, @code{volume}, or
|
|
1900
|
+
@code{hseries} has been activated.
|
|
1901
|
+
However, in this case some numerical invariants are computed, and
|
|
1902
|
+
some other data may be contained in files that you can read into
|
|
1903
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1904
|
+
@end texinfo
|
|
1905
|
+
BACKGROUND: @texinfo
|
|
1906
|
+
@tex
|
|
1907
|
+
Let $T = (K^*)^r$ be the $r$-dimensional torus acting on the polynomial ring
|
|
1908
|
+
$R = K[X_1 ,\ldots,X_n]$ diagonally. Such an action can be described as
|
|
1909
|
+
follows: there are integers $a_{i,j}$, $i=1,\ldots,r$, $j=1,\ldots,n$, such
|
|
1910
|
+
that $(\lambda_1,\ldots,\lambda_r)\in T$ acts by the substitution
|
|
1911
|
+
$$ X_j \mapsto \lambda_1^{a_{1,j}} \cdots \lambda_r^{a_{r,j}}X_j,
|
|
1912
|
+
\quad j=1,\ldots,n.$$
|
|
1913
|
+
In order to compute the ring of invariants $R^T$ one must specify the matrix
|
|
1914
|
+
$A=(a_{i,j})$.
|
|
1915
|
+
@end tex
|
|
1916
|
+
@end texinfo
|
|
1917
|
+
SEE ALSO: diagInvariants, finiteDiagInvariants, intersectionValRings,
|
|
1918
|
+
intersectionValRingIdeals
|
|
1919
|
+
EXAMPLE: example torusInvariants; shows an example
|
|
1920
|
+
"
|
|
1921
|
+
{
|
|
1922
|
+
if(nvars(basering)!=ncols(E))
|
|
1923
|
+
{
|
|
1924
|
+
ERROR("torusInvariants: wrong number of columns in matrix");
|
|
1925
|
+
}
|
|
1926
|
+
return( intmat2mons( runNormaliz(E,"equations",prepareGrading(#)) ) );
|
|
1927
|
+
}
|
|
1928
|
+
example
|
|
1929
|
+
{ "EXAMPLE:"; echo=2;
|
|
1930
|
+
ring R=0,(x,y,z,w),dp;
|
|
1931
|
+
intmat E[2][4] = -1,-1,2,0, 1,1,-2,-1;
|
|
1932
|
+
torusInvariants(E);
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
proc finiteDiagInvariants(intmat C, list #)
|
|
1936
|
+
"USAGE: finiteDiagInvariants(intmat U);
|
|
1937
|
+
finiteDiagInvariants(intmat U, intvec grading);
|
|
1938
|
+
RETURN: @texinfo
|
|
1939
|
+
@tex
|
|
1940
|
+
This function computes the ring of invariants of a finite abelian group $G$
|
|
1941
|
+
acting diagonally on the surrounding polynomial ring $K[X_1,...,X_n]$. The
|
|
1942
|
+
group is the direct product of cyclic groups generated by finitely many
|
|
1943
|
+
elements $g_1,...,g_w$. The element $g_i$ acts on the indeterminate $X_j$ by
|
|
1944
|
+
$g_i(X_j)=\lambda_i^{u_{ij}}X_j$ where $\lambda_i$ is a primitive root of
|
|
1945
|
+
unity of order equal to $ord(g_i)$. The ring of invariants is generated by all
|
|
1946
|
+
monomials satisfying the system
|
|
1947
|
+
$u_{i1}a_1+\ldots+u_{in} a_n \equiv 0$ mod ord$(g_i)$, $i=1,\ldots,w$.
|
|
1948
|
+
The input to the function is the $w\times(n+1)$ matrix $U$ with rows
|
|
1949
|
+
$u_{i1}\ldots u_{in}$ ord$(gi)$, $i=1,\ldots,w$. The output is a monomial ideal
|
|
1950
|
+
listing the algebra generators of the subalgebra of invariants
|
|
1951
|
+
{$R^G=\{f\in R : g_i f = f$ for all $i=1,\ldots,w\}$}.
|
|
1952
|
+
@end tex
|
|
1953
|
+
@end texinfo
|
|
1954
|
+
@* The function returns the ideal given by the input matrix C if one of
|
|
1955
|
+
the options @code{supp}, @code{triang}, @code{volume}, or
|
|
1956
|
+
@code{hseries} has been activated.
|
|
1957
|
+
However, in this case some numerical invariants are computed, and
|
|
1958
|
+
some other data may be contained in files that you can read into
|
|
1959
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1960
|
+
NOTE:
|
|
1961
|
+
SEE ALSO: torusInvariants, diagInvariants, intersectionValRings,
|
|
1962
|
+
intersectionValRingIdeals
|
|
1963
|
+
EXAMPLE: example finiteDiagInvariants; shows an example
|
|
1964
|
+
"
|
|
1965
|
+
{
|
|
1966
|
+
if(nvars(basering)!=ncols(C)-1)
|
|
1967
|
+
{
|
|
1968
|
+
ERROR("finiteDiagInvariants: wrong number of columns in matrix");
|
|
1969
|
+
}
|
|
1970
|
+
return( intmat2mons( runNormaliz(C,"congruences",prepareGrading(#)) ) );
|
|
1971
|
+
}
|
|
1972
|
+
example
|
|
1973
|
+
{ "EXAMPLE:"; echo=2;
|
|
1974
|
+
ring R = 0,(x,y,z,w),dp;
|
|
1975
|
+
intmat C[2][5] = 1,1,1,1,5, 1,0,2,0,7;
|
|
1976
|
+
finiteDiagInvariants(C);
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
proc diagInvariants(intmat E, intmat C, list #)
|
|
1980
|
+
"USAGE: diagInvariants(intmat A, intmat U);
|
|
1981
|
+
diagInvariants(intmat A, intmat U, intvec grading);
|
|
1982
|
+
RETURN: @texinfo
|
|
1983
|
+
@tex
|
|
1984
|
+
This function computes the ring of invariants of a diagonalizable group
|
|
1985
|
+
$D = T\times G$ where $T$ is a torus and $G$ is a finite abelian group, both
|
|
1986
|
+
acting diagonally on the polynomial ring $K[X_1,\ldots,X_n]$. The group
|
|
1987
|
+
actions are specified by the input matrices A and U. The first matrix specifies
|
|
1988
|
+
the torus action, the second the action of the finite group. See
|
|
1989
|
+
torusInvariants and finiteDiagInvariants for more detail. The output is a
|
|
1990
|
+
monomial ideal listing the algebra generators of the subalgebra of invariants.
|
|
1991
|
+
@end tex
|
|
1992
|
+
@end texinfo
|
|
1993
|
+
@* The function returns the ideal given by the input matrix A if one of
|
|
1994
|
+
the options @code{supp}, @code{triang}, @code{volume}, or
|
|
1995
|
+
@code{hseries} has been activated.
|
|
1996
|
+
However, in this case some numerical invariants are computed, and
|
|
1997
|
+
some other data may be contained in files that you can read into
|
|
1998
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
1999
|
+
SEE ALSO: torusInvariants, finiteDiagInvariants, intersectionValRings, intersectionValRingIdeals
|
|
2000
|
+
EXAMPLE: example diagInvariants; shows an example
|
|
2001
|
+
"
|
|
2002
|
+
{
|
|
2003
|
+
if(nvars(basering)!=ncols(E) || nvars(basering)!=ncols(C)-1)
|
|
2004
|
+
{
|
|
2005
|
+
ERROR("diagInvariants: wrong number of columns in matrix");
|
|
2006
|
+
}
|
|
2007
|
+
return( intmat2mons( runNormaliz(E,"equations",C,"congruences",prepareGrading(#)) ) );
|
|
2008
|
+
}
|
|
2009
|
+
example
|
|
2010
|
+
{ "EXAMPLE:"; echo=2;
|
|
2011
|
+
ring R=0,(x,y,z,w),dp;
|
|
2012
|
+
intmat E[2][4] = -1,-1,2,0, 1,1,-2,-1;
|
|
2013
|
+
intmat C[2][5] = 1,1,1,1,5, 1,0,2,0,7;
|
|
2014
|
+
diagInvariants(E,C);
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
proc intersectionValRings(intmat V, list #)
|
|
2018
|
+
"USAGE: intersectionValRings(intmat V, intvec grading);
|
|
2019
|
+
RETURN: The function returns a monomial ideal, to be considered as the list
|
|
2020
|
+
of monomials generating @math{S} as an algebra over the coefficient
|
|
2021
|
+
field.
|
|
2022
|
+
BACKGROUND: @texinfo
|
|
2023
|
+
@tex
|
|
2024
|
+
A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by
|
|
2025
|
+
the values $v(X_j)$ of the indeterminates. This function computes the
|
|
2026
|
+
subalgebra $S = \{ f \in R : v_i ( f ) \geq 0,\ i = 1,\ldots,r\}$ for several
|
|
2027
|
+
such valuations $v_i$, $i=1,\ldots,r$. It needs the matrix $V = (v_i(X_j))$ as
|
|
2028
|
+
its input.
|
|
2029
|
+
@end tex
|
|
2030
|
+
@end texinfo
|
|
2031
|
+
@* The function returns the ideal given by the input matrix V if one of
|
|
2032
|
+
the options @code{supp}, @code{triang}, @code{volume}, or
|
|
2033
|
+
@code{hseries} has been activated.
|
|
2034
|
+
However, in this case some numerical invariants are computed, and
|
|
2035
|
+
some other data may be contained in files that you can read into
|
|
2036
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
2037
|
+
SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRingIdeals
|
|
2038
|
+
EXAMPLE: example intersectionValRings; shows an example
|
|
2039
|
+
"
|
|
2040
|
+
{
|
|
2041
|
+
|
|
2042
|
+
if(nvars(basering)!=ncols(V))
|
|
2043
|
+
{
|
|
2044
|
+
ERROR("intersectionValRings: wrong number of columns in matrix");
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
intmat V1[nrows(V)+ncols(V)][ncols(V)];
|
|
2048
|
+
int i,j;
|
|
2049
|
+
|
|
2050
|
+
for(i=1;i<=ncols(V);i++)
|
|
2051
|
+
{
|
|
2052
|
+
V1[i,i]=1;
|
|
2053
|
+
}
|
|
2054
|
+
for(i=1;i<=nrows(V);i++)
|
|
2055
|
+
{
|
|
2056
|
+
for(j=1;j<=ncols(V);j++)
|
|
2057
|
+
{
|
|
2058
|
+
V1[i+ncols(V),j]=V[i,j];
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
/* if(!GenGen) // return V
|
|
2063
|
+
{
|
|
2064
|
+
runNormaliz(V1,4,prepareGrading(#));
|
|
2065
|
+
return(V);
|
|
2066
|
+
}
|
|
2067
|
+
*/
|
|
2068
|
+
return(intmat2mons(runNormaliz(V1,"inequalities",prepareGrading(#))));
|
|
2069
|
+
}
|
|
2070
|
+
example
|
|
2071
|
+
{ "EXAMPLE:"; echo=2;
|
|
2072
|
+
ring R=0,(x,y,z,w),dp;
|
|
2073
|
+
intmat V0[2][4]=0,1,2,3, -1,1,2,1;
|
|
2074
|
+
intersectionValRings(V0);
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
proc intersectionValRingIdeals(intmat V, list #)
|
|
2078
|
+
"USAGE: intersectionValRingIdeals(intmat V);
|
|
2079
|
+
intersectionValRingIdeals(intmat V, intvec grading);
|
|
2080
|
+
RETURN: The function returns two ideals, both to be considered as lists of
|
|
2081
|
+
monomials. The
|
|
2082
|
+
first is the system of monomial generators of @math{S}, the second
|
|
2083
|
+
the system of generators of @math{M}.
|
|
2084
|
+
@* The function returns a list consisting of the ideal given by the
|
|
2085
|
+
blocking the computation of Hilbert bases has been activated.
|
|
2086
|
+
However, in this case some numerical invariants are computed, and
|
|
2087
|
+
some other data may be contained in files that you can read into
|
|
2088
|
+
Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
|
|
2089
|
+
BACKGROUND: @texinfo
|
|
2090
|
+
@tex
|
|
2091
|
+
A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by
|
|
2092
|
+
the values $v(X_j)$ of the indeterminates. This function computes the
|
|
2093
|
+
subalgebra $S = \{ f \in R : v_i ( f ) \geq 0,\ i = 1,\ldots,r\}$ for several
|
|
2094
|
+
such valuations $v_i$, $i=1,\ldots,r$. It needs the matrix $V = (v_i(X_j))$ as
|
|
2095
|
+
its input.
|
|
2096
|
+
|
|
2097
|
+
This function simultaneously determines the $S$-submodule
|
|
2098
|
+
$M = \{ f \in R : v_i(f) \geq w_i ,\ i = 1,\ldots,r\}$ for integers
|
|
2099
|
+
$w_1,\ldots\,w_r$. (If $w_i \geq 0$ for all $i$, $M$ is an ideal of $S$.)
|
|
2100
|
+
The numbers $w_i$ form the $(n+1)$th column of the input matrix.
|
|
2101
|
+
@end tex
|
|
2102
|
+
@end texinfo
|
|
2103
|
+
NOTE: The function also gives an error message if the matrix V has the
|
|
2104
|
+
wrong number of columns.
|
|
2105
|
+
SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRings
|
|
2106
|
+
EXAMPLE: example intersectionValRingIdeals; shows an example
|
|
2107
|
+
"
|
|
2108
|
+
{
|
|
2109
|
+
if(nvars(basering)!=ncols(V)-1)
|
|
2110
|
+
{
|
|
2111
|
+
ERROR("intersectionValRingIdeals: wrong number of columns in matrix");
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
intmat V1[nrows(V)+ncols(V)][ncols(V)];
|
|
2115
|
+
int i,j;
|
|
2116
|
+
|
|
2117
|
+
for(i=1;i<=ncols(V);i++)
|
|
2118
|
+
{
|
|
2119
|
+
V1[i,i]=1;
|
|
2120
|
+
}
|
|
2121
|
+
for(i=1;i<=nrows(V);i++)
|
|
2122
|
+
{
|
|
2123
|
+
for(j=1;j<=ncols(V);j++)
|
|
2124
|
+
{
|
|
2125
|
+
V1[i+ncols(V),j]=V[i,j];
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
for(i=1;i<=nrows(V);i++)
|
|
2129
|
+
{
|
|
2130
|
+
V1[i+ncols(V),ncols(V)]=-V1[i+ncols(V),ncols(V)];
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
intmat nmz_data=runNormaliz(V1,"inequalities",prepareGrading(#));
|
|
2134
|
+
ideal I1=intmat2monsSel(nmz_data,0);
|
|
2135
|
+
ideal I2=intmat2monsSel(nmz_data,1);
|
|
2136
|
+
return(list(I1,I2));
|
|
2137
|
+
}
|
|
2138
|
+
example
|
|
2139
|
+
{ "EXAMPLE:"; echo=2;
|
|
2140
|
+
ring R=0,(x,y,z,w),dp;
|
|
2141
|
+
intmat V[2][5]=0,1,2,3,4, -1,1,2,1,3;
|
|
2142
|
+
intersectionValRingIdeals(V);
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
proc allNmzOptions()
|
|
2146
|
+
"USAGE: proc alNmzOptions();
|
|
2147
|
+
PURPOSE: The function prints a list of the Normaliz options that
|
|
2148
|
+
are available in this library: the string naming the option,
|
|
2149
|
+
the default value, and the option sent to Normaliz.
|
|
2150
|
+
SEE ALSO: setNmzOption, showNmzOptions
|
|
2151
|
+
EXAMPLE: example allNmzOptions; shows an example
|
|
2152
|
+
"
|
|
2153
|
+
{
|
|
2154
|
+
for(int i=1;i<=size(nmz_options);i++){
|
|
2155
|
+
if(size(nmz_options[i]) == 3){
|
|
2156
|
+
nmz_options[i][1], nmz_options[i][2], nmz_options[i][3];
|
|
2157
|
+
}
|
|
2158
|
+
else{
|
|
2159
|
+
nmz_options[i][1], nmz_options[i][2], nmz_options[i][3], nmz_options[i][4] ;
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
" ";
|
|
2163
|
+
}
|
|
2164
|
+
example
|
|
2165
|
+
{ "EXAMPLE:"; echo=2;
|
|
2166
|
+
allNmzOptions();
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
static proc mod_init()
|
|
2170
|
+
{
|
|
2171
|
+
string nmz_exec_path; export nmz_exec_path;
|
|
2172
|
+
string nmz_filename; export nmz_filename;
|
|
2173
|
+
int nmz_files_keep_switch;export nmz_files_keep_switch;
|
|
2174
|
+
string nmz_data_path; export nmz_data_path;
|
|
2175
|
+
// int GenGen=1; export GenGen; // indicates whether "gen" is generated // no longer used
|
|
2176
|
+
list Num_Invs; export Num_Invs;
|
|
2177
|
+
list Exported_Num_Invs; export Exported_Num_Invs;
|
|
2178
|
+
|
|
2179
|
+
// options for running normaliz
|
|
2180
|
+
//
|
|
2181
|
+
// component 1 is name of option
|
|
2182
|
+
// 2 is default value
|
|
2183
|
+
// 3 is command line option to be passed to Normaliz
|
|
2184
|
+
// 4 is a potential comment pointing to better use
|
|
2185
|
+
|
|
2186
|
+
list nmz_options=
|
|
2187
|
+
list("supp",0,"-s"),
|
|
2188
|
+
list("triang",0,"-T"),
|
|
2189
|
+
list("volume",0,"-v"),
|
|
2190
|
+
list("hvect",0,"-p"," -- name deprecated, use hvect_deg1"),
|
|
2191
|
+
list("hvect_deg1",0, "-p"),
|
|
2192
|
+
list("only_hvect",0,"-q"),
|
|
2193
|
+
list("fvect",0,"--FVector"),
|
|
2194
|
+
list("height1",0,"-1"),
|
|
2195
|
+
list("Gorenst",0,"-G"),
|
|
2196
|
+
list("intclosed",0,"--IsIntegrallyClosed"),
|
|
2197
|
+
list("witness",0,"--w"),
|
|
2198
|
+
list("classgroup",0,"-C"),
|
|
2199
|
+
list("normal",0,"-n"," -- name deprecated, use hilbbasvol"),
|
|
2200
|
+
list("hilbbasvol",0,"-n"),
|
|
2201
|
+
list("normal_l",0,"-N"," -- name deprecated, use hilbbas"),
|
|
2202
|
+
list("hilbbas",0,"-N"),
|
|
2203
|
+
list("hilb",0,"-h"," -- name deprecated, use hilbbas_hvect"),
|
|
2204
|
+
list("hilbbas_hvect",0,"-h"),
|
|
2205
|
+
list("dual",0,"-d"),
|
|
2206
|
+
list("markov", 0, "--MarkovBasis --BinomialsPacked"),
|
|
2207
|
+
list("groebner", 0, "--GroebnerBasis --BinomialsPacked"),
|
|
2208
|
+
list("lex", 0, "--Lex"),
|
|
2209
|
+
list("revlex", 0, "--RevLex"),
|
|
2210
|
+
list("lex", 0, "--Lex"),
|
|
2211
|
+
list("deglex", 0, "--DegLex"),
|
|
2212
|
+
list("genoverori",0,"-M --mod"),
|
|
2213
|
+
list("type",0,"--typ"),
|
|
2214
|
+
list("control",0,"-c"," -- name deprecated, use verbose"),
|
|
2215
|
+
list("verbose",0,"-c"),
|
|
2216
|
+
list("allf",0,"-a"),
|
|
2217
|
+
list("bigint",0,"-B"),
|
|
2218
|
+
list("threads",8,"-x="),
|
|
2219
|
+
list("errorcheck",0,"-e", " -- allowed, but ignored by Normaliz");
|
|
2220
|
+
export nmz_options;
|
|
2221
|
+
list default_options = nmz_options;
|
|
2222
|
+
export default_options;
|
|
2223
|
+
|
|
2224
|
+
int BigNumInvs = 0;
|
|
2225
|
+
exportto(Top, BigNumInvs);
|
|
2226
|
+
}
|