passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-singular might be problematic. Click here for more details.
- PySingular.cpython-314-x86_64-linux-gnu.so +0 -0
- passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
- passagemath_singular-10.6.31rc3.dist-info/RECORD +491 -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-20aec911.4.1.so +0 -0
- passagemath_singular.libs/libcddgmp-21acf0c6.so.0.1.3 +0 -0
- passagemath_singular.libs/libfactory-4-fcee31da.4.1.so +0 -0
- passagemath_singular.libs/libflint-66e12231.so.21.0.0 +0 -0
- passagemath_singular.libs/libgf2x-a4cdec90.so.3.0.0 +0 -0
- passagemath_singular.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
- passagemath_singular.libs/libgmp-6e109695.so.10.5.0 +0 -0
- passagemath_singular.libs/libgsl-cda90e79.so.28.0.0 +0 -0
- passagemath_singular.libs/libmpfr-82690d50.so.6.2.1 +0 -0
- passagemath_singular.libs/libntl-e6f0d543.so.44.0.1 +0 -0
- passagemath_singular.libs/libomalloc-0-5c9e866e.9.6.so +0 -0
- passagemath_singular.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
- passagemath_singular.libs/libpolys-4-5c0a87e0.4.1.so +0 -0
- passagemath_singular.libs/libquadmath-2284e583.so.0.0.0 +0 -0
- passagemath_singular.libs/libreadline-ea270e21.so.8.2 +0 -0
- passagemath_singular.libs/libsingular_resources-4-a1aafc6d.4.1.so +0 -0
- passagemath_singular.libs/libtinfo-ceb117d9.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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-linux-gnu.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
- sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-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-x86_64-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-x86_64-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-x86_64-linux-gnu.so +0 -0
- sage/libs/singular/option.pyx +671 -0
- sage/libs/singular/polynomial.cpython-314-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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-x86_64-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,1768 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
version="version gfan.lib 4.4.0.3 Jun_2024 "; // $Id: b9518fbab08f329704eba8b5596a93044bf24d9c $
|
|
3
|
+
category = "Convex Geometry";
|
|
4
|
+
info="
|
|
5
|
+
LIBRARY: gfan.lib Interface to gfan and gfanlib for computations in convex geometry
|
|
6
|
+
AUTHORS: Anders N. Jensen, email: jensen@imf.au.dk
|
|
7
|
+
Yue Ren, email: ren@mathematik.uni-kl.de
|
|
8
|
+
Frank Seelisch
|
|
9
|
+
|
|
10
|
+
PROCEDURES:
|
|
11
|
+
fullSpace(n); cone, the ambient space of dimension n
|
|
12
|
+
origin(n); cone, the origin in an ambient space of dimension n
|
|
13
|
+
positiveOrthant(n); cone, the positive orthant of dimension n
|
|
14
|
+
ambientDimension(c); the dimension of the ambient space the input lives in
|
|
15
|
+
canonicalizeCone(c); a unique representation of the cone c
|
|
16
|
+
codimension(c); the codimension of the input
|
|
17
|
+
coneViaPoints(M); define a cone
|
|
18
|
+
coneViaInequalities(M); define a cone
|
|
19
|
+
coneLink(c,w); the link of c around w
|
|
20
|
+
containsAsFace(c,d); is d a face of c
|
|
21
|
+
containsInSupport(c,d); is d contained in c
|
|
22
|
+
containsPositiveVector(c); contains a vector with only positive entries?
|
|
23
|
+
containsRelatively(c,p); p in c?
|
|
24
|
+
convexHull(c1,c2); convex hull
|
|
25
|
+
convexIntersection(c1,c2); convex hull
|
|
26
|
+
dimension(c); dimension of c
|
|
27
|
+
dualCone(c); the dual of c
|
|
28
|
+
equations(c); defining equations of c
|
|
29
|
+
faceContaining(c,w); the face of c containing w in its relative interior
|
|
30
|
+
facets(c); the facets of c
|
|
31
|
+
generatorsOfLinealitySpace(c); generators of the lineality space of c
|
|
32
|
+
generatorsOfSpan(c); generators of the span of c
|
|
33
|
+
getLinearForms(c); linear forms previously stored in c
|
|
34
|
+
getMultiplicity(c); multiplicity previously stored in c
|
|
35
|
+
inequalities(c); inequalities of c
|
|
36
|
+
isFullSpace(c); is the entire ambient space?
|
|
37
|
+
isOrigin(c); is the origin?
|
|
38
|
+
isSimplicial(c); is simplicial?
|
|
39
|
+
linealityDimension(c); the dimension of the lineality space of c
|
|
40
|
+
linealitySpace(c); the lineality space of c
|
|
41
|
+
negatedCone(c); the negative of c
|
|
42
|
+
polytopeViaInequalities(M); define a polytope
|
|
43
|
+
polytopeViaPoints(M); define a polytope
|
|
44
|
+
quotientLatticeBasis(c); basis of Z^n intersected with the span of c modulo Z^n intersected with the lineality space of c
|
|
45
|
+
randomPoint(c); a random point in the relative interior of c
|
|
46
|
+
rays(c); generators of the rays of c
|
|
47
|
+
relativeInteriorPoint(c); point in the relative interior of c
|
|
48
|
+
semigroupGenerator(c); generator of Z^n intersected with c modulo Z^n intersected with the lineality space of c
|
|
49
|
+
setLinearForms(c); stores linear forms in c
|
|
50
|
+
setMultiplicity(c); stores a multiplicity in c
|
|
51
|
+
span(c); unique irredundant equations of c
|
|
52
|
+
uniquePoint(c); a unique point in c stable under reflections at coordinate hyperplanes
|
|
53
|
+
containsInCollection(f,c); f contains c?
|
|
54
|
+
emptyFan(n); empty fan in ambient dimension n
|
|
55
|
+
fanViaCones(L); fan generated by the cones in L
|
|
56
|
+
fullFan(n); full fan in ambient dimension n
|
|
57
|
+
fVector(f); the f-Vector of f
|
|
58
|
+
getCone(f,d,i[,m]); the i-th cone of dimension d in f
|
|
59
|
+
insertCone(f,c[,b]); inserts the cone c into f
|
|
60
|
+
isCompatible(f,c); f and c live in the same ambient space
|
|
61
|
+
isPure(f); all maximal cones of f are of the same dimension
|
|
62
|
+
nmaxcones(f); number of maximal cones in f
|
|
63
|
+
ncones(f); number of cones in f
|
|
64
|
+
numberOfConesOfDimension(f,d[,m]); the number of cones in dimension d
|
|
65
|
+
removeCone(f,c[,b]); removes the cone c
|
|
66
|
+
dualPolytope(p); the dual of p
|
|
67
|
+
newtonPolytope(f); convex hull of all exponent vectors of f
|
|
68
|
+
vertices(p); vertices of p
|
|
69
|
+
onesVector(n); intvec of length n with all entries 1
|
|
70
|
+
";
|
|
71
|
+
|
|
72
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
73
|
+
|
|
74
|
+
/////
|
|
75
|
+
// non gfanlib.so functions
|
|
76
|
+
/////
|
|
77
|
+
|
|
78
|
+
proc fullSpace(int n)
|
|
79
|
+
"USAGE: fullSpace(n); n int
|
|
80
|
+
RETURN: cone, the ambient space of dimension n
|
|
81
|
+
EXAMPLE: example positiveOrthant; shows an example
|
|
82
|
+
"
|
|
83
|
+
{
|
|
84
|
+
cone c = n;
|
|
85
|
+
return (c);
|
|
86
|
+
}
|
|
87
|
+
example
|
|
88
|
+
{
|
|
89
|
+
"EXAMPLE:"; echo = 2;
|
|
90
|
+
cone c = fullSpace(2);
|
|
91
|
+
generatorsOfLinealitySpace(c);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
proc origin(int n)
|
|
95
|
+
"USAGE: origin(n); n int
|
|
96
|
+
RETURN: cone, the origin in an ambient space of dimension n
|
|
97
|
+
EXAMPLE: example origin; shows an example
|
|
98
|
+
"
|
|
99
|
+
{
|
|
100
|
+
bigintmat ineq[0][n];
|
|
101
|
+
bigintmat eq[n][n];
|
|
102
|
+
for (int i=1; i<=n; i++)
|
|
103
|
+
{
|
|
104
|
+
eq[i,i]=1;
|
|
105
|
+
}
|
|
106
|
+
cone o = coneViaInequalities(ineq,eq);
|
|
107
|
+
return (o);
|
|
108
|
+
}
|
|
109
|
+
example
|
|
110
|
+
{
|
|
111
|
+
"EXAMPLE:"; echo = 2;
|
|
112
|
+
cone c = origin(2);
|
|
113
|
+
equations(c);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
proc positiveOrthant(int n)
|
|
117
|
+
"USAGE: positiveOrthant(n); n int
|
|
118
|
+
RETURN: cone, the positive orthant of dimension n
|
|
119
|
+
EXAMPLE: example positiveOrthant; shows an example
|
|
120
|
+
"
|
|
121
|
+
{
|
|
122
|
+
bigintmat ineq[n][n];
|
|
123
|
+
for (int i=1; i<=n; i++)
|
|
124
|
+
{
|
|
125
|
+
ineq[i,i]=1;
|
|
126
|
+
}
|
|
127
|
+
cone posOrthant = coneViaInequalities(ineq);
|
|
128
|
+
return (posOrthant);
|
|
129
|
+
}
|
|
130
|
+
example
|
|
131
|
+
{
|
|
132
|
+
"EXAMPLE:"; echo = 2;
|
|
133
|
+
cone c = positiveOrthant(2);
|
|
134
|
+
rays(c);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/////
|
|
138
|
+
// gfan interface functions
|
|
139
|
+
/////
|
|
140
|
+
|
|
141
|
+
static proc intmatToGfanVectorConfiguration(intmat P)
|
|
142
|
+
{
|
|
143
|
+
string gfanVectorConfiguration = "{";
|
|
144
|
+
int c = ncols(P);
|
|
145
|
+
for (int i=1; i<=nrows(P); i++)
|
|
146
|
+
{
|
|
147
|
+
gfanVectorConfiguration = gfanVectorConfiguration
|
|
148
|
+
+"("+string(intvec(P[i,1..c]))+"),";
|
|
149
|
+
}
|
|
150
|
+
int k = size(gfanVectorConfiguration);
|
|
151
|
+
gfanVectorConfiguration = gfanVectorConfiguration[1..k-1];
|
|
152
|
+
gfanVectorConfiguration = gfanVectorConfiguration+"}";
|
|
153
|
+
return (gfanVectorConfiguration);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
proc secondaryFan(intmat P, def #)
|
|
157
|
+
"USAGE: secondaryFan(P); P intmat
|
|
158
|
+
secondaryFan(P,s); P intmat, s string
|
|
159
|
+
RETURN: fan, the secondary fan of the vector configuration P
|
|
160
|
+
NOTE: s is a option string that is passed to gfan, possible options are
|
|
161
|
+
`--log1` to `--log3` for output during the computation
|
|
162
|
+
EXAMPLE: example secondaryFan; shows an examplex
|
|
163
|
+
"
|
|
164
|
+
{
|
|
165
|
+
string filename = "/tmp/gfanlib_secondaryFan_"+string(random(1,2147483647));
|
|
166
|
+
string filenameIn = filename+".in.gfan";
|
|
167
|
+
string filenameOut = filename+".out.gfan";
|
|
168
|
+
|
|
169
|
+
string filestring = intmatToGfanVectorConfiguration(P);
|
|
170
|
+
filestring;
|
|
171
|
+
write(":w "+filenameIn,filestring);
|
|
172
|
+
int dummy = system("sh","gfan_secondaryfan "+string(#)+" < "+filenameIn+" > "+filenameOut);
|
|
173
|
+
string fanString = read(filenameOut);
|
|
174
|
+
|
|
175
|
+
dummy = system("sh","rm "+filenameIn+" "+filenameOut);
|
|
176
|
+
return (fanFromString(fanString));
|
|
177
|
+
}
|
|
178
|
+
example
|
|
179
|
+
{
|
|
180
|
+
"EXAMPLE:"; echo = 2;
|
|
181
|
+
intmat P[4][3] =
|
|
182
|
+
1,0,0,
|
|
183
|
+
1,1,0,
|
|
184
|
+
1,0,1,
|
|
185
|
+
1,1,1;
|
|
186
|
+
fan F = secondaryFan(P);
|
|
187
|
+
F;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/////
|
|
191
|
+
// cone related functions
|
|
192
|
+
/////
|
|
193
|
+
|
|
194
|
+
proc ambientDimension(def coneOrFanOrPolytope)
|
|
195
|
+
"USAGE: ambientDimension(c); c cone
|
|
196
|
+
ambientDimension(f); f fan
|
|
197
|
+
ambientDimension(p); p polytope
|
|
198
|
+
RETURN: int, the dimension of the ambient space the input lives in
|
|
199
|
+
EXAMPLE: example ambientDimension; shows an example
|
|
200
|
+
"
|
|
201
|
+
{
|
|
202
|
+
return (ambientDimensionInternal(coneOrFanOrPolytope));
|
|
203
|
+
}
|
|
204
|
+
example
|
|
205
|
+
{
|
|
206
|
+
"EXAMPLE:"; echo = 2;
|
|
207
|
+
intmat M1[2][2]=
|
|
208
|
+
1,0,
|
|
209
|
+
0,1;
|
|
210
|
+
cone c1=coneViaPoints(M1);
|
|
211
|
+
ambientDimension(c1);
|
|
212
|
+
intmat M2[2][3]=
|
|
213
|
+
1,0,0,
|
|
214
|
+
0,1,0;
|
|
215
|
+
cone c2=coneViaPoints(M2);
|
|
216
|
+
ambientDimension(c2);
|
|
217
|
+
|
|
218
|
+
fan f = emptyFan(3);
|
|
219
|
+
ambientDimension(f);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
proc canonicalizeCone(cone c)
|
|
223
|
+
"USAGE: canonicalizeCone(c); c cone
|
|
224
|
+
RETURN: cone, a unique representation of the cone c
|
|
225
|
+
EXAMPLE: example canonicalizeCone; shows an example
|
|
226
|
+
"
|
|
227
|
+
{
|
|
228
|
+
return (canonicalizeConeInternal(c));
|
|
229
|
+
}
|
|
230
|
+
example
|
|
231
|
+
{
|
|
232
|
+
"EXAMPLE:"; echo = 2;
|
|
233
|
+
intmat M[5][3]=
|
|
234
|
+
8,1,9,
|
|
235
|
+
9,2,4,
|
|
236
|
+
0,6,2,
|
|
237
|
+
8,8,8,
|
|
238
|
+
0,9,5;
|
|
239
|
+
cone c=coneViaInequalities(M);
|
|
240
|
+
c;
|
|
241
|
+
cone cc=canonicalizeCone(c);
|
|
242
|
+
cc;
|
|
243
|
+
// computes a unique representation of c
|
|
244
|
+
c == cc;
|
|
245
|
+
// some procedures work with the known inequalities and equations
|
|
246
|
+
// in order to obtain a unique output,
|
|
247
|
+
// bring the cone in canonical form beforehand
|
|
248
|
+
relativeInteriorPoint(c);
|
|
249
|
+
relativeInteriorPoint(cc);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
proc codimension(def coneOrFanOrPolytope)
|
|
253
|
+
"USAGE: codimension(c); c cone
|
|
254
|
+
codimension(f); f fan
|
|
255
|
+
codimension(p); p polytope
|
|
256
|
+
RETURN: int, the codimension of the input
|
|
257
|
+
EXAMPLE: example codimension; shows an example
|
|
258
|
+
"
|
|
259
|
+
{
|
|
260
|
+
return (codimensionInternal(coneOrFanOrPolytope));
|
|
261
|
+
}
|
|
262
|
+
example
|
|
263
|
+
{
|
|
264
|
+
"EXAMPLE:"; echo = 2;
|
|
265
|
+
intmat M1[1][2]=
|
|
266
|
+
1,0;
|
|
267
|
+
cone c1=coneViaPoints(M1);
|
|
268
|
+
codimension(c1);
|
|
269
|
+
intmat M2[2][2]=
|
|
270
|
+
1,0,
|
|
271
|
+
0,1;
|
|
272
|
+
cone c2=coneViaPoints(M2);
|
|
273
|
+
codimension(c2);
|
|
274
|
+
|
|
275
|
+
fan f = emptyFan(2);
|
|
276
|
+
codimension(f);
|
|
277
|
+
insertCone(f,c1);
|
|
278
|
+
codimension(f);
|
|
279
|
+
insertCone(f,c2);
|
|
280
|
+
codimension(f);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
proc coneViaPoints(def HL, list #)
|
|
284
|
+
"USAGE: coneViaPoints(HL); intmat HL
|
|
285
|
+
coneViaPoints(HL,L); intmat HL, intmat L
|
|
286
|
+
coneViaPoints(HL,L,flags); intmat HL, intmat L, int flags
|
|
287
|
+
RETURN: cone
|
|
288
|
+
PURPOSE: cone generated by half lines generated by the row vectors of HL
|
|
289
|
+
and (if stated) by lines generated by the row vectors of L;
|
|
290
|
+
flags may range between 0,..,3 defining an upper and lower bit
|
|
291
|
+
(0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
|
|
292
|
+
if upper bit is 1, then program assumes that each row vector in HL
|
|
293
|
+
generates a ray of the cone,
|
|
294
|
+
if lower bit is 1, then program assumes that the span of the row
|
|
295
|
+
vectors of L is the lineality space of the cone,
|
|
296
|
+
if either bit is 0, then program computes the information itself.
|
|
297
|
+
EXAMPLE: example coneViaPoints; shows an example
|
|
298
|
+
"
|
|
299
|
+
{
|
|
300
|
+
if (size(#)==2)
|
|
301
|
+
{
|
|
302
|
+
return (coneViaPointsInternal(HL,#[1],#[2]));
|
|
303
|
+
}
|
|
304
|
+
if (size(#)==1)
|
|
305
|
+
{
|
|
306
|
+
return (coneViaPointsInternal(HL,#[1]));
|
|
307
|
+
}
|
|
308
|
+
return (coneViaPointsInternal(HL));
|
|
309
|
+
}
|
|
310
|
+
example
|
|
311
|
+
{
|
|
312
|
+
"EXAMPLE:"; echo = 2;
|
|
313
|
+
// Let's define a cone in R^3 generated by the following half lines:
|
|
314
|
+
intmat HL[5][3]=
|
|
315
|
+
1,0, 0,
|
|
316
|
+
-1,0, 0,
|
|
317
|
+
0,1, 1,
|
|
318
|
+
0,1,-1,
|
|
319
|
+
0,0, 1;
|
|
320
|
+
cone c=coneViaPoints(HL);
|
|
321
|
+
c;
|
|
322
|
+
kill HL,c;
|
|
323
|
+
// Note that (1,0,0) and (-1,0,0) form a line, hence also possible:
|
|
324
|
+
intmat HL[3][3]=
|
|
325
|
+
0,1, 1,
|
|
326
|
+
0,1,-1,
|
|
327
|
+
0,0, 1;
|
|
328
|
+
intmat L[1][3]=
|
|
329
|
+
1,0,0;
|
|
330
|
+
cone c=coneViaPoints(HL,L);
|
|
331
|
+
c;
|
|
332
|
+
kill HL,L,c;
|
|
333
|
+
// lineality space is exactly Lin(1,0,0)
|
|
334
|
+
intmat HL[3][3]=
|
|
335
|
+
0,1, 1,
|
|
336
|
+
0,1,-1,
|
|
337
|
+
0,0, 1;
|
|
338
|
+
intmat L[1][3]=
|
|
339
|
+
1,0,0;
|
|
340
|
+
cone c=coneViaPoints(HL,L,1);
|
|
341
|
+
c;
|
|
342
|
+
kill HL,L,c;
|
|
343
|
+
// and that (0,1,-1), (0,1,1) generate rays
|
|
344
|
+
intmat HL[3][3]=
|
|
345
|
+
0,1, 1,
|
|
346
|
+
0,1,-1;
|
|
347
|
+
intmat L[1][3]=
|
|
348
|
+
1,0,0;
|
|
349
|
+
cone c=coneViaPoints(HL,L,1);
|
|
350
|
+
c;
|
|
351
|
+
kill HL,L,c;
|
|
352
|
+
// and that (0,1,-1), (0,1,1) generate rays
|
|
353
|
+
intmat HL[3][3]=
|
|
354
|
+
0,1, 1,
|
|
355
|
+
0,1,-1;
|
|
356
|
+
intmat L[1][3]=
|
|
357
|
+
1,0,0;
|
|
358
|
+
cone c=coneViaPoints(HL,L,3);
|
|
359
|
+
c;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
proc coneViaInequalities(def E, list #)
|
|
363
|
+
"USAGE: coneViaInequalities(IE); intmat IE
|
|
364
|
+
coneViaInequalities(IE,E); intmat IE, intmat E
|
|
365
|
+
coneViaInequalities(IE,E,flags); intmat IE, intmat E, int flags
|
|
366
|
+
RETURN: cone
|
|
367
|
+
PURPOSE: cone consisting of all points x, such that IE*x >= 0 in each component
|
|
368
|
+
and (if stated) E*x = 0;
|
|
369
|
+
inequalities and (if stated) equations will be transformed, getting rid of
|
|
370
|
+
redundancies;
|
|
371
|
+
flags may range between 0,..,3 defining an upper and lower bit
|
|
372
|
+
(0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
|
|
373
|
+
if higher bit is 1, then program assumes each inequality yields a facet,
|
|
374
|
+
if lower bit is 1, then program assumes the kernel of E is the span of the cone,
|
|
375
|
+
if either bit is 0, then program computes the information itself.
|
|
376
|
+
EXAMPLE: example coneViaInequalities; shows an example
|
|
377
|
+
"
|
|
378
|
+
{
|
|
379
|
+
if (size(#)==2)
|
|
380
|
+
{
|
|
381
|
+
return (coneViaInequalitiesInternal(E,#[1],#[2]));
|
|
382
|
+
}
|
|
383
|
+
if (size(#)==1)
|
|
384
|
+
{
|
|
385
|
+
return (coneViaInequalitiesInternal(E,#[1]));
|
|
386
|
+
}
|
|
387
|
+
return (coneViaInequalitiesInternal(E));
|
|
388
|
+
}
|
|
389
|
+
example
|
|
390
|
+
{
|
|
391
|
+
"EXAMPLE:"; echo = 2;
|
|
392
|
+
// Let's define a cone in R^3 given by the following inequalities:
|
|
393
|
+
intmat IE[6][3]=
|
|
394
|
+
1,3,5,
|
|
395
|
+
1,5,3,
|
|
396
|
+
0,1,-1,
|
|
397
|
+
0,1,1,
|
|
398
|
+
1,0,0,
|
|
399
|
+
-1,0,0;
|
|
400
|
+
cone c=coneViaInequalities(IE);
|
|
401
|
+
c;
|
|
402
|
+
// Note that the last two inequalities yield x1 = 0, hence also possible:
|
|
403
|
+
intmat IE[4][3]=
|
|
404
|
+
0,1,-1,
|
|
405
|
+
0,1,1;
|
|
406
|
+
intmat E[1][3]=
|
|
407
|
+
1,0,0;
|
|
408
|
+
cone c=coneViaInequalities(IE,E);
|
|
409
|
+
c;
|
|
410
|
+
// each inequalities gives rise to a facet
|
|
411
|
+
intmat IE[2][3]=
|
|
412
|
+
0,1,-1,
|
|
413
|
+
0,1,1;
|
|
414
|
+
intmat E[1][3]=
|
|
415
|
+
1,0,0;
|
|
416
|
+
cone c=coneViaInequalities(IE,E,1);
|
|
417
|
+
c;
|
|
418
|
+
// and the kernel of E is the span of the cone
|
|
419
|
+
intmat IE[2][3]=
|
|
420
|
+
0,1,-1,
|
|
421
|
+
0,1,1;
|
|
422
|
+
intmat E[1][3]=
|
|
423
|
+
1,0,0;
|
|
424
|
+
cone c=coneViaInequalities(IE,E,3);
|
|
425
|
+
c;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
proc coneLink(cone c, def w)
|
|
429
|
+
"USAGE: coneLink(c,w); c cone, w intvec/bigintmat
|
|
430
|
+
RETURN: cone, the link of c around w
|
|
431
|
+
EXAMPLE: example coneLink; shows an example
|
|
432
|
+
"
|
|
433
|
+
{
|
|
434
|
+
return (coneLinkInternal(c,w));
|
|
435
|
+
}
|
|
436
|
+
example
|
|
437
|
+
{
|
|
438
|
+
"EXAMPLE:"; echo = 2;
|
|
439
|
+
intmat M[3][3]=
|
|
440
|
+
1,0,0,
|
|
441
|
+
0,1,0,
|
|
442
|
+
0,0,1;
|
|
443
|
+
cone c=coneViaPoints(M);
|
|
444
|
+
intvec v=1,0,0;
|
|
445
|
+
cone cv=coneLink(c,v);
|
|
446
|
+
rays(cv);
|
|
447
|
+
generatorsOfLinealitySpace(cv);
|
|
448
|
+
intvec w=1,1,1;
|
|
449
|
+
cone cw=coneLink(c,w);
|
|
450
|
+
rays(cw);
|
|
451
|
+
generatorsOfLinealitySpace(cw);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
proc containsAsFace(cone c, cone d)
|
|
455
|
+
"USAGE: containsAsFace(c,d); c cone, d cone
|
|
456
|
+
RETURN: 1, if d is a face of c; 0 otherwise
|
|
457
|
+
EXAMPLE: example containsAsFace; shows an example
|
|
458
|
+
"
|
|
459
|
+
{
|
|
460
|
+
return (containsAsFaceInternal(c,d));
|
|
461
|
+
}
|
|
462
|
+
example
|
|
463
|
+
{
|
|
464
|
+
"EXAMPLE:"; echo = 2;
|
|
465
|
+
intmat M[2][2]=
|
|
466
|
+
1,0,
|
|
467
|
+
0,1;
|
|
468
|
+
cone c=coneViaPoints(M);
|
|
469
|
+
intmat N1[1][2]=
|
|
470
|
+
1,1;
|
|
471
|
+
cone d1=coneViaPoints(N1);
|
|
472
|
+
containsInSupport(c,d1);
|
|
473
|
+
containsAsFace(c,d1);
|
|
474
|
+
intmat N2[1][2]=
|
|
475
|
+
0,1;
|
|
476
|
+
cone d2=coneViaPoints(N2);
|
|
477
|
+
containsInSupport(c,d2);
|
|
478
|
+
containsAsFace(c,d2);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
proc containsRelatively(cone c, def p)
|
|
482
|
+
"USAGE: containsRelatively(c,p); c cone, p intvec/bigintmat
|
|
483
|
+
RETURN: 1 iff the given cone contains the given point in its relative interior; 0 otherwise
|
|
484
|
+
EXAMPLE: example containsRelatively; shows an example
|
|
485
|
+
"
|
|
486
|
+
{
|
|
487
|
+
return (containsRelativelyInternal(c,p));
|
|
488
|
+
}
|
|
489
|
+
example
|
|
490
|
+
{
|
|
491
|
+
"EXAMPLE:"; echo = 2;
|
|
492
|
+
intmat M[2][2]=
|
|
493
|
+
1,0,
|
|
494
|
+
0,1;
|
|
495
|
+
cone c=coneViaPoints(M);
|
|
496
|
+
intvec p1=1,1;
|
|
497
|
+
containsRelatively(c,p1);
|
|
498
|
+
intvec p2=0,1;
|
|
499
|
+
containsRelatively(c,p2);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
proc containsInSupport(cone c, def d)
|
|
503
|
+
"USAGE: containsInSupport(c,d); c cone, d cone
|
|
504
|
+
containsInSupport(c,p); c cone, p intvec/bigintmat
|
|
505
|
+
RETURN: 1, if d resp. p is contained in c; 0 otherwise
|
|
506
|
+
EXAMPLE: example containsInSupport; shows an example
|
|
507
|
+
"
|
|
508
|
+
{
|
|
509
|
+
return (containsInSupportInternal(c,d));
|
|
510
|
+
}
|
|
511
|
+
example
|
|
512
|
+
{
|
|
513
|
+
"EXAMPLE:"; echo = 2;
|
|
514
|
+
intmat M[2][2]=
|
|
515
|
+
1,0,
|
|
516
|
+
0,1;
|
|
517
|
+
cone c=coneViaPoints(M);
|
|
518
|
+
containsInSupport(c,c);
|
|
519
|
+
intmat N1[2][2]=
|
|
520
|
+
1,1,
|
|
521
|
+
0,1;
|
|
522
|
+
cone d1=coneViaPoints(N1);
|
|
523
|
+
containsInSupport(c,d1);
|
|
524
|
+
intmat N2[2][2]=
|
|
525
|
+
1,1,
|
|
526
|
+
1,-1;
|
|
527
|
+
cone d2=coneViaPoints(N2);
|
|
528
|
+
containsInSupport(c,d2);
|
|
529
|
+
intvec p1=0,1;
|
|
530
|
+
containsInSupport(c,p1);
|
|
531
|
+
intvec p2=1,-1;
|
|
532
|
+
containsInSupport(c,p2);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
proc containsPositiveVector(cone c)
|
|
536
|
+
"USAGE: containsPositiveVector(c); c cone
|
|
537
|
+
RETURN: 1, if c contains a vector with only positive entries in its relative interior
|
|
538
|
+
EXAMPLE: example containsPositiveVector; shows an example
|
|
539
|
+
"
|
|
540
|
+
{
|
|
541
|
+
return (containsPositiveVectorInternal(c));
|
|
542
|
+
}
|
|
543
|
+
example
|
|
544
|
+
{
|
|
545
|
+
"EXAMPLE:"; echo = 2;
|
|
546
|
+
intmat M1[2][2]=
|
|
547
|
+
1,1,
|
|
548
|
+
1,-1;
|
|
549
|
+
cone c1=coneViaPoints(M1);
|
|
550
|
+
containsPositiveVector(c1);
|
|
551
|
+
intmat M2[2][2]=
|
|
552
|
+
0,1,
|
|
553
|
+
-1,0;
|
|
554
|
+
cone c2=coneViaPoints(M2);
|
|
555
|
+
containsPositiveVector(c2);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
proc convexHull(def coneOrPolytope1, def coneOrPolytope2)
|
|
559
|
+
"USAGE: convexHull(c1,c2); c1 cone, c2 cone
|
|
560
|
+
convexHull(c1,p1); c1 cone, p1 polytope
|
|
561
|
+
convexHull(p1,c1); p1 cone, c1 polytope
|
|
562
|
+
convexHull(p1,p2); p1 polytope, p2 polytope
|
|
563
|
+
RETURN: cone resp polytope, the convex hull of its two input objects
|
|
564
|
+
EXAMPLE: example convexHull; shows an example
|
|
565
|
+
"
|
|
566
|
+
{
|
|
567
|
+
return (convexHullInternal(coneOrPolytope1,coneOrPolytope2));
|
|
568
|
+
}
|
|
569
|
+
example
|
|
570
|
+
{
|
|
571
|
+
"EXAMPLE:"; echo = 2;
|
|
572
|
+
intmat M1[2][2]=
|
|
573
|
+
1,0,
|
|
574
|
+
0,1;
|
|
575
|
+
cone c1=coneViaPoints(M1);
|
|
576
|
+
intmat M2[2][2]=
|
|
577
|
+
1,1,
|
|
578
|
+
1,-1;
|
|
579
|
+
cone c2=coneViaPoints(M2);
|
|
580
|
+
intmat M3[2][2]=
|
|
581
|
+
1,0,
|
|
582
|
+
0,-1;
|
|
583
|
+
cone c3=coneViaPoints(M3);
|
|
584
|
+
cone c12=convexHull(c1,c2);
|
|
585
|
+
c12;
|
|
586
|
+
print(rays(c12));
|
|
587
|
+
cone c23=convexHull(c2,c3);
|
|
588
|
+
c23;
|
|
589
|
+
print(rays(c23));
|
|
590
|
+
cone c13=convexHull(c1,c3);
|
|
591
|
+
c13;
|
|
592
|
+
print(rays(c13));
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
proc convexIntersection(list #)
|
|
596
|
+
"USAGE: convexIntersection(c1,c2); c1 cone, c2 cone
|
|
597
|
+
convexIntersection(c1,p1); c1 cone, p1 polytope
|
|
598
|
+
convexIntersection(p1,c1); p1 cone, c1 polytope
|
|
599
|
+
convexIntersection(p1,p2); p1 polytope, p2 polytope
|
|
600
|
+
convexIntersection(L); L list of cones resp polytopes
|
|
601
|
+
RETURN: cone resp polytope, the convex hull of its two input objects
|
|
602
|
+
EXAMPLE: example convexIntersection; shows an example
|
|
603
|
+
"
|
|
604
|
+
{
|
|
605
|
+
if (typeof(#[1])=="list")
|
|
606
|
+
{
|
|
607
|
+
return (convexIntersectionInternal(#[1]));
|
|
608
|
+
}
|
|
609
|
+
return (convexIntersectionInternal(#));
|
|
610
|
+
}
|
|
611
|
+
example
|
|
612
|
+
{
|
|
613
|
+
"EXAMPLE:"; echo = 2;
|
|
614
|
+
intmat M1[2][2]=
|
|
615
|
+
1,0,
|
|
616
|
+
0,1;
|
|
617
|
+
cone c1=coneViaPoints(M1);
|
|
618
|
+
intmat M2[2][2]=
|
|
619
|
+
1,1,
|
|
620
|
+
1,-1;
|
|
621
|
+
cone c2=coneViaPoints(M2);
|
|
622
|
+
intmat M3[2][2]=
|
|
623
|
+
1,0,
|
|
624
|
+
0,-1;
|
|
625
|
+
cone c3=coneViaPoints(M3);
|
|
626
|
+
cone c12=convexIntersection(c1,c2);
|
|
627
|
+
c12;
|
|
628
|
+
print(rays(c12));
|
|
629
|
+
cone c23=convexIntersection(c2,c3);
|
|
630
|
+
c23;
|
|
631
|
+
print(rays(c23));
|
|
632
|
+
cone c13=convexIntersection(c1,c3);
|
|
633
|
+
c13;
|
|
634
|
+
print(rays(c13));
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
proc dimension(def coneOrFanOrPolytope)
|
|
638
|
+
"USAGE: dimension(c); c cone
|
|
639
|
+
dimension(f); f fan
|
|
640
|
+
dimension(p); p polytope
|
|
641
|
+
RETURN: int, the dimension of the input
|
|
642
|
+
EXAMPLE: example dimension; shows an example
|
|
643
|
+
"
|
|
644
|
+
{
|
|
645
|
+
return (dimensionInternal(coneOrFanOrPolytope));
|
|
646
|
+
}
|
|
647
|
+
example
|
|
648
|
+
{
|
|
649
|
+
"EXAMPLE:"; echo = 2;
|
|
650
|
+
intmat M1[1][2]=
|
|
651
|
+
1,0;
|
|
652
|
+
cone c1=coneViaPoints(M1);
|
|
653
|
+
dimension(c1);
|
|
654
|
+
intmat M2[2][2]=
|
|
655
|
+
1,0,
|
|
656
|
+
0,1;
|
|
657
|
+
cone c2=coneViaPoints(M2);
|
|
658
|
+
dimension(c2);
|
|
659
|
+
|
|
660
|
+
fan f = emptyFan(2);
|
|
661
|
+
dimension(f);
|
|
662
|
+
insertCone(f,c1);
|
|
663
|
+
dimension(f);
|
|
664
|
+
insertCone(f,c2);
|
|
665
|
+
dimension(f);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
proc dualCone(cone c)
|
|
669
|
+
"USAGE: dualCone(c); c cone
|
|
670
|
+
RETURN: cone, the dual of c
|
|
671
|
+
EXAMPLE: example dualCone; shows an example
|
|
672
|
+
"
|
|
673
|
+
{
|
|
674
|
+
return (dualConeInternal(c));
|
|
675
|
+
}
|
|
676
|
+
example
|
|
677
|
+
{
|
|
678
|
+
"EXAMPLE:"; echo = 2;
|
|
679
|
+
intmat M1[2][2]=
|
|
680
|
+
1,0,
|
|
681
|
+
0,1;
|
|
682
|
+
cone c1=coneViaPoints(M1);
|
|
683
|
+
cone d1=dualCone(c1);
|
|
684
|
+
d1;
|
|
685
|
+
print(rays(d1));
|
|
686
|
+
intmat M2[2][2]=
|
|
687
|
+
1,1,
|
|
688
|
+
0,1;
|
|
689
|
+
cone c2=coneViaPoints(M2);
|
|
690
|
+
cone d2=dualCone(c2);
|
|
691
|
+
d2;
|
|
692
|
+
print(rays(d2));
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
proc equations(def coneOrPolytope)
|
|
696
|
+
"USAGE: equations(c); c cone
|
|
697
|
+
equations(p); p polytope
|
|
698
|
+
RETURN: bigintmat, defining equations of c resp p
|
|
699
|
+
NOTE: neither unique nor complete, unless c resp p in canonical form
|
|
700
|
+
EXAMPLE: example equations; shows an example
|
|
701
|
+
"
|
|
702
|
+
{
|
|
703
|
+
return (equationsInternal(coneOrPolytope));
|
|
704
|
+
}
|
|
705
|
+
example
|
|
706
|
+
{
|
|
707
|
+
"EXAMPLE:"; echo = 2;
|
|
708
|
+
intmat M1[2][2]=
|
|
709
|
+
1,0,
|
|
710
|
+
0,1;
|
|
711
|
+
cone c1=coneViaPoints(M1);
|
|
712
|
+
bigintmat E1=equations(c1);
|
|
713
|
+
print(E1);
|
|
714
|
+
intmat M2[1][2]=
|
|
715
|
+
1,0;
|
|
716
|
+
cone c2=coneViaPoints(M2);
|
|
717
|
+
bigintmat E2=equations(c2);
|
|
718
|
+
print(E2);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
proc faceContaining(cone c, def w)
|
|
722
|
+
"USAGE: faceContaining(c,w); c cone, w intvec/bigintmat
|
|
723
|
+
ASSUME: containsInSupport(c,w)==1
|
|
724
|
+
RETURN: cone, the face of c containing w in its relative interior
|
|
725
|
+
EXAMPLE: example faceContaining; shows an example
|
|
726
|
+
"
|
|
727
|
+
{
|
|
728
|
+
return (faceContainingInternal(c,w));
|
|
729
|
+
}
|
|
730
|
+
example
|
|
731
|
+
{
|
|
732
|
+
"EXAMPLE:"; echo = 2;
|
|
733
|
+
intmat M[2][2]=
|
|
734
|
+
1,0,
|
|
735
|
+
0,1;
|
|
736
|
+
cone c=coneViaPoints(M);
|
|
737
|
+
faceContaining(c,intvec(1,0));
|
|
738
|
+
faceContaining(c,intvec(0,1));
|
|
739
|
+
faceContaining(c,intvec(1,1));
|
|
740
|
+
faceContaining(c,intvec(0,0));
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
proc facets(def coneOrPolytope)
|
|
744
|
+
"USAGE: facets(c); c cone
|
|
745
|
+
facets(p); p polytope
|
|
746
|
+
RETURN: bigintmat, the facets of c resp p
|
|
747
|
+
EXAMPLE: example facets; shows an example
|
|
748
|
+
"
|
|
749
|
+
{
|
|
750
|
+
return (facetsInternal(coneOrPolytope));
|
|
751
|
+
}
|
|
752
|
+
example
|
|
753
|
+
{
|
|
754
|
+
"EXAMPLE:"; echo = 2;
|
|
755
|
+
intmat M1[2][2]=
|
|
756
|
+
1,0,
|
|
757
|
+
0,1;
|
|
758
|
+
cone c1=coneViaPoints(M1);
|
|
759
|
+
bigintmat F1=facets(c1);
|
|
760
|
+
print(F1);
|
|
761
|
+
intmat M2[2][2]=
|
|
762
|
+
1,1,
|
|
763
|
+
0,-1;
|
|
764
|
+
cone c2=coneViaPoints(M2);
|
|
765
|
+
bigintmat F2=facets(c2);
|
|
766
|
+
print(F2);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
proc generatorsOfLinealitySpace(cone c)
|
|
770
|
+
"USAGE: generatorsOfLinealitySpace(c); c cone
|
|
771
|
+
RETURN: bigintmat, generators of the lineality space of c
|
|
772
|
+
EXAMPLE: example generatorsOfLinealitySpace; shows an example
|
|
773
|
+
"
|
|
774
|
+
{
|
|
775
|
+
return (generatorsOfLinealitySpaceInternal(c));
|
|
776
|
+
}
|
|
777
|
+
example
|
|
778
|
+
{
|
|
779
|
+
"EXAMPLE:"; echo = 2;
|
|
780
|
+
intmat M[5][3]=
|
|
781
|
+
1,0,0,
|
|
782
|
+
0,1,0,
|
|
783
|
+
0,0,1,
|
|
784
|
+
-1,0,0,
|
|
785
|
+
0,-1,0;
|
|
786
|
+
cone c=coneViaPoints(M);
|
|
787
|
+
bigintmat L=generatorsOfLinealitySpace(c);
|
|
788
|
+
print(L);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
proc generatorsOfSpan(cone c)
|
|
792
|
+
"USAGE: generatorsOfSpan(c); c cone
|
|
793
|
+
RETURN: bigintmat, generators of the span of c
|
|
794
|
+
EXAMPLE: example generatorsOfSpan; shows an example
|
|
795
|
+
"
|
|
796
|
+
{
|
|
797
|
+
return (generatorsOfSpanInternal(c));
|
|
798
|
+
}
|
|
799
|
+
example
|
|
800
|
+
{
|
|
801
|
+
"EXAMPLE:"; echo = 2;
|
|
802
|
+
intmat M[3][5]=
|
|
803
|
+
1,0,0,0,0,
|
|
804
|
+
0,1,0,0,0,
|
|
805
|
+
0,0,1,0,0;
|
|
806
|
+
cone c=coneViaPoints(M);
|
|
807
|
+
bigintmat S=generatorsOfSpan(c);
|
|
808
|
+
print(S);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
proc getLinearForms(def coneOrPolytope)
|
|
812
|
+
"USAGE: getLinearForms(c); c cone
|
|
813
|
+
getLinearForms(p); p polytope
|
|
814
|
+
RETURN: bigintmat, linear forms previously stored in c resp p
|
|
815
|
+
EXAMPLE: example getLinearForms; shows an example
|
|
816
|
+
"
|
|
817
|
+
{
|
|
818
|
+
return (getLinearFormsInternal(coneOrPolytope));
|
|
819
|
+
}
|
|
820
|
+
example
|
|
821
|
+
{
|
|
822
|
+
"EXAMPLE:"; echo = 2;
|
|
823
|
+
intmat M[2][3]=
|
|
824
|
+
-1,0,0,
|
|
825
|
+
0,-1,0;
|
|
826
|
+
cone c=coneViaPoints(M);
|
|
827
|
+
getLinearForms(c);
|
|
828
|
+
intvec v=1,1,1;
|
|
829
|
+
setLinearForms(c,v);
|
|
830
|
+
getLinearForms(c);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
proc getMultiplicity(def coneOrPolytope)
|
|
834
|
+
"USAGE: getMultiplicity(c); c cone
|
|
835
|
+
getMultiplicity(p); p polytope
|
|
836
|
+
RETURN: bigint, 1 or a multiplicity previously stored in c resp p
|
|
837
|
+
EXAMPLE: example getMultiplicity; shows an example
|
|
838
|
+
"
|
|
839
|
+
{
|
|
840
|
+
return (getMultiplicityInternal(coneOrPolytope));
|
|
841
|
+
}
|
|
842
|
+
example
|
|
843
|
+
{
|
|
844
|
+
"EXAMPLE:"; echo = 2;
|
|
845
|
+
intmat M[2][3]=
|
|
846
|
+
-1,0,0,
|
|
847
|
+
0,-1,0;
|
|
848
|
+
cone c=coneViaPoints(M);
|
|
849
|
+
getMultiplicity(c);
|
|
850
|
+
setMultiplicity(c,3);
|
|
851
|
+
getMultiplicity(c);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
proc inequalities(def coneOrPolytope)
|
|
855
|
+
"USAGE: inequalities(c); c cone
|
|
856
|
+
inequalities(p); p polytope
|
|
857
|
+
RETURN: bigintmat, the inequalities of c resp p
|
|
858
|
+
NOTE: neither unique nor irredundant, unless c resp p in canonical form
|
|
859
|
+
EXAMPLE: example inequalities; shows an example
|
|
860
|
+
"
|
|
861
|
+
{
|
|
862
|
+
return (inequalitiesInternal(coneOrPolytope));
|
|
863
|
+
}
|
|
864
|
+
example
|
|
865
|
+
{
|
|
866
|
+
"EXAMPLE:"; echo = 2;
|
|
867
|
+
intmat M1[2][2]=
|
|
868
|
+
1,0,
|
|
869
|
+
0,1;
|
|
870
|
+
cone c1=coneViaPoints(M1);
|
|
871
|
+
bigintmat I1=inequalities(c1);
|
|
872
|
+
print(I1);
|
|
873
|
+
intmat M2[2][2]=
|
|
874
|
+
1,1,
|
|
875
|
+
0,-1;
|
|
876
|
+
cone c2=coneViaPoints(M2);
|
|
877
|
+
bigintmat I2=inequalities(c2);
|
|
878
|
+
print(I2);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
proc isFullSpace(cone c)
|
|
882
|
+
"USAGE: isFullSpace(c); c cone
|
|
883
|
+
RETURN: 1, if c is the entire ambient space; 0 otherwise
|
|
884
|
+
EXAMPLE: example isFullSpace; shows an example
|
|
885
|
+
"
|
|
886
|
+
{
|
|
887
|
+
return (isFullSpaceInternal(c));
|
|
888
|
+
}
|
|
889
|
+
example
|
|
890
|
+
{
|
|
891
|
+
"EXAMPLE:"; echo = 2;
|
|
892
|
+
cone c1;
|
|
893
|
+
isFullSpace(c1);
|
|
894
|
+
intmat M2[2][2]=
|
|
895
|
+
1,0,
|
|
896
|
+
0,1;
|
|
897
|
+
cone c2=coneViaPoints(M2);
|
|
898
|
+
isFullSpace(c2);
|
|
899
|
+
intmat M3[4][2]=
|
|
900
|
+
1,0,
|
|
901
|
+
0,1,
|
|
902
|
+
-1,0,
|
|
903
|
+
0,-1;
|
|
904
|
+
cone c3=coneViaPoints(M3);
|
|
905
|
+
isFullSpace(c3);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
proc isOrigin(cone c)
|
|
909
|
+
"USAGE: isOrigin(c); c cone
|
|
910
|
+
RETURN: 1, if c is the origin; 0 otherwise
|
|
911
|
+
EXAMPLE: example isOrigin; shows an example
|
|
912
|
+
"
|
|
913
|
+
{
|
|
914
|
+
return (isOriginInternal(c));
|
|
915
|
+
}
|
|
916
|
+
example
|
|
917
|
+
{
|
|
918
|
+
"EXAMPLE:"; echo = 2;
|
|
919
|
+
cone c1;
|
|
920
|
+
isOrigin(c1);
|
|
921
|
+
intmat M2[2][2]=
|
|
922
|
+
1,0,
|
|
923
|
+
0,1;
|
|
924
|
+
cone c2=coneViaPoints(M2);
|
|
925
|
+
isOrigin(c2);
|
|
926
|
+
intmat M3[4][2]=
|
|
927
|
+
1,0,
|
|
928
|
+
0,1,
|
|
929
|
+
-1,0,
|
|
930
|
+
0,-1;
|
|
931
|
+
cone c3=coneViaPoints(M3);
|
|
932
|
+
isOrigin(c3);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
proc isSimplicial(def coneOrFan)
|
|
936
|
+
"USAGE: isSimplicial(c); c cone
|
|
937
|
+
isSimplicial(f); f fan
|
|
938
|
+
RETURN: 1, if c resp f is simplicial; 0 otherwise
|
|
939
|
+
EXAMPLE: example isSimplicial; shows an example
|
|
940
|
+
"
|
|
941
|
+
{
|
|
942
|
+
return (isSimplicialInternal(coneOrFan));
|
|
943
|
+
}
|
|
944
|
+
example
|
|
945
|
+
{
|
|
946
|
+
"EXAMPLE:"; echo = 2;
|
|
947
|
+
intmat M1[3][3]=
|
|
948
|
+
1,0,0,
|
|
949
|
+
0,1,0,
|
|
950
|
+
0,0,1;
|
|
951
|
+
cone c1=coneViaPoints(M1);
|
|
952
|
+
isSimplicial(c1);
|
|
953
|
+
intmat M2[4][3]=
|
|
954
|
+
1,0,0,
|
|
955
|
+
0,1,0,
|
|
956
|
+
0,0,1,
|
|
957
|
+
1,1,-1;
|
|
958
|
+
cone c2=coneViaPoints(M2);
|
|
959
|
+
isSimplicial(c2);
|
|
960
|
+
/***********************/
|
|
961
|
+
fan f=emptyFan(3);
|
|
962
|
+
isSimplicial(f);
|
|
963
|
+
intmat N1[3][3]=
|
|
964
|
+
1,0,0,
|
|
965
|
+
0,1,0,
|
|
966
|
+
0,0,1;
|
|
967
|
+
cone d1=coneViaPoints(N1);
|
|
968
|
+
insertCone(f,d1);
|
|
969
|
+
isSimplicial(f);
|
|
970
|
+
intmat N2[4][3]=
|
|
971
|
+
1,0,0,
|
|
972
|
+
0,1,0,
|
|
973
|
+
1,0,-1,
|
|
974
|
+
0,1,-1;
|
|
975
|
+
cone d2=coneViaPoints(N2);
|
|
976
|
+
insertCone(f,d2);
|
|
977
|
+
isSimplicial(f);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
proc linealityDimension(def coneOrFan)
|
|
981
|
+
"USAGE: linealityDimension(c); c cone
|
|
982
|
+
linealityDimension(f); f fan
|
|
983
|
+
RETURN: int, the dimension of the lineality space of c resp f
|
|
984
|
+
EXAMPLE: example linealityDimension; shows an example
|
|
985
|
+
"
|
|
986
|
+
{
|
|
987
|
+
return (linealityDimensionInternal(coneOrFan));
|
|
988
|
+
}
|
|
989
|
+
example
|
|
990
|
+
{
|
|
991
|
+
"EXAMPLE:"; echo = 2;
|
|
992
|
+
intmat M1[3][3]=
|
|
993
|
+
1,0,0,
|
|
994
|
+
0,1,0,
|
|
995
|
+
0,0,1;
|
|
996
|
+
cone c1=coneViaPoints(M1);
|
|
997
|
+
linealityDimension(c1);
|
|
998
|
+
intmat M2[4][3]=
|
|
999
|
+
1,0,0,
|
|
1000
|
+
0,1,0,
|
|
1001
|
+
0,0,1,
|
|
1002
|
+
-1,0,0;
|
|
1003
|
+
cone c2=coneViaPoints(M2);
|
|
1004
|
+
linealityDimension(c2);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
proc linealitySpace(cone c)
|
|
1008
|
+
"USAGE: linealitySpace(c); c cone
|
|
1009
|
+
RETURN: cone, the lineality space of c
|
|
1010
|
+
EXAMPLE: example linealitySpace; shows an example
|
|
1011
|
+
"
|
|
1012
|
+
{
|
|
1013
|
+
return (linealitySpaceInternal(c));
|
|
1014
|
+
}
|
|
1015
|
+
example
|
|
1016
|
+
{
|
|
1017
|
+
"EXAMPLE:"; echo = 2;
|
|
1018
|
+
intmat M1[3][3]=
|
|
1019
|
+
1,0,0,
|
|
1020
|
+
0,1,0,
|
|
1021
|
+
0,0,1;
|
|
1022
|
+
cone c1=coneViaPoints(M1);
|
|
1023
|
+
cone l1=linealitySpace(c1);
|
|
1024
|
+
l1;
|
|
1025
|
+
intmat M2[4][3]=
|
|
1026
|
+
1,0,0,
|
|
1027
|
+
0,1,0,
|
|
1028
|
+
0,0,1,
|
|
1029
|
+
-1,0,0;
|
|
1030
|
+
cone c2=coneViaPoints(M2);
|
|
1031
|
+
cone l2=linealitySpace(c2);
|
|
1032
|
+
l2;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
proc negatedCone(cone c)
|
|
1036
|
+
"USAGE: negatedCone(c); c cone
|
|
1037
|
+
RETURN: cone, the negative of c
|
|
1038
|
+
EXAMPLE: example negatedCone; shows an example
|
|
1039
|
+
"
|
|
1040
|
+
{
|
|
1041
|
+
return (negatedConeInternal(c));
|
|
1042
|
+
}
|
|
1043
|
+
example
|
|
1044
|
+
{
|
|
1045
|
+
"EXAMPLE:"; echo = 2;
|
|
1046
|
+
intmat M[2][2]=
|
|
1047
|
+
1,0,
|
|
1048
|
+
0,1;
|
|
1049
|
+
cone c=coneViaPoints(M);
|
|
1050
|
+
cone cn=negatedCone(c);
|
|
1051
|
+
print(rays(cn));
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
proc quotientLatticeBasis(cone c)
|
|
1055
|
+
"USAGE: quotientLatticeBasis(c); c cone
|
|
1056
|
+
RETURN: bigintmat, a basis of Z^n intersected with the span of c modulo Z^n intersected with the lineality space of c
|
|
1057
|
+
EXAMPLE: example quotientLatticeBasis; shows an example
|
|
1058
|
+
"
|
|
1059
|
+
{
|
|
1060
|
+
return (quotientLatticeBasisInternal(c));
|
|
1061
|
+
}
|
|
1062
|
+
example
|
|
1063
|
+
{
|
|
1064
|
+
"EXAMPLE:"; echo = 2;
|
|
1065
|
+
intmat M[3][2]=
|
|
1066
|
+
1,0,
|
|
1067
|
+
0,1,
|
|
1068
|
+
-1,0;
|
|
1069
|
+
cone c=coneViaPoints(M);
|
|
1070
|
+
bigintmat Q=quotientLatticeBasis(c);
|
|
1071
|
+
print(Q);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
proc randomPoint(cone c, list #)
|
|
1075
|
+
"USAGE: randomPoint(c); c cone
|
|
1076
|
+
randomPoint(c,b); c cone, b int
|
|
1077
|
+
RETURN: bigintmat, a random point in the relative interior of c
|
|
1078
|
+
NOTE: returns a weighted sum over all its rays
|
|
1079
|
+
if b is given and b>0, only chooses weights between 1 and b
|
|
1080
|
+
EXAMPLE: example randomPoint; shows an example
|
|
1081
|
+
"
|
|
1082
|
+
{
|
|
1083
|
+
if (size(#)==1)
|
|
1084
|
+
{
|
|
1085
|
+
return (randomPointInternal(c,#[1]));
|
|
1086
|
+
}
|
|
1087
|
+
return (randomPointInternal(c));
|
|
1088
|
+
}
|
|
1089
|
+
example
|
|
1090
|
+
{
|
|
1091
|
+
"EXAMPLE:"; echo = 2;
|
|
1092
|
+
intmat M[2][2]=
|
|
1093
|
+
1,0,
|
|
1094
|
+
0,1;
|
|
1095
|
+
cone c=coneViaPoints(M);
|
|
1096
|
+
bigintmat Q=randomPoint(c);
|
|
1097
|
+
print(Q);
|
|
1098
|
+
bigintmat P=randomPoint(c,5);
|
|
1099
|
+
print(P);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
proc rays(cone c)
|
|
1103
|
+
"USAGE: rays(c); c cone
|
|
1104
|
+
RETURN: bigintmat, generators of the rays of c, orthogonal to its lineality space
|
|
1105
|
+
EXAMPLE: example rays; shows an example
|
|
1106
|
+
"
|
|
1107
|
+
{
|
|
1108
|
+
return (raysInternal(c));
|
|
1109
|
+
}
|
|
1110
|
+
example
|
|
1111
|
+
{
|
|
1112
|
+
"EXAMPLE:"; echo = 2;
|
|
1113
|
+
intmat M1[2][2]=
|
|
1114
|
+
1,0,
|
|
1115
|
+
0,1;
|
|
1116
|
+
cone c1=coneViaPoints(M1);
|
|
1117
|
+
bigintmat R1=rays(c1);
|
|
1118
|
+
print(R1);
|
|
1119
|
+
intmat M2[3][2]=
|
|
1120
|
+
1,0,
|
|
1121
|
+
0,1,
|
|
1122
|
+
-1,0;
|
|
1123
|
+
cone c2=coneViaPoints(M2);
|
|
1124
|
+
bigintmat R2=rays(c2);
|
|
1125
|
+
print(R2);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
proc relativeInteriorPoint(cone c)
|
|
1129
|
+
"USAGE: relativeInteriorPoint(c); c cone
|
|
1130
|
+
RETURN: bigintmat, a point in the relative interior of c
|
|
1131
|
+
NOTE: not unique, unless c is in its canonical form
|
|
1132
|
+
EXAMPLE: example relativeInteriorPoint; shows an example
|
|
1133
|
+
"
|
|
1134
|
+
{
|
|
1135
|
+
return (relativeInteriorPointInternal(c));
|
|
1136
|
+
}
|
|
1137
|
+
example
|
|
1138
|
+
{
|
|
1139
|
+
"EXAMPLE:"; echo = 2;
|
|
1140
|
+
intmat M1[2][2]=
|
|
1141
|
+
1,0,
|
|
1142
|
+
0,1;
|
|
1143
|
+
cone c1=coneViaPoints(M1);
|
|
1144
|
+
relativeInteriorPoint(c1);
|
|
1145
|
+
intmat M2[2][2]=
|
|
1146
|
+
1,0,
|
|
1147
|
+
1,1;
|
|
1148
|
+
cone c2=coneViaPoints(M2);
|
|
1149
|
+
relativeInteriorPoint(c2);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
proc semigroupGenerator(cone c)
|
|
1153
|
+
"USAGE: semigroupGenerator(c); c cone
|
|
1154
|
+
RETURN: bigintmat, the generator of Z^n intersected with c modulo Z^n intersected with the lineality space of c
|
|
1155
|
+
ASSUME: dimension(c) == linealityDimension(c)+1
|
|
1156
|
+
EXAMPLE: example semigroupGenerator; shows an example
|
|
1157
|
+
"
|
|
1158
|
+
{
|
|
1159
|
+
return (semigroupGeneratorInternal(c));
|
|
1160
|
+
}
|
|
1161
|
+
example
|
|
1162
|
+
{
|
|
1163
|
+
"EXAMPLE:"; echo = 2;
|
|
1164
|
+
intmat M[3][2]=
|
|
1165
|
+
1,0,
|
|
1166
|
+
0,1,
|
|
1167
|
+
-1,0;
|
|
1168
|
+
cone c=coneViaPoints(M);
|
|
1169
|
+
semigroupGenerator(c);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
proc setLinearForms(alias def coneOrPolytope, intvec v)
|
|
1173
|
+
"USAGE: setLinearForms(c,v); c cone, v intvec
|
|
1174
|
+
setLinearForms(p,v); p polytope, v intvec
|
|
1175
|
+
RETURN: none, stores linear forms in c resp p
|
|
1176
|
+
EXAMPLE: example setLinearForms; shows an example
|
|
1177
|
+
"
|
|
1178
|
+
{
|
|
1179
|
+
return (setLinearFormsInternal(coneOrPolytope,v));
|
|
1180
|
+
}
|
|
1181
|
+
example
|
|
1182
|
+
{
|
|
1183
|
+
"EXAMPLE:"; echo = 2;
|
|
1184
|
+
intmat M[2][3]=
|
|
1185
|
+
-1,0,0,
|
|
1186
|
+
0,-1,0;
|
|
1187
|
+
cone c=coneViaPoints(M);
|
|
1188
|
+
getLinearForms(c);
|
|
1189
|
+
intvec v=1,1,1;
|
|
1190
|
+
setLinearForms(c,v);
|
|
1191
|
+
getLinearForms(c);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
proc setMultiplicity(alias def coneOrPolytope, int m)
|
|
1195
|
+
"USAGE: setMultiplicity(c,m); c cone, m int
|
|
1196
|
+
setMultiplicity(p,m); p polytope, m int
|
|
1197
|
+
RETURN: none, stores a multiplicity in c resp p
|
|
1198
|
+
EXAMPLE: example setMultiplicity; shows an example
|
|
1199
|
+
"
|
|
1200
|
+
{
|
|
1201
|
+
return (setMultiplicityInternal(coneOrPolytope,m));
|
|
1202
|
+
}
|
|
1203
|
+
example
|
|
1204
|
+
{
|
|
1205
|
+
"EXAMPLE:"; echo = 2;
|
|
1206
|
+
intmat M[2][3]=
|
|
1207
|
+
-1,0,0,
|
|
1208
|
+
0,-1,0;
|
|
1209
|
+
cone c=coneViaPoints(M);
|
|
1210
|
+
getMultiplicity(c);
|
|
1211
|
+
setMultiplicity(c,3);
|
|
1212
|
+
getMultiplicity(c);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
proc span(cone c)
|
|
1216
|
+
"USAGE: span(c); c cone
|
|
1217
|
+
RETURN: bigintmat, unique irredundant equations of c
|
|
1218
|
+
NOTE: the name 'span' was chosen to be in line with polymake's nomenclature
|
|
1219
|
+
EXAMPLE: example span; shows an example
|
|
1220
|
+
"
|
|
1221
|
+
{
|
|
1222
|
+
return (spanInternal(c));
|
|
1223
|
+
}
|
|
1224
|
+
example
|
|
1225
|
+
{
|
|
1226
|
+
"EXAMPLE:"; echo = 2;
|
|
1227
|
+
intmat M[3][5]=
|
|
1228
|
+
1,0,0,0,0,
|
|
1229
|
+
0,1,0,0,0,
|
|
1230
|
+
0,0,1,0,0;
|
|
1231
|
+
cone c=coneViaPoints(M);
|
|
1232
|
+
bigintmat Eq=span(c);
|
|
1233
|
+
print(Eq);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
proc uniquePoint(cone c)
|
|
1238
|
+
"USAGE: uniquePoint(c); c cone
|
|
1239
|
+
RETURN: bigintmat, a unique point in c stable under reflections at coordinate hyperplanes
|
|
1240
|
+
EXAMPLE: example uniquePoint; shows an example
|
|
1241
|
+
"
|
|
1242
|
+
{
|
|
1243
|
+
return (uniquePointInternal(c));
|
|
1244
|
+
}
|
|
1245
|
+
example
|
|
1246
|
+
{
|
|
1247
|
+
"EXAMPLE:"; echo = 2;
|
|
1248
|
+
intmat M1[2][2]=
|
|
1249
|
+
1,0,
|
|
1250
|
+
0,1;
|
|
1251
|
+
cone c1=coneViaPoints(M1);
|
|
1252
|
+
uniquePoint(c1);
|
|
1253
|
+
intmat M2[2][2]=
|
|
1254
|
+
-1,0,
|
|
1255
|
+
0,1;
|
|
1256
|
+
cone c2=coneViaPoints(M2);
|
|
1257
|
+
uniquePoint(c2);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
/////
|
|
1263
|
+
// fan related functions
|
|
1264
|
+
/////
|
|
1265
|
+
|
|
1266
|
+
proc containsInCollection(fan f, cone c)
|
|
1267
|
+
"USAGE: containsInCollection(f,c); f fan, c cone
|
|
1268
|
+
RETURN: 1, if f contains c; 0 otherwise
|
|
1269
|
+
EXAMPLE: example containsInCollection; shows an example
|
|
1270
|
+
"
|
|
1271
|
+
{
|
|
1272
|
+
return (containsInCollectionInternal(f,c));
|
|
1273
|
+
}
|
|
1274
|
+
example
|
|
1275
|
+
{
|
|
1276
|
+
"EXAMPLE:"; echo = 2;
|
|
1277
|
+
fan f=emptyFan(2);
|
|
1278
|
+
intmat M[2][2]=
|
|
1279
|
+
1,0,
|
|
1280
|
+
0,1;
|
|
1281
|
+
cone c=coneViaPoints(M);
|
|
1282
|
+
containsInCollection(f,c);
|
|
1283
|
+
insertCone(f,c);
|
|
1284
|
+
containsInCollection(f,c);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
proc emptyFan(int n)
|
|
1288
|
+
"USAGE: emptyFan(n); n int
|
|
1289
|
+
RETURN: fan, an empty fan in ambient dimension n
|
|
1290
|
+
EXAMPLE: example emptyFan; shows an example
|
|
1291
|
+
"
|
|
1292
|
+
{
|
|
1293
|
+
return (emptyFanInternal(n));
|
|
1294
|
+
}
|
|
1295
|
+
example
|
|
1296
|
+
{
|
|
1297
|
+
"EXAMPLE:"; echo = 2;
|
|
1298
|
+
fan f=emptyFan(2);
|
|
1299
|
+
f;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
proc fanViaCones(list #)
|
|
1303
|
+
"USAGE: fanViaCones(L); L list
|
|
1304
|
+
fanViaCones(c1[,...,ck]); c1,...,ck cones
|
|
1305
|
+
RETURN: fan, creates a fan generated by the cones in L resp c1,...,ck
|
|
1306
|
+
EXAMPLE: example fanViaCones; shows an example
|
|
1307
|
+
"
|
|
1308
|
+
{
|
|
1309
|
+
if (typeof(#[1])=="list")
|
|
1310
|
+
{
|
|
1311
|
+
return (fanViaConesInternal(#[1]));
|
|
1312
|
+
}
|
|
1313
|
+
return (fanViaConesInternal(#));
|
|
1314
|
+
}
|
|
1315
|
+
example
|
|
1316
|
+
{
|
|
1317
|
+
"EXAMPLE:"; echo = 2;
|
|
1318
|
+
intmat M[2][2]=1,0,0,1;
|
|
1319
|
+
cone c=coneViaPoints(M);
|
|
1320
|
+
intmat N[2][2]=1,0,0,-1;
|
|
1321
|
+
cone d=coneViaPoints(N);
|
|
1322
|
+
fan f=fanViaCones(c,d);
|
|
1323
|
+
f;
|
|
1324
|
+
list L=c,d;
|
|
1325
|
+
fan g=fanViaCones(L);
|
|
1326
|
+
g;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
proc fullFan(int n)
|
|
1330
|
+
"USAGE: fullFan(n); n int
|
|
1331
|
+
RETURN: fan, an full fan in ambient dimension n
|
|
1332
|
+
EXAMPLE: example fullFan; shows an example
|
|
1333
|
+
"
|
|
1334
|
+
{
|
|
1335
|
+
return (fullFanInternal(n));
|
|
1336
|
+
}
|
|
1337
|
+
example
|
|
1338
|
+
{
|
|
1339
|
+
"EXAMPLE:"; echo = 2;
|
|
1340
|
+
fan f=fullFan(2);
|
|
1341
|
+
f;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
proc fVector(fan f)
|
|
1345
|
+
"USAGE: fVector(f); f fan
|
|
1346
|
+
RETURN: bigintmat, the f-Vector of f
|
|
1347
|
+
EXAMPLE: example fVector; shows an example
|
|
1348
|
+
"
|
|
1349
|
+
{
|
|
1350
|
+
return (fVectorInternal(f));
|
|
1351
|
+
}
|
|
1352
|
+
example
|
|
1353
|
+
{
|
|
1354
|
+
"EXAMPLE:"; echo = 2;
|
|
1355
|
+
fan f=emptyFan(2);
|
|
1356
|
+
fVector(f);
|
|
1357
|
+
intmat M[2][2]=1,0,0,1;
|
|
1358
|
+
cone c=coneViaPoints(M);
|
|
1359
|
+
insertCone(f,c);
|
|
1360
|
+
fVector(f);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
proc getCone(fan f, int d, int i, list #)
|
|
1364
|
+
"USAGE: getCone(f,d,i[,m]); f fan, d int, i int, m int
|
|
1365
|
+
ASSUME: d is between 0 and ambientDimension(f)
|
|
1366
|
+
i is between 1 and numberOfConesOfDimension(f,d,o,m)
|
|
1367
|
+
RETURN: cone, returns in the fan f of all cones in dimension d the i-th cone
|
|
1368
|
+
if m!=0, it will enumerate over maximal cones only
|
|
1369
|
+
EXAMPLE: example getCone; shows an example
|
|
1370
|
+
"
|
|
1371
|
+
{
|
|
1372
|
+
if (size(#)==1)
|
|
1373
|
+
{
|
|
1374
|
+
return (getConeInternal(f,d,i,#[1]));
|
|
1375
|
+
}
|
|
1376
|
+
return (getConeInternal(f,d,i));
|
|
1377
|
+
}
|
|
1378
|
+
example
|
|
1379
|
+
{
|
|
1380
|
+
"EXAMPLE:"; echo = 2;
|
|
1381
|
+
intmat M[3][3]=
|
|
1382
|
+
1,0,0,
|
|
1383
|
+
0,1,0,
|
|
1384
|
+
0,0,1;
|
|
1385
|
+
cone c=coneViaPoints(M);
|
|
1386
|
+
fan f=emptyFan(3);
|
|
1387
|
+
insertCone(f,c);
|
|
1388
|
+
getCone(f,2,1,0);
|
|
1389
|
+
getCone(f,2,2,0);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
proc insertCone(alias fan f, cone c, list #)
|
|
1393
|
+
"USAGE: insertCone(f,c[,b]); f fan, c cone, b int
|
|
1394
|
+
ASSUME: isCompatible(f,c)=1
|
|
1395
|
+
RETURN: none, inserts the cone c into f
|
|
1396
|
+
if b=0, then skips check whether f and c are compatible
|
|
1397
|
+
EXAMPLE: example insertCone; shows an example
|
|
1398
|
+
"
|
|
1399
|
+
{
|
|
1400
|
+
if (size(#)>0)
|
|
1401
|
+
{
|
|
1402
|
+
insertConeInternal(f,c,#[1]);
|
|
1403
|
+
return ();
|
|
1404
|
+
}
|
|
1405
|
+
insertConeInternal(f,c);
|
|
1406
|
+
}
|
|
1407
|
+
example
|
|
1408
|
+
{
|
|
1409
|
+
"EXAMPLE:"; echo = 2;
|
|
1410
|
+
fan f=emptyFan(3);
|
|
1411
|
+
f;
|
|
1412
|
+
intmat M[3][3]=
|
|
1413
|
+
1,0,0,
|
|
1414
|
+
0,1,0,
|
|
1415
|
+
0,0,1;
|
|
1416
|
+
cone c=coneViaPoints(M);
|
|
1417
|
+
insertCone(f,c);
|
|
1418
|
+
f;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
proc isCompatible(fan f, cone c)
|
|
1423
|
+
"USAGE: isCompatible(f,c); f fan, c cone
|
|
1424
|
+
RETURN: 1 if f and c live in the same ambient space and
|
|
1425
|
+
if the intersection of c with any cone of f is a face of each;
|
|
1426
|
+
0 otherwise
|
|
1427
|
+
EXAMPLE: example isCompatible; shows an example
|
|
1428
|
+
"
|
|
1429
|
+
{
|
|
1430
|
+
return (isCompatibleInternal(f,c));
|
|
1431
|
+
}
|
|
1432
|
+
example
|
|
1433
|
+
{
|
|
1434
|
+
"EXAMPLE:"; echo = 2;
|
|
1435
|
+
fan f=emptyFan(3);
|
|
1436
|
+
intmat M1[3][3]=
|
|
1437
|
+
1,0,0,
|
|
1438
|
+
0,1,0,
|
|
1439
|
+
0,0,1;
|
|
1440
|
+
cone c1=coneViaPoints(M1);
|
|
1441
|
+
isCompatible(f,c1);
|
|
1442
|
+
insertCone(f,c1);
|
|
1443
|
+
intmat M2[3][3]=
|
|
1444
|
+
1,1,1,
|
|
1445
|
+
1,0,0,
|
|
1446
|
+
0,1,0;
|
|
1447
|
+
cone c2=coneViaPoints(M2);
|
|
1448
|
+
isCompatible(f,c2);
|
|
1449
|
+
intmat M3[3][3]=
|
|
1450
|
+
1,0,0,
|
|
1451
|
+
0,1,0,
|
|
1452
|
+
0,0,-1;
|
|
1453
|
+
cone c3=coneViaPoints(M3);
|
|
1454
|
+
isCompatible(f,c3);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
proc isPure(fan f)
|
|
1458
|
+
"USAGE: isPure(f); f fan
|
|
1459
|
+
RETURN: 1 if all maximal cones of f are of the same dimension
|
|
1460
|
+
0 otherwise
|
|
1461
|
+
EXAMPLE: example isPure; shows an example
|
|
1462
|
+
"
|
|
1463
|
+
{
|
|
1464
|
+
return (isPureInternal(f));
|
|
1465
|
+
}
|
|
1466
|
+
example
|
|
1467
|
+
{
|
|
1468
|
+
"EXAMPLE:"; echo = 2;
|
|
1469
|
+
fan f=fullFan(2);
|
|
1470
|
+
isPure(f);
|
|
1471
|
+
fan g=emptyFan(2);
|
|
1472
|
+
intmat M1[2][2]=
|
|
1473
|
+
1,0,
|
|
1474
|
+
0,1;
|
|
1475
|
+
cone c1=coneViaPoints(M1);
|
|
1476
|
+
insertCone(g,c1);
|
|
1477
|
+
isPure(g);
|
|
1478
|
+
intmat M2[1][2]=
|
|
1479
|
+
0,-1;
|
|
1480
|
+
cone c2=coneViaPoints(M2);
|
|
1481
|
+
insertCone(g,c2);
|
|
1482
|
+
isPure(g,c2);
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
proc nmaxcones(fan f)
|
|
1486
|
+
"USAGE: nmaxcones(f); f fan
|
|
1487
|
+
RETURN: int, the number of maximal cones in f
|
|
1488
|
+
EXAMPLE: example nmaxcones; shows an example
|
|
1489
|
+
"
|
|
1490
|
+
{
|
|
1491
|
+
return (nmaxconesInternal(f));
|
|
1492
|
+
}
|
|
1493
|
+
example
|
|
1494
|
+
{
|
|
1495
|
+
fan f=emptyFan(3);
|
|
1496
|
+
nmaxcones(f);
|
|
1497
|
+
intmat M1[3][3]=
|
|
1498
|
+
1,0,0,
|
|
1499
|
+
0,1,0,
|
|
1500
|
+
0,0,1;
|
|
1501
|
+
cone c1=coneViaPoints(M1);
|
|
1502
|
+
insertCone(f,c1);
|
|
1503
|
+
nmaxcones(f);
|
|
1504
|
+
intmat M2[2][3]=
|
|
1505
|
+
1,0,0,
|
|
1506
|
+
0,-1,0;
|
|
1507
|
+
cone c2=coneViaPoints(M2);
|
|
1508
|
+
insertCone(f,c2);
|
|
1509
|
+
nmaxcones(f);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
proc ncones(fan f)
|
|
1513
|
+
"USAGE: ncones(f); f fan
|
|
1514
|
+
RETURN: int, the number of cones in f
|
|
1515
|
+
EXAMPLE: example ncones; shows an example
|
|
1516
|
+
"
|
|
1517
|
+
{
|
|
1518
|
+
return (nconesInternal(f));
|
|
1519
|
+
}
|
|
1520
|
+
example
|
|
1521
|
+
{
|
|
1522
|
+
fan f=emptyFan(3);
|
|
1523
|
+
ncones(f);
|
|
1524
|
+
intmat M1[3][3]=
|
|
1525
|
+
1,0,0,
|
|
1526
|
+
0,1,0,
|
|
1527
|
+
0,0,1;
|
|
1528
|
+
cone c1=coneViaPoints(M1);
|
|
1529
|
+
insertCone(f,c1);
|
|
1530
|
+
ncones(f);
|
|
1531
|
+
intmat M2[2][3]=
|
|
1532
|
+
1,0,0,
|
|
1533
|
+
0,-1,0;
|
|
1534
|
+
cone c2=coneViaPoints(M2);
|
|
1535
|
+
insertCone(f,c2);
|
|
1536
|
+
ncones(f);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
proc numberOfConesOfDimension(fan f, int d, list #)
|
|
1540
|
+
"USAGE: numberOfConesOfDimension(f,d[,m]); f fan, d int, m int
|
|
1541
|
+
ASSUME: d is between 0 and ambientDimension(f)
|
|
1542
|
+
RETURN: cone, returns in the fan f the number of cones in dimension d
|
|
1543
|
+
if m!=0, it will only count maximal cones
|
|
1544
|
+
EXAMPLE: example numberOfConesOfDimension; shows an example
|
|
1545
|
+
"
|
|
1546
|
+
{
|
|
1547
|
+
if (size(#)>0)
|
|
1548
|
+
{
|
|
1549
|
+
return (numberOfConesOfDimensionInternal(f,d,#[1]));
|
|
1550
|
+
}
|
|
1551
|
+
return (numberOfConesOfDimensionInternal(f,d));
|
|
1552
|
+
}
|
|
1553
|
+
example
|
|
1554
|
+
{
|
|
1555
|
+
"EXAMPLE:"; echo = 2;
|
|
1556
|
+
fan f=emptyFan(3);
|
|
1557
|
+
ncones(f);
|
|
1558
|
+
intmat M[3][3]=
|
|
1559
|
+
1,0,0,
|
|
1560
|
+
0,1,0,
|
|
1561
|
+
0,0,1;
|
|
1562
|
+
cone c=coneViaPoints(M);
|
|
1563
|
+
insertCone(f,c);
|
|
1564
|
+
numberOfConesOfDimension(f,0,0);
|
|
1565
|
+
numberOfConesOfDimension(f,0,1);
|
|
1566
|
+
numberOfConesOfDimension(f,1,0);
|
|
1567
|
+
numberOfConesOfDimension(f,0,1);
|
|
1568
|
+
numberOfConesOfDimension(f,2,0);
|
|
1569
|
+
numberOfConesOfDimension(f,2,1);
|
|
1570
|
+
numberOfConesOfDimension(f,3,0);
|
|
1571
|
+
numberOfConesOfDimension(f,3,1);
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
proc removeCone(fan f, cone c, list #)
|
|
1575
|
+
"USAGE: removeCone(f,c[,b]); f fan, c cone, b int
|
|
1576
|
+
ASSUME: containsInCollection(f,c)=1
|
|
1577
|
+
RETURN: none, removes the cone c from f
|
|
1578
|
+
if b=0, skips the check whether c is contained in f
|
|
1579
|
+
EXAMPLE: example removeCone; shows an example
|
|
1580
|
+
"
|
|
1581
|
+
{
|
|
1582
|
+
if (size(#)==1)
|
|
1583
|
+
{
|
|
1584
|
+
return (removeConeInternal(f,c,#[1]));
|
|
1585
|
+
}
|
|
1586
|
+
return (removeConeInternal(f,c));
|
|
1587
|
+
}
|
|
1588
|
+
example
|
|
1589
|
+
{
|
|
1590
|
+
"EXAMPLE:"; echo = 2;
|
|
1591
|
+
intmat M[2][2]=1,0,0,1;
|
|
1592
|
+
intmat N[2][2]=1,0,1,-1;
|
|
1593
|
+
cone c=coneViaPoints(M);
|
|
1594
|
+
cone d=coneViaPoints(N);
|
|
1595
|
+
fan f=emptyFan(2);
|
|
1596
|
+
insertCone(f,c);
|
|
1597
|
+
insertCone(f,d);
|
|
1598
|
+
f;
|
|
1599
|
+
removeCone(f,c);
|
|
1600
|
+
f;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
/////
|
|
1606
|
+
// polytope related functions
|
|
1607
|
+
/////
|
|
1608
|
+
|
|
1609
|
+
proc dualPolytope(polytope p)
|
|
1610
|
+
"USAGE: dualPolytope(p); p polytope
|
|
1611
|
+
RETURN: polytope, the dual of p
|
|
1612
|
+
EXAMPLE: example dualPolytope; shows an example
|
|
1613
|
+
"
|
|
1614
|
+
{
|
|
1615
|
+
return (dualPolytopeInternal(p));
|
|
1616
|
+
}
|
|
1617
|
+
example
|
|
1618
|
+
{
|
|
1619
|
+
"EXAMPLE:"; echo = 2;
|
|
1620
|
+
intmat M[4][2]=
|
|
1621
|
+
0,0,
|
|
1622
|
+
1,0,
|
|
1623
|
+
0,1,
|
|
1624
|
+
1,1;
|
|
1625
|
+
polytope p=polytopeViaPoints(M);
|
|
1626
|
+
dualPolytope(p);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
|
|
1630
|
+
proc newtonPolytope(poly f)
|
|
1631
|
+
"USAGE: newtonPolytope(f); f poly
|
|
1632
|
+
RETURN: polytope, the convex hull of all exponent vectors of f
|
|
1633
|
+
EXAMPLE: example newtonPolytope; shows an example
|
|
1634
|
+
"
|
|
1635
|
+
{
|
|
1636
|
+
return (newtonPolytopeInternal(f));
|
|
1637
|
+
}
|
|
1638
|
+
example
|
|
1639
|
+
{
|
|
1640
|
+
"EXAMPLE:"; echo = 2;
|
|
1641
|
+
ring r;
|
|
1642
|
+
poly f=x+y+z;
|
|
1643
|
+
polytope p=newtonPolytope(f);
|
|
1644
|
+
p;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
proc polytopeViaPoints(def V, list #)
|
|
1648
|
+
"USAGE: polytopeViaPoints(V [, flags]); intmat V, int flags
|
|
1649
|
+
RETURN: polytope which is the intersection of the cone generated by the row vectors
|
|
1650
|
+
of V with the hyperplane, in which the first coordinate equals 1;
|
|
1651
|
+
flags may be 0 or 1,@*
|
|
1652
|
+
if flags is 1, then program assumes that each row vector of M generates a ray in the cone,
|
|
1653
|
+
if flags is 0, then program computes that information itself
|
|
1654
|
+
EXAMPLE: example polytopeViaPoints; shows an example
|
|
1655
|
+
"
|
|
1656
|
+
{
|
|
1657
|
+
if (size(#)>0)
|
|
1658
|
+
{
|
|
1659
|
+
return (polytopeViaPointsInternal(V,#[1]));
|
|
1660
|
+
}
|
|
1661
|
+
return (polytopeViaPointsInternal(V));
|
|
1662
|
+
}
|
|
1663
|
+
example
|
|
1664
|
+
{
|
|
1665
|
+
"EXAMPLE:"; echo = 2;
|
|
1666
|
+
// This is a polytope in R^2 generated by (0,0), (1,0), (0,1), (0,0);
|
|
1667
|
+
intmat V[4][3]=
|
|
1668
|
+
1,0,0,
|
|
1669
|
+
1,1,0,
|
|
1670
|
+
1,0,1,
|
|
1671
|
+
1,1,1;
|
|
1672
|
+
polytope p1=polytopeViaPoints(V);
|
|
1673
|
+
p1;
|
|
1674
|
+
// This is a polytope in R^2 generated by (1/2,2/3), (3/4,4/5), (5/6,6/7):
|
|
1675
|
+
intmat V[3][3]=
|
|
1676
|
+
6,3,4,
|
|
1677
|
+
20,15,16,
|
|
1678
|
+
42,35,36;
|
|
1679
|
+
polytope p2=polytopeViaPoints(V);
|
|
1680
|
+
p2;
|
|
1681
|
+
// This polytope is the positive orthant in R^2:
|
|
1682
|
+
// (0,1,0) and (0,0,1) imply that the polytope is unbounded in that direction
|
|
1683
|
+
intmat V[3][3]=
|
|
1684
|
+
1,0,0,
|
|
1685
|
+
0,1,0,
|
|
1686
|
+
0,0,1;
|
|
1687
|
+
polytope p3=polytopeViaPoints(V);
|
|
1688
|
+
p3;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
proc polytopeViaInequalities(def EV, list #)
|
|
1692
|
+
"USAGE: polytopeViaInequalities(EV [, E [, flags]]); intmat EV,E, int flags
|
|
1693
|
+
RETURN: polytope consisting of all points x, such that IE*x >= 0 in each component
|
|
1694
|
+
and (if stated) E*x = 0;
|
|
1695
|
+
flags may range between 0,..,3 defining an upper and lower bit
|
|
1696
|
+
(0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
|
|
1697
|
+
if higher bit is 1, then program assumes each inequality yields a facet,
|
|
1698
|
+
if lower bit is 1, then program assumes the kernel of E is the span of the cone,
|
|
1699
|
+
if either bit is 0, then program computes the information itself.
|
|
1700
|
+
EXAMPLE: example polytopeViaPoints; shows an example
|
|
1701
|
+
"
|
|
1702
|
+
{
|
|
1703
|
+
if (size(#)==2)
|
|
1704
|
+
{
|
|
1705
|
+
return (polytopeViaInequalitiesInternal(EV,#[1],#[2]));
|
|
1706
|
+
}
|
|
1707
|
+
if (size(#)==1)
|
|
1708
|
+
{
|
|
1709
|
+
return (polytopeViaInequalitiesInternal(EV,#[1]));
|
|
1710
|
+
}
|
|
1711
|
+
return (polytopeViaInequalitiesInternal(EV));
|
|
1712
|
+
}
|
|
1713
|
+
example
|
|
1714
|
+
{
|
|
1715
|
+
"EXAMPLE:"; echo = 2;
|
|
1716
|
+
intmat IE[2][3]=
|
|
1717
|
+
1,0,0,
|
|
1718
|
+
0,1,0;
|
|
1719
|
+
intmat E[1][3]=
|
|
1720
|
+
0,0,1;
|
|
1721
|
+
polytope p=polytopeViaInequalities(IE,E);
|
|
1722
|
+
p;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
proc vertices(polytope p)
|
|
1726
|
+
"USAGE: vertices(p); p polytope
|
|
1727
|
+
RETURN: bigintmat, the vertices of p modulo its lineality space
|
|
1728
|
+
EXAMPLE: example vertices; shows an example
|
|
1729
|
+
"
|
|
1730
|
+
{
|
|
1731
|
+
return (verticesInternal(p));
|
|
1732
|
+
}
|
|
1733
|
+
example
|
|
1734
|
+
{
|
|
1735
|
+
"EXAMPLE:"; echo = 2;
|
|
1736
|
+
intmat M[4][3]=
|
|
1737
|
+
1,0,0,
|
|
1738
|
+
1,2,0,
|
|
1739
|
+
1,0,2,
|
|
1740
|
+
1,2,2,
|
|
1741
|
+
1,1,1;
|
|
1742
|
+
polytope p=polytopeViaPoints(M);
|
|
1743
|
+
vertices(p);
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
proc onesVector(int n)
|
|
1747
|
+
"USAGE: onesVector(n); n int
|
|
1748
|
+
RETURN: intvec, intvec of length n with all entries 1
|
|
1749
|
+
EXAMPLE: example onesVector; shows an example
|
|
1750
|
+
"
|
|
1751
|
+
{
|
|
1752
|
+
return (onesVectorInternal(n));
|
|
1753
|
+
}
|
|
1754
|
+
example
|
|
1755
|
+
{
|
|
1756
|
+
"EXAMPLE:"; echo = 2;
|
|
1757
|
+
intvec w = onesVector(3);
|
|
1758
|
+
w;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
static proc mod_init()
|
|
1762
|
+
{
|
|
1763
|
+
intvec save=option(get);
|
|
1764
|
+
option(noredefine);
|
|
1765
|
+
LIB "customstd.lib";
|
|
1766
|
+
LIB "gfanlib.so";
|
|
1767
|
+
option(set,save);
|
|
1768
|
+
}
|