passagemath-gap-pkg-semigroups 10.6.29__cp312-abi3-manylinux_2_24_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-gap-pkg-semigroups might be problematic. Click here for more details.
- gap/pkg/semigroups/CHANGELOG.md +1699 -0
- gap/pkg/semigroups/CONTRIBUTING.md +91 -0
- gap/pkg/semigroups/GNUmakefile +110 -0
- gap/pkg/semigroups/GNUmakefile.in +110 -0
- gap/pkg/semigroups/GPL +674 -0
- gap/pkg/semigroups/LICENSE +16 -0
- gap/pkg/semigroups/Makefile +26 -0
- gap/pkg/semigroups/Makefile.gappkg +225 -0
- gap/pkg/semigroups/PackageInfo.g +529 -0
- gap/pkg/semigroups/README.md +102 -0
- gap/pkg/semigroups/VERSIONS +112 -0
- gap/pkg/semigroups/aclocal.m4 +375 -0
- gap/pkg/semigroups/autogen.sh +25 -0
- gap/pkg/semigroups/bin/x86_64-pc-linux-gnu-default64-kv10/semigroups.so +0 -0
- gap/pkg/semigroups/config.guess +1807 -0
- gap/pkg/semigroups/config.log +1069 -0
- gap/pkg/semigroups/config.status +1133 -0
- gap/pkg/semigroups/config.sub +1960 -0
- gap/pkg/semigroups/configure +9742 -0
- gap/pkg/semigroups/configure.ac +71 -0
- gap/pkg/semigroups/data/doc/greens.pickle +1 -0
- gap/pkg/semigroups/data/gens/fullbool-8.pickle.gz +0 -0
- gap/pkg/semigroups/data/gens/fullbool.pickle.gz +0 -0
- gap/pkg/semigroups/data/gens/hall.pickle.gz +0 -0
- gap/pkg/semigroups/data/gens/reflex-6.pickle.gz +0 -0
- gap/pkg/semigroups/data/gens/reflex.pickle.gz +0 -0
- gap/pkg/semigroups/data/tst/bipart4 +10 -0
- gap/pkg/semigroups/data/tst/pperm10 +1 -0
- gap/pkg/semigroups/data/tst/tables.gz +0 -0
- gap/pkg/semigroups/data/tst/testdata +1 -0
- gap/pkg/semigroups/data/tst/testinstall.pickle +1 -0
- gap/pkg/semigroups/data/tst/trans3 +7 -0
- gap/pkg/semigroups/data/tst/trans3-old +7 -0
- gap/pkg/semigroups/environment.yml +7 -0
- gap/pkg/semigroups/gap/attributes/acting.gd +15 -0
- gap/pkg/semigroups/gap/attributes/acting.gi +297 -0
- gap/pkg/semigroups/gap/attributes/attr.gd +91 -0
- gap/pkg/semigroups/gap/attributes/attr.gi +1214 -0
- gap/pkg/semigroups/gap/attributes/dual.gd +25 -0
- gap/pkg/semigroups/gap/attributes/dual.gi +209 -0
- gap/pkg/semigroups/gap/attributes/factor.gd +17 -0
- gap/pkg/semigroups/gap/attributes/factor.gi +453 -0
- gap/pkg/semigroups/gap/attributes/homomorph.gd +84 -0
- gap/pkg/semigroups/gap/attributes/homomorph.gi +591 -0
- gap/pkg/semigroups/gap/attributes/inverse.gd +38 -0
- gap/pkg/semigroups/gap/attributes/inverse.gi +708 -0
- gap/pkg/semigroups/gap/attributes/isomorph.gd +16 -0
- gap/pkg/semigroups/gap/attributes/isomorph.gi +377 -0
- gap/pkg/semigroups/gap/attributes/isorms.gd +49 -0
- gap/pkg/semigroups/gap/attributes/isorms.gi +1383 -0
- gap/pkg/semigroups/gap/attributes/maximal.gd +16 -0
- gap/pkg/semigroups/gap/attributes/maximal.gi +1876 -0
- gap/pkg/semigroups/gap/attributes/properties.gd +109 -0
- gap/pkg/semigroups/gap/attributes/properties.gi +1658 -0
- gap/pkg/semigroups/gap/attributes/rms-translat.gd +39 -0
- gap/pkg/semigroups/gap/attributes/rms-translat.gi +1078 -0
- gap/pkg/semigroups/gap/attributes/semifp.gd +12 -0
- gap/pkg/semigroups/gap/attributes/semifp.gi +84 -0
- gap/pkg/semigroups/gap/attributes/translat.gd +474 -0
- gap/pkg/semigroups/gap/attributes/translat.gi +1779 -0
- gap/pkg/semigroups/gap/congruences/cong.gd +154 -0
- gap/pkg/semigroups/gap/congruences/cong.gi +351 -0
- gap/pkg/semigroups/gap/congruences/conginv.gd +38 -0
- gap/pkg/semigroups/gap/congruences/conginv.gi +589 -0
- gap/pkg/semigroups/gap/congruences/conglatt.gd +101 -0
- gap/pkg/semigroups/gap/congruences/conglatt.gi +886 -0
- gap/pkg/semigroups/gap/congruences/congpairs.gd +21 -0
- gap/pkg/semigroups/gap/congruences/congpairs.gi +272 -0
- gap/pkg/semigroups/gap/congruences/congpart.gd +90 -0
- gap/pkg/semigroups/gap/congruences/congpart.gi +449 -0
- gap/pkg/semigroups/gap/congruences/congrees.gd +20 -0
- gap/pkg/semigroups/gap/congruences/congrees.gi +313 -0
- gap/pkg/semigroups/gap/congruences/congrms.gd +54 -0
- gap/pkg/semigroups/gap/congruences/congrms.gi +1467 -0
- gap/pkg/semigroups/gap/congruences/congsemigraph.gd +28 -0
- gap/pkg/semigroups/gap/congruences/congsemigraph.gi +289 -0
- gap/pkg/semigroups/gap/congruences/congsimple.gd +27 -0
- gap/pkg/semigroups/gap/congruences/congsimple.gi +236 -0
- gap/pkg/semigroups/gap/congruences/conguniv.gd +20 -0
- gap/pkg/semigroups/gap/congruences/conguniv.gi +271 -0
- gap/pkg/semigroups/gap/congruences/congwordgraph.gd +21 -0
- gap/pkg/semigroups/gap/congruences/congwordgraph.gi +250 -0
- gap/pkg/semigroups/gap/elements/bipart.gd +71 -0
- gap/pkg/semigroups/gap/elements/bipart.gi +995 -0
- gap/pkg/semigroups/gap/elements/blocks.gd +31 -0
- gap/pkg/semigroups/gap/elements/blocks.gi +134 -0
- gap/pkg/semigroups/gap/elements/boolmat.gd +74 -0
- gap/pkg/semigroups/gap/elements/boolmat.gi +726 -0
- gap/pkg/semigroups/gap/elements/elements.gd +11 -0
- gap/pkg/semigroups/gap/elements/elements.gi +121 -0
- gap/pkg/semigroups/gap/elements/ffmat.gd +71 -0
- gap/pkg/semigroups/gap/elements/ffmat.gi +311 -0
- gap/pkg/semigroups/gap/elements/maxplusmat.gd +131 -0
- gap/pkg/semigroups/gap/elements/maxplusmat.gi +782 -0
- gap/pkg/semigroups/gap/elements/pbr.gd +51 -0
- gap/pkg/semigroups/gap/elements/pbr.gi +740 -0
- gap/pkg/semigroups/gap/elements/pperm.gd +11 -0
- gap/pkg/semigroups/gap/elements/pperm.gi +14 -0
- gap/pkg/semigroups/gap/elements/semiringmat.gd +136 -0
- gap/pkg/semigroups/gap/elements/semiringmat.gi +717 -0
- gap/pkg/semigroups/gap/elements/star.gd +21 -0
- gap/pkg/semigroups/gap/elements/star.gi +21 -0
- gap/pkg/semigroups/gap/elements/trans.gd +13 -0
- gap/pkg/semigroups/gap/elements/trans.gi +50 -0
- gap/pkg/semigroups/gap/fp/freeband.gd +22 -0
- gap/pkg/semigroups/gap/fp/freeband.gi +502 -0
- gap/pkg/semigroups/gap/fp/freeinverse.gd +30 -0
- gap/pkg/semigroups/gap/fp/freeinverse.gi +465 -0
- gap/pkg/semigroups/gap/fp/tietze.gd +89 -0
- gap/pkg/semigroups/gap/fp/tietze.gi +1578 -0
- gap/pkg/semigroups/gap/fp/word.gd +15 -0
- gap/pkg/semigroups/gap/fp/word.gi +67 -0
- gap/pkg/semigroups/gap/greens/acting-inverse.gi +774 -0
- gap/pkg/semigroups/gap/greens/acting-regular.gi +553 -0
- gap/pkg/semigroups/gap/greens/acting.gd +81 -0
- gap/pkg/semigroups/gap/greens/acting.gi +2433 -0
- gap/pkg/semigroups/gap/greens/froidure-pin.gd +25 -0
- gap/pkg/semigroups/gap/greens/froidure-pin.gi +741 -0
- gap/pkg/semigroups/gap/greens/generic.gd +117 -0
- gap/pkg/semigroups/gap/greens/generic.gi +630 -0
- gap/pkg/semigroups/gap/ideals/acting.gd +17 -0
- gap/pkg/semigroups/gap/ideals/acting.gi +1155 -0
- gap/pkg/semigroups/gap/ideals/froidure-pin.gd +11 -0
- gap/pkg/semigroups/gap/ideals/froidure-pin.gi +105 -0
- gap/pkg/semigroups/gap/ideals/ideals.gd +45 -0
- gap/pkg/semigroups/gap/ideals/ideals.gi +442 -0
- gap/pkg/semigroups/gap/ideals/lambda-rho.gd +16 -0
- gap/pkg/semigroups/gap/ideals/lambda-rho.gi +614 -0
- gap/pkg/semigroups/gap/libsemigroups/cong.gd +24 -0
- gap/pkg/semigroups/gap/libsemigroups/cong.gi +431 -0
- gap/pkg/semigroups/gap/libsemigroups/fpsemi.gd +16 -0
- gap/pkg/semigroups/gap/libsemigroups/fpsemi.gi +53 -0
- gap/pkg/semigroups/gap/libsemigroups/froidure-pin.gd +17 -0
- gap/pkg/semigroups/gap/libsemigroups/froidure-pin.gi +945 -0
- gap/pkg/semigroups/gap/libsemigroups/sims1.gd +38 -0
- gap/pkg/semigroups/gap/libsemigroups/sims1.gi +308 -0
- gap/pkg/semigroups/gap/main/acting.gd +36 -0
- gap/pkg/semigroups/gap/main/acting.gi +779 -0
- gap/pkg/semigroups/gap/main/froidure-pin.gd +72 -0
- gap/pkg/semigroups/gap/main/froidure-pin.gi +655 -0
- gap/pkg/semigroups/gap/main/graded.gd +26 -0
- gap/pkg/semigroups/gap/main/graded.gi +355 -0
- gap/pkg/semigroups/gap/main/lambda-rho.gd +29 -0
- gap/pkg/semigroups/gap/main/lambda-rho.gi +514 -0
- gap/pkg/semigroups/gap/main/orbits.gd +24 -0
- gap/pkg/semigroups/gap/main/orbits.gi +512 -0
- gap/pkg/semigroups/gap/main/semiact.gd +20 -0
- gap/pkg/semigroups/gap/main/semiact.gi +821 -0
- gap/pkg/semigroups/gap/main/setup.gd +61 -0
- gap/pkg/semigroups/gap/main/setup.gi +1094 -0
- gap/pkg/semigroups/gap/obsolete.gd +9 -0
- gap/pkg/semigroups/gap/obsolete.gi +14 -0
- gap/pkg/semigroups/gap/options.g +55 -0
- gap/pkg/semigroups/gap/semigroups/grpperm.gd +12 -0
- gap/pkg/semigroups/gap/semigroups/grpperm.gi +177 -0
- gap/pkg/semigroups/gap/semigroups/semibipart.gd +28 -0
- gap/pkg/semigroups/gap/semigroups/semibipart.gi +570 -0
- gap/pkg/semigroups/gap/semigroups/semiboolmat.gd +20 -0
- gap/pkg/semigroups/gap/semigroups/semiboolmat.gi +104 -0
- gap/pkg/semigroups/gap/semigroups/semicons.gd +52 -0
- gap/pkg/semigroups/gap/semigroups/semicons.gi +1194 -0
- gap/pkg/semigroups/gap/semigroups/semidp.gd +13 -0
- gap/pkg/semigroups/gap/semigroups/semidp.gi +509 -0
- gap/pkg/semigroups/gap/semigroups/semieunit.gd +126 -0
- gap/pkg/semigroups/gap/semigroups/semieunit.gi +889 -0
- gap/pkg/semigroups/gap/semigroups/semiex.gd +104 -0
- gap/pkg/semigroups/gap/semigroups/semiex.gi +1590 -0
- gap/pkg/semigroups/gap/semigroups/semiffmat.gd +37 -0
- gap/pkg/semigroups/gap/semigroups/semiffmat.gi +565 -0
- gap/pkg/semigroups/gap/semigroups/semifp.gd +28 -0
- gap/pkg/semigroups/gap/semigroups/semifp.gi +1364 -0
- gap/pkg/semigroups/gap/semigroups/semigraph.gd +40 -0
- gap/pkg/semigroups/gap/semigroups/semigraph.gi +292 -0
- gap/pkg/semigroups/gap/semigroups/semigrp.gd +165 -0
- gap/pkg/semigroups/gap/semigroups/semigrp.gi +1225 -0
- gap/pkg/semigroups/gap/semigroups/semimaxplus.gd +72 -0
- gap/pkg/semigroups/gap/semigroups/semimaxplus.gi +710 -0
- gap/pkg/semigroups/gap/semigroups/semintmat.gd +13 -0
- gap/pkg/semigroups/gap/semigroups/semintmat.gi +74 -0
- gap/pkg/semigroups/gap/semigroups/semipbr.gd +19 -0
- gap/pkg/semigroups/gap/semigroups/semipbr.gi +139 -0
- gap/pkg/semigroups/gap/semigroups/semipperm.gd +27 -0
- gap/pkg/semigroups/gap/semigroups/semipperm.gi +711 -0
- gap/pkg/semigroups/gap/semigroups/semiquo.gd +14 -0
- gap/pkg/semigroups/gap/semigroups/semiquo.gi +97 -0
- gap/pkg/semigroups/gap/semigroups/semiringmat.gd +16 -0
- gap/pkg/semigroups/gap/semigroups/semiringmat.gi +21 -0
- gap/pkg/semigroups/gap/semigroups/semirms.gd +19 -0
- gap/pkg/semigroups/gap/semigroups/semirms.gi +977 -0
- gap/pkg/semigroups/gap/semigroups/semitrans.gd +49 -0
- gap/pkg/semigroups/gap/semigroups/semitrans.gi +909 -0
- gap/pkg/semigroups/gap/tools/display.gd +24 -0
- gap/pkg/semigroups/gap/tools/display.gi +749 -0
- gap/pkg/semigroups/gap/tools/io.gd +17 -0
- gap/pkg/semigroups/gap/tools/io.gi +543 -0
- gap/pkg/semigroups/gap/tools/iterators.gd +16 -0
- gap/pkg/semigroups/gap/tools/iterators.gi +253 -0
- gap/pkg/semigroups/gap/tools/utils.gd +19 -0
- gap/pkg/semigroups/gap/tools/utils.gi +756 -0
- gap/pkg/semigroups/gapbind14/.ccls +18 -0
- gap/pkg/semigroups/gapbind14/.clang-format +104 -0
- gap/pkg/semigroups/gapbind14/CPPLINT.cfg +5 -0
- gap/pkg/semigroups/gapbind14/LICENSE +674 -0
- gap/pkg/semigroups/gapbind14/README.md +76 -0
- gap/pkg/semigroups/gapbind14/demo/.gitignore +4 -0
- gap/pkg/semigroups/gapbind14/demo/LICENSE +293 -0
- gap/pkg/semigroups/gapbind14/demo/Makefile.gappkg +220 -0
- gap/pkg/semigroups/gapbind14/demo/Makefile.in +19 -0
- gap/pkg/semigroups/gapbind14/demo/PackageInfo.g +87 -0
- gap/pkg/semigroups/gapbind14/demo/README.md +17 -0
- gap/pkg/semigroups/gapbind14/demo/configure +34 -0
- gap/pkg/semigroups/gapbind14/demo/gap/gapbind_demo.gd +19 -0
- gap/pkg/semigroups/gapbind14/demo/gap/gapbind_demo.gi +10 -0
- gap/pkg/semigroups/gapbind14/demo/init.g +16 -0
- gap/pkg/semigroups/gapbind14/demo/makedoc.g +10 -0
- gap/pkg/semigroups/gapbind14/demo/read.g +6 -0
- gap/pkg/semigroups/gapbind14/demo/src/gapbind_demo.cc +142 -0
- gap/pkg/semigroups/gapbind14/demo/tst/testall.g +12 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/cpp_fn.hpp +223 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/gap_include.hpp +26 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/gapbind14.hpp +445 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/tame_free_fn.hpp +420 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/tame_mem_fn.hpp +556 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/to_cpp.hpp +162 -0
- gap/pkg/semigroups/gapbind14/include/gapbind14/to_gap.hpp +158 -0
- gap/pkg/semigroups/gapbind14/src/.clang-format +108 -0
- gap/pkg/semigroups/gapbind14/src/gapbind14.cpp +334 -0
- gap/pkg/semigroups/init.g +150 -0
- gap/pkg/semigroups/m4/ax_append_flag.m4 +50 -0
- gap/pkg/semigroups/m4/ax_check_compile_flag.m4 +53 -0
- gap/pkg/semigroups/m4/ax_check_hpcombi.m4 +121 -0
- gap/pkg/semigroups/m4/ax_check_libsemigroup.m4 +68 -0
- gap/pkg/semigroups/m4/ax_compare_version.m4 +177 -0
- gap/pkg/semigroups/m4/ax_cxx_compile_stdcxx.m4 +1009 -0
- gap/pkg/semigroups/m4/ax_cxx_compile_stdcxx_14.m4 +34 -0
- gap/pkg/semigroups/m4/ax_prefix_config_h.m4 +203 -0
- gap/pkg/semigroups/m4/ax_pthread.m4 +522 -0
- gap/pkg/semigroups/m4/find_gap.m4 +94 -0
- gap/pkg/semigroups/makedoc.g +153 -0
- gap/pkg/semigroups/prerequisites.sh +62 -0
- gap/pkg/semigroups/read.g +105 -0
- gap/pkg/semigroups/release.toml +6 -0
- gap/pkg/semigroups/tst/extreme/README +2 -0
- gap/pkg/semigroups/tst/extreme/attrinv.tst +703 -0
- gap/pkg/semigroups/tst/extreme/bipart.tst +2803 -0
- gap/pkg/semigroups/tst/extreme/closure.tst +652 -0
- gap/pkg/semigroups/tst/extreme/cong.tst +286 -0
- gap/pkg/semigroups/tst/extreme/conginv.tst +43 -0
- gap/pkg/semigroups/tst/extreme/examples.tst +2449 -0
- gap/pkg/semigroups/tst/extreme/freeband.tst +37 -0
- gap/pkg/semigroups/tst/extreme/greens-acting-regular.tst +27 -0
- gap/pkg/semigroups/tst/extreme/greens-acting.tst +1999 -0
- gap/pkg/semigroups/tst/extreme/ideals.tst +858 -0
- gap/pkg/semigroups/tst/extreme/inverse.tst +1025 -0
- gap/pkg/semigroups/tst/extreme/maximal.tst +856 -0
- gap/pkg/semigroups/tst/extreme/misc.tst +4236 -0
- gap/pkg/semigroups/tst/extreme/monoid_pkg.tst +1488 -0
- gap/pkg/semigroups/tst/extreme/properties.tst +914 -0
- gap/pkg/semigroups/tst/extreme/semibipart.tst +2837 -0
- gap/pkg/semigroups/tst/extreme/semieunit.tst +49 -0
- gap/pkg/semigroups/tst/extreme/semiffmat.tst +353 -0
- gap/pkg/semigroups/tst/extreme/semigroups.tst +245 -0
- gap/pkg/semigroups/tst/extreme/semiiter.tst +58 -0
- gap/pkg/semigroups/tst/extreme/semirms.tst +1091 -0
- gap/pkg/semigroups/tst/extreme/transform.tst +305 -0
- gap/pkg/semigroups/tst/extreme/translat.tst +44 -0
- gap/pkg/semigroups/tst/standard/README +2 -0
- gap/pkg/semigroups/tst/standard/attributes/acting.tst +388 -0
- gap/pkg/semigroups/tst/standard/attributes/attr.tst +2404 -0
- gap/pkg/semigroups/tst/standard/attributes/dual.tst +308 -0
- gap/pkg/semigroups/tst/standard/attributes/factor.tst +629 -0
- gap/pkg/semigroups/tst/standard/attributes/homomorph.tst +1134 -0
- gap/pkg/semigroups/tst/standard/attributes/inverse.tst +1521 -0
- gap/pkg/semigroups/tst/standard/attributes/isomorph.tst +435 -0
- gap/pkg/semigroups/tst/standard/attributes/isorms.tst +1147 -0
- gap/pkg/semigroups/tst/standard/attributes/maximal.tst +853 -0
- gap/pkg/semigroups/tst/standard/attributes/properties.tst +2028 -0
- gap/pkg/semigroups/tst/standard/attributes/semifp.tst +53 -0
- gap/pkg/semigroups/tst/standard/attributes/translat.tst +796 -0
- gap/pkg/semigroups/tst/standard/congruences/cong.tst +1044 -0
- gap/pkg/semigroups/tst/standard/congruences/conginv.tst +292 -0
- gap/pkg/semigroups/tst/standard/congruences/conglatt.tst +421 -0
- gap/pkg/semigroups/tst/standard/congruences/congpairs.tst +1011 -0
- gap/pkg/semigroups/tst/standard/congruences/congrees.tst +288 -0
- gap/pkg/semigroups/tst/standard/congruences/congrms.tst +701 -0
- gap/pkg/semigroups/tst/standard/congruences/congsemigraph.tst +422 -0
- gap/pkg/semigroups/tst/standard/congruences/congsimple.tst +311 -0
- gap/pkg/semigroups/tst/standard/congruences/conguniv.tst +259 -0
- gap/pkg/semigroups/tst/standard/congruences/congwordgraph.tst +330 -0
- gap/pkg/semigroups/tst/standard/elements/bipart.tst +783 -0
- gap/pkg/semigroups/tst/standard/elements/blocks.tst +166 -0
- gap/pkg/semigroups/tst/standard/elements/boolmat.tst +608 -0
- gap/pkg/semigroups/tst/standard/elements/elements.tst +117 -0
- gap/pkg/semigroups/tst/standard/elements/ffmat.tst +349 -0
- gap/pkg/semigroups/tst/standard/elements/maxplusmat.tst +613 -0
- gap/pkg/semigroups/tst/standard/elements/pbr.tst +506 -0
- gap/pkg/semigroups/tst/standard/elements/pperm.tst +32 -0
- gap/pkg/semigroups/tst/standard/elements/semiringmat.tst +601 -0
- gap/pkg/semigroups/tst/standard/elements/trans.tst +58 -0
- gap/pkg/semigroups/tst/standard/fp/freeband.tst +311 -0
- gap/pkg/semigroups/tst/standard/fp/freeinverse.tst +147 -0
- gap/pkg/semigroups/tst/standard/fp/tietze.tst +780 -0
- gap/pkg/semigroups/tst/standard/fp/word.tst +106 -0
- gap/pkg/semigroups/tst/standard/greens/acting-inverse.tst +545 -0
- gap/pkg/semigroups/tst/standard/greens/acting-regular.tst +396 -0
- gap/pkg/semigroups/tst/standard/greens/acting.tst +2033 -0
- gap/pkg/semigroups/tst/standard/greens/froidure-pin.tst +1831 -0
- gap/pkg/semigroups/tst/standard/greens/generic.tst +1436 -0
- gap/pkg/semigroups/tst/standard/ideals/acting.tst +279 -0
- gap/pkg/semigroups/tst/standard/ideals/froidure-pin.tst +178 -0
- gap/pkg/semigroups/tst/standard/ideals/ideals.tst +380 -0
- gap/pkg/semigroups/tst/standard/libsemigroups/cong.tst +310 -0
- gap/pkg/semigroups/tst/standard/libsemigroups/froidure-pin.tst +778 -0
- gap/pkg/semigroups/tst/standard/libsemigroups/sims1.tst +379 -0
- gap/pkg/semigroups/tst/standard/main/acting.tst +411 -0
- gap/pkg/semigroups/tst/standard/main/froidure-pin.tst +392 -0
- gap/pkg/semigroups/tst/standard/main/semiact.tst +203 -0
- gap/pkg/semigroups/tst/standard/main/setup.tst +1144 -0
- gap/pkg/semigroups/tst/standard/obsolete.tst +19 -0
- gap/pkg/semigroups/tst/standard/options.tst +54 -0
- gap/pkg/semigroups/tst/standard/semigroups/grpperm.tst +581 -0
- gap/pkg/semigroups/tst/standard/semigroups/semibipart.tst +2635 -0
- gap/pkg/semigroups/tst/standard/semigroups/semiboolmat.tst +1871 -0
- gap/pkg/semigroups/tst/standard/semigroups/semicons.tst +1173 -0
- gap/pkg/semigroups/tst/standard/semigroups/semidp.tst +739 -0
- gap/pkg/semigroups/tst/standard/semigroups/semieunit.tst +339 -0
- gap/pkg/semigroups/tst/standard/semigroups/semiex.tst +2055 -0
- gap/pkg/semigroups/tst/standard/semigroups/semiffmat.tst +746 -0
- gap/pkg/semigroups/tst/standard/semigroups/semifp.tst +2702 -0
- gap/pkg/semigroups/tst/standard/semigroups/semigraph.tst +133 -0
- gap/pkg/semigroups/tst/standard/semigroups/semigrp.tst +1112 -0
- gap/pkg/semigroups/tst/standard/semigroups/semimaxplus.tst +654 -0
- gap/pkg/semigroups/tst/standard/semigroups/semipbr.tst +2142 -0
- gap/pkg/semigroups/tst/standard/semigroups/semipperm.tst +2169 -0
- gap/pkg/semigroups/tst/standard/semigroups/semiquo.tst +278 -0
- gap/pkg/semigroups/tst/standard/semigroups/semirms.tst +3010 -0
- gap/pkg/semigroups/tst/standard/semigroups/semitrans.tst +2758 -0
- gap/pkg/semigroups/tst/standard/tools/display.tst +1040 -0
- gap/pkg/semigroups/tst/standard/tools/io.tst +363 -0
- gap/pkg/semigroups/tst/testinstall.tst +1815 -0
- gap/pkg/semigroups/tst/teststandard.g +22 -0
- gap/pkg/semigroups/tst/workspaces/load-workspace.tst +142 -0
- gap/pkg/semigroups/tst/workspaces/load.g +11 -0
- gap/pkg/semigroups/tst/workspaces/save-workspace.tst +166 -0
- gap/pkg/semigroups/tst/workspaces/save.g +14 -0
- passagemath_gap_pkg_semigroups-10.6.29.dist-info/METADATA +93 -0
- passagemath_gap_pkg_semigroups-10.6.29.dist-info/METADATA.bak +94 -0
- passagemath_gap_pkg_semigroups-10.6.29.dist-info/RECORD +354 -0
- passagemath_gap_pkg_semigroups-10.6.29.dist-info/WHEEL +6 -0
- passagemath_gap_pkg_semigroups-10.6.29.dist-info/top_level.txt +1 -0
- passagemath_gap_pkg_semigroups.libs/libsemigroups-6be12ad2.so.2.0.0 +0 -0
- sage/all__sagemath_gap_pkg_semigroups.py +1 -0
- sage/libs/all__sagemath_gap_pkg_semigroups.py +1 -0
- sage/libs/gap_pkg_semigroups.abi3.so +0 -0
|
@@ -0,0 +1,782 @@
|
|
|
1
|
+
############################################################################
|
|
2
|
+
##
|
|
3
|
+
## elements/maxplusmat.gi
|
|
4
|
+
## Copyright (C) 2015-2022 James D. Mitchell
|
|
5
|
+
##
|
|
6
|
+
## Licensing information can be found in the README file of this package.
|
|
7
|
+
##
|
|
8
|
+
#############################################################################
|
|
9
|
+
##
|
|
10
|
+
|
|
11
|
+
#############################################################################
|
|
12
|
+
## This file contains declarations for max-plus, min-plus, tropical max-plus,
|
|
13
|
+
## tropical min-plus matrices, projective.
|
|
14
|
+
##
|
|
15
|
+
## It is organized as follows:
|
|
16
|
+
##
|
|
17
|
+
## 1. Max-plus matrices
|
|
18
|
+
##
|
|
19
|
+
## 2. Min-plus matrices
|
|
20
|
+
##
|
|
21
|
+
## 3. Tropical matrices
|
|
22
|
+
##
|
|
23
|
+
## 4. Tropical max-plus matrices
|
|
24
|
+
##
|
|
25
|
+
## 5. Tropical min-plus matrices
|
|
26
|
+
##
|
|
27
|
+
## 6. Projective max-plus matrices
|
|
28
|
+
##
|
|
29
|
+
## 7. NTP matrices
|
|
30
|
+
##
|
|
31
|
+
## 8. Integer matrices TODO(later) remove integer matrix stuff to its own
|
|
32
|
+
## file
|
|
33
|
+
##
|
|
34
|
+
#############################################################################
|
|
35
|
+
|
|
36
|
+
SEMIGROUPS.PlusMinMax := function(x, y)
|
|
37
|
+
if x = infinity or y = infinity then
|
|
38
|
+
return infinity;
|
|
39
|
+
elif x = -infinity or y = -infinity then
|
|
40
|
+
return -infinity;
|
|
41
|
+
fi;
|
|
42
|
+
return x + y;
|
|
43
|
+
end;
|
|
44
|
+
|
|
45
|
+
SEMIGROUPS.IdentityMat := function(x, zero, one)
|
|
46
|
+
local n, id, i;
|
|
47
|
+
n := Length(x![1]);
|
|
48
|
+
id := List([1 .. n], x -> [1 .. n] * zero);
|
|
49
|
+
for i in [1 .. n] do
|
|
50
|
+
id[i][i] := one;
|
|
51
|
+
od;
|
|
52
|
+
return id;
|
|
53
|
+
end;
|
|
54
|
+
|
|
55
|
+
SEMIGROUPS.RandomIntegerMatrix := function(n, source)
|
|
56
|
+
local out, i, j;
|
|
57
|
+
|
|
58
|
+
out := List([1 .. n], x -> EmptyPlist(n));
|
|
59
|
+
for i in [1 .. n] do
|
|
60
|
+
for j in [1 .. n] do
|
|
61
|
+
out[i][j] := Random(Integers);
|
|
62
|
+
if out[i][j] = 0 and source <> false then
|
|
63
|
+
out[i][j] := source;
|
|
64
|
+
elif out[i][j] < 0 then
|
|
65
|
+
out[i][j] := out[i][j] + 1;
|
|
66
|
+
fi;
|
|
67
|
+
od;
|
|
68
|
+
od;
|
|
69
|
+
return out;
|
|
70
|
+
end;
|
|
71
|
+
|
|
72
|
+
#############################################################################
|
|
73
|
+
## 1. Max-plus matrices
|
|
74
|
+
#############################################################################
|
|
75
|
+
|
|
76
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
77
|
+
"for a max-plus matrix",
|
|
78
|
+
[IsMaxPlusMatrix], x -> "max-plus");
|
|
79
|
+
|
|
80
|
+
InstallMethod(SEMIGROUPS_FilterOfMatrixOverSemiring,
|
|
81
|
+
"for a max-plus matrix",
|
|
82
|
+
[IsMaxPlusMatrix], x -> IsMaxPlusMatrix);
|
|
83
|
+
|
|
84
|
+
InstallMethod(SEMIGROUPS_TypeOfMatrixOverSemiringCons, "for IsMaxPlusMatrix",
|
|
85
|
+
[IsMaxPlusMatrix], x -> MaxPlusMatrixType);
|
|
86
|
+
|
|
87
|
+
InstallMethod(SEMIGROUPS_MatrixOverSemiringEntryCheckerCons,
|
|
88
|
+
"for IsMaxPlusMatrix", [IsMaxPlusMatrix],
|
|
89
|
+
{_} -> x -> IsInt(x) or x = -infinity);
|
|
90
|
+
|
|
91
|
+
InstallMethod(\*, "for max-plus matrices", [IsMaxPlusMatrix, IsMaxPlusMatrix],
|
|
92
|
+
function(x, y)
|
|
93
|
+
local n, xy, val, i, j, k, PlusMinMax;
|
|
94
|
+
|
|
95
|
+
n := Minimum(Length(x![1]), Length(y![1]));
|
|
96
|
+
|
|
97
|
+
xy := List([1 .. n], x -> EmptyPlist(n));
|
|
98
|
+
PlusMinMax := SEMIGROUPS.PlusMinMax;
|
|
99
|
+
|
|
100
|
+
for i in [1 .. n] do
|
|
101
|
+
for j in [1 .. n] do
|
|
102
|
+
val := -infinity;
|
|
103
|
+
for k in [1 .. n] do
|
|
104
|
+
val := Maximum(val, PlusMinMax(x![i][k], y![k][j]));
|
|
105
|
+
od;
|
|
106
|
+
xy[i][j] := val;
|
|
107
|
+
od;
|
|
108
|
+
od;
|
|
109
|
+
return MatrixNC(x, xy);
|
|
110
|
+
end);
|
|
111
|
+
|
|
112
|
+
InstallMethod(OneImmutable, "for a max-plus matrix",
|
|
113
|
+
[IsMaxPlusMatrix],
|
|
114
|
+
x -> MatrixNC(x, SEMIGROUPS.IdentityMat(x, -infinity, 0)));
|
|
115
|
+
|
|
116
|
+
InstallMethod(RandomMatrixCons, "for IsMaxPlusMatrix and pos int",
|
|
117
|
+
[IsMaxPlusMatrix, IsPosInt],
|
|
118
|
+
function(filter, n)
|
|
119
|
+
return MatrixNC(filter,
|
|
120
|
+
SEMIGROUPS.RandomIntegerMatrix(n, -infinity));
|
|
121
|
+
end);
|
|
122
|
+
|
|
123
|
+
InstallMethod(AsMatrix,
|
|
124
|
+
"for IsMaxPlusMatrix and a tropical max-plus matrix",
|
|
125
|
+
[IsMaxPlusMatrix, IsTropicalMaxPlusMatrix],
|
|
126
|
+
{filter, mat} -> MatrixNC(filter, AsList(mat)));
|
|
127
|
+
|
|
128
|
+
InstallMethod(AsMatrix,
|
|
129
|
+
"for IsMaxPlusMatrix and a projective max-plus matrix",
|
|
130
|
+
[IsMaxPlusMatrix, IsProjectiveMaxPlusMatrix],
|
|
131
|
+
{filter, mat} -> MatrixNC(filter, AsList(mat)));
|
|
132
|
+
|
|
133
|
+
InstallMethod(AsMatrix,
|
|
134
|
+
"for IsMaxPlusMatrix, transformation",
|
|
135
|
+
[IsMaxPlusMatrix, IsTransformation],
|
|
136
|
+
{filter, x} -> AsMatrix(filter, x, DegreeOfTransformation(x)));
|
|
137
|
+
|
|
138
|
+
InstallMethod(AsMatrix,
|
|
139
|
+
"for IsMaxPlusMatrix, transformation, pos int",
|
|
140
|
+
[IsMaxPlusMatrix, IsTransformation, IsPosInt],
|
|
141
|
+
{filter, x, dim}
|
|
142
|
+
-> MatrixNC(filter, SEMIGROUPS.MatrixTrans(x, dim, -infinity, 0)));
|
|
143
|
+
|
|
144
|
+
## Method based on theorem 2, page 19, of:
|
|
145
|
+
## K.G. Farlow, Max-plus Algebra, Thesis.
|
|
146
|
+
## https://tinyurl.com/zzs38s4
|
|
147
|
+
|
|
148
|
+
InstallMethod(InverseOp, "for a max-plus matrix", [IsMaxPlusMatrix],
|
|
149
|
+
function(mat)
|
|
150
|
+
local dim, seen_rows, seen_cols, out, row, col;
|
|
151
|
+
dim := DimensionOfMatrixOverSemiring(mat);
|
|
152
|
+
seen_rows := BlistList([1 .. dim], []);
|
|
153
|
+
seen_cols := BlistList([1 .. dim], []);
|
|
154
|
+
out := List([1 .. dim], x -> List([1 .. dim], y -> -infinity));
|
|
155
|
+
for row in [1 .. dim] do
|
|
156
|
+
for col in [1 .. dim] do
|
|
157
|
+
if mat[row][col] <> -infinity then
|
|
158
|
+
if seen_rows[row] or seen_cols[col] then
|
|
159
|
+
return fail;
|
|
160
|
+
fi;
|
|
161
|
+
seen_rows[row] := true;
|
|
162
|
+
seen_cols[col] := true;
|
|
163
|
+
out[col][row] := -mat[row][col];
|
|
164
|
+
fi;
|
|
165
|
+
od;
|
|
166
|
+
od;
|
|
167
|
+
return Matrix(IsMaxPlusMatrix, out);
|
|
168
|
+
end);
|
|
169
|
+
|
|
170
|
+
## Method from lemma 3.1, page 3, in:
|
|
171
|
+
## S. Gaubert, On the burnside problem for semigroups of matrices in the
|
|
172
|
+
## (max, +) algebra, Semigroup Forum, Volume 52, pp 271-292, 1996.
|
|
173
|
+
## https://tinyurl.com/znhk52m
|
|
174
|
+
|
|
175
|
+
InstallMethod(SpectralRadius, "for a max-plus matrix", [IsMaxPlusMatrix],
|
|
176
|
+
function(mat)
|
|
177
|
+
local dim, cm, mk, k, max;
|
|
178
|
+
# Check for -infinity case
|
|
179
|
+
if IsEmpty(DigraphAllSimpleCircuits(UnweightedPrecedenceDigraph(mat))) then
|
|
180
|
+
return -infinity;
|
|
181
|
+
fi;
|
|
182
|
+
# Calculate the maximum cycle mean.
|
|
183
|
+
dim := Length(AsList(mat)[1]);
|
|
184
|
+
cm := [];
|
|
185
|
+
mk := mat;
|
|
186
|
+
for k in [1 .. dim] do
|
|
187
|
+
max := Maximum(List([1 .. dim], x -> mk[x][x]));
|
|
188
|
+
if max <> -infinity then
|
|
189
|
+
Add(cm, max / k);
|
|
190
|
+
fi;
|
|
191
|
+
mk := mk * mat;
|
|
192
|
+
od;
|
|
193
|
+
return Maximum(cm);
|
|
194
|
+
end);
|
|
195
|
+
|
|
196
|
+
InstallMethod(UnweightedPrecedenceDigraph, "for a max-plus matrix",
|
|
197
|
+
[IsMaxPlusMatrix],
|
|
198
|
+
function(mat)
|
|
199
|
+
# Generate and return digraph object
|
|
200
|
+
return Digraph([1 .. DimensionOfMatrixOverSemiring(mat)],
|
|
201
|
+
{i, j} -> mat[i][j] <> -infinity);
|
|
202
|
+
end);
|
|
203
|
+
|
|
204
|
+
## Method from lemma 19, page 36, of:
|
|
205
|
+
## K.G. Farlow, Max-plus Algebra, Thesis.
|
|
206
|
+
## https://tinyurl.com/zzs38s4
|
|
207
|
+
|
|
208
|
+
InstallMethod(RadialEigenvector, "for a max-plus matrix", [IsMaxPlusMatrix],
|
|
209
|
+
function(m)
|
|
210
|
+
local dim, pows, crit, out, n, i, k;
|
|
211
|
+
|
|
212
|
+
dim := DimensionOfMatrixOverSemiring(m);
|
|
213
|
+
# Method only valid for SpectralRadius = 0.
|
|
214
|
+
if SpectralRadius(m) <> 0 then
|
|
215
|
+
TryNextMethod();
|
|
216
|
+
fi;
|
|
217
|
+
|
|
218
|
+
pows := List([1 .. 2 * dim], k -> m ^ k);
|
|
219
|
+
|
|
220
|
+
# Find first power of <m> with 0 in the diagonal and find the position of 0
|
|
221
|
+
# in the diagonal
|
|
222
|
+
for n in pows do
|
|
223
|
+
crit := Position(List([1 .. dim], i -> n[i][i]), 0);
|
|
224
|
+
if crit <> fail then
|
|
225
|
+
break;
|
|
226
|
+
fi;
|
|
227
|
+
od;
|
|
228
|
+
|
|
229
|
+
out := [1 .. dim] * -infinity;
|
|
230
|
+
|
|
231
|
+
for i in [1 .. dim] do
|
|
232
|
+
for k in [1 .. 2 * dim] do
|
|
233
|
+
if pows[k][i][crit] > out[i] then
|
|
234
|
+
out[i] := pows[k][i][crit];
|
|
235
|
+
fi;
|
|
236
|
+
od;
|
|
237
|
+
od;
|
|
238
|
+
|
|
239
|
+
if out[crit] < 0 then
|
|
240
|
+
out[crit] := 0;
|
|
241
|
+
fi;
|
|
242
|
+
|
|
243
|
+
return out;
|
|
244
|
+
end);
|
|
245
|
+
|
|
246
|
+
#############################################################################
|
|
247
|
+
## 2. Min-plus matrices
|
|
248
|
+
#############################################################################
|
|
249
|
+
|
|
250
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
251
|
+
"for a min-plus matrix",
|
|
252
|
+
[IsMinPlusMatrix], x -> "min-plus");
|
|
253
|
+
|
|
254
|
+
InstallMethod(SEMIGROUPS_FilterOfMatrixOverSemiring,
|
|
255
|
+
"for a min-plus matrix",
|
|
256
|
+
[IsMinPlusMatrix], x -> IsMinPlusMatrix);
|
|
257
|
+
|
|
258
|
+
InstallMethod(SEMIGROUPS_TypeOfMatrixOverSemiringCons, "for IsMinPlusMatrix",
|
|
259
|
+
[IsMinPlusMatrix], x -> MinPlusMatrixType);
|
|
260
|
+
|
|
261
|
+
InstallMethod(SEMIGROUPS_MatrixOverSemiringEntryCheckerCons,
|
|
262
|
+
"for IsMinPlusMatrix", [IsMinPlusMatrix],
|
|
263
|
+
{filter} -> x -> IsInt(x) or x = infinity);
|
|
264
|
+
|
|
265
|
+
InstallMethod(\*, "for min-plus matrices", [IsMinPlusMatrix, IsMinPlusMatrix],
|
|
266
|
+
function(x, y)
|
|
267
|
+
local n, xy, val, i, j, k, PlusMinMax;
|
|
268
|
+
|
|
269
|
+
n := Minimum(Length(x![1]), Length(y![1]));
|
|
270
|
+
|
|
271
|
+
xy := List([1 .. n], x -> EmptyPlist(n));
|
|
272
|
+
PlusMinMax := SEMIGROUPS.PlusMinMax;
|
|
273
|
+
|
|
274
|
+
for i in [1 .. n] do
|
|
275
|
+
for j in [1 .. n] do
|
|
276
|
+
val := infinity;
|
|
277
|
+
for k in [1 .. n] do
|
|
278
|
+
val := Minimum(val, PlusMinMax(x![i][k], y![k][j]));
|
|
279
|
+
od;
|
|
280
|
+
xy[i][j] := val;
|
|
281
|
+
od;
|
|
282
|
+
od;
|
|
283
|
+
return MatrixNC(x, xy);
|
|
284
|
+
end);
|
|
285
|
+
|
|
286
|
+
InstallMethod(OneImmutable, "for a min-plus matrix",
|
|
287
|
+
[IsMinPlusMatrix],
|
|
288
|
+
x -> MatrixNC(x, SEMIGROUPS.IdentityMat(x, infinity, 0)));
|
|
289
|
+
|
|
290
|
+
InstallMethod(RandomMatrixCons, "for IsMinPlusMatrix and pos int",
|
|
291
|
+
[IsMinPlusMatrix, IsPosInt],
|
|
292
|
+
function(filter, n)
|
|
293
|
+
return MatrixNC(filter,
|
|
294
|
+
SEMIGROUPS.RandomIntegerMatrix(n, infinity));
|
|
295
|
+
end);
|
|
296
|
+
|
|
297
|
+
InstallMethod(AsMatrix,
|
|
298
|
+
"for IsMinPlusMatrix and a tropical min-plus matrix",
|
|
299
|
+
[IsMinPlusMatrix, IsTropicalMinPlusMatrix],
|
|
300
|
+
{filter, mat} -> MatrixNC(filter, AsList(mat)));
|
|
301
|
+
|
|
302
|
+
InstallMethod(AsMatrix,
|
|
303
|
+
"for IsMinPlusMatrix, transformation",
|
|
304
|
+
[IsMinPlusMatrix, IsTransformation],
|
|
305
|
+
{filter, x} -> AsMatrix(filter, x, DegreeOfTransformation(x)));
|
|
306
|
+
|
|
307
|
+
InstallMethod(AsMatrix,
|
|
308
|
+
"for IsMinPlusMatrix, transformation, pos int",
|
|
309
|
+
[IsMinPlusMatrix, IsTransformation, IsPosInt],
|
|
310
|
+
{filter, x, dim}
|
|
311
|
+
-> MatrixNC(filter, SEMIGROUPS.MatrixTrans(x, dim, infinity, 0)));
|
|
312
|
+
|
|
313
|
+
#############################################################################
|
|
314
|
+
## 3. Tropical matrices
|
|
315
|
+
#############################################################################
|
|
316
|
+
|
|
317
|
+
InstallMethod(ThresholdTropicalMatrix, "for a tropical matrix",
|
|
318
|
+
[IsTropicalMatrix], x -> x![Length(x![1]) + 1]);
|
|
319
|
+
|
|
320
|
+
#############################################################################
|
|
321
|
+
## 4. Tropical max-plus matrices
|
|
322
|
+
#############################################################################
|
|
323
|
+
|
|
324
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
325
|
+
"for a tropical max-plus matrix",
|
|
326
|
+
[IsTropicalMaxPlusMatrix], x -> "tropical max-plus");
|
|
327
|
+
|
|
328
|
+
InstallMethod(SEMIGROUPS_FilterOfMatrixOverSemiring,
|
|
329
|
+
"for a tropical max-plus matrix",
|
|
330
|
+
[IsTropicalMaxPlusMatrix], x -> IsTropicalMaxPlusMatrix);
|
|
331
|
+
|
|
332
|
+
InstallMethod(SEMIGROUPS_TypeOfMatrixOverSemiringCons,
|
|
333
|
+
"for IsTropicalMaxPlusMatrix",
|
|
334
|
+
[IsTropicalMaxPlusMatrix], x -> TropicalMaxPlusMatrixType);
|
|
335
|
+
|
|
336
|
+
InstallMethod(SEMIGROUPS_MatrixOverSemiringEntryCheckerCons,
|
|
337
|
+
"for IsTropicalMaxPlusMatrix and pos int",
|
|
338
|
+
[IsTropicalMaxPlusMatrix, IsPosInt],
|
|
339
|
+
{filter, threshold}
|
|
340
|
+
-> x -> (IsInt(x) and x >= 0 and x <= threshold) or x = -infinity);
|
|
341
|
+
|
|
342
|
+
InstallMethod(\*, "for tropical max-plus matrices",
|
|
343
|
+
[IsTropicalMaxPlusMatrix, IsTropicalMaxPlusMatrix],
|
|
344
|
+
function(x, y)
|
|
345
|
+
local n, threshold, xy, PlusMinMax, val, i, j, k;
|
|
346
|
+
|
|
347
|
+
n := Minimum(Length(x![1]), Length(y![1]));
|
|
348
|
+
threshold := ThresholdTropicalMatrix(x);
|
|
349
|
+
if threshold <> ThresholdTropicalMatrix(y) then
|
|
350
|
+
ErrorNoReturn("the arguments (tropical max-plus matrices)",
|
|
351
|
+
"do not have the same threshold");
|
|
352
|
+
fi;
|
|
353
|
+
xy := List([1 .. n], x -> EmptyPlist(n));
|
|
354
|
+
PlusMinMax := SEMIGROUPS.PlusMinMax;
|
|
355
|
+
|
|
356
|
+
for i in [1 .. n] do
|
|
357
|
+
for j in [1 .. n] do
|
|
358
|
+
val := -infinity;
|
|
359
|
+
for k in [1 .. n] do
|
|
360
|
+
val := Maximum(val, PlusMinMax(x![i][k], y![k][j]));
|
|
361
|
+
od;
|
|
362
|
+
if val > threshold then
|
|
363
|
+
val := threshold;
|
|
364
|
+
fi;
|
|
365
|
+
xy[i][j] := val;
|
|
366
|
+
od;
|
|
367
|
+
od;
|
|
368
|
+
return MatrixNC(x, xy);
|
|
369
|
+
end);
|
|
370
|
+
|
|
371
|
+
InstallMethod(OneImmutable, "for a tropical max-plus matrix",
|
|
372
|
+
[IsTropicalMaxPlusMatrix],
|
|
373
|
+
x -> MatrixNC(x, SEMIGROUPS.IdentityMat(x, -infinity, 0)));
|
|
374
|
+
|
|
375
|
+
InstallMethod(RandomMatrixCons,
|
|
376
|
+
"for IsTropicalMaxPlusMatrix, pos int, pos int",
|
|
377
|
+
[IsTropicalMaxPlusMatrix, IsPosInt, IsPosInt],
|
|
378
|
+
function(filter, dim, threshold)
|
|
379
|
+
local mat;
|
|
380
|
+
mat := SEMIGROUPS.RandomIntegerMatrix(dim, -infinity);
|
|
381
|
+
mat := SEMIGROUPS.TropicalizeMat(mat, threshold);
|
|
382
|
+
return MatrixNC(filter, mat);
|
|
383
|
+
end);
|
|
384
|
+
|
|
385
|
+
InstallMethod(AsMatrix,
|
|
386
|
+
"for IsTropicalMaxPlusMatrix, max-plus matrix, and pos int",
|
|
387
|
+
[IsTropicalMaxPlusMatrix, IsMaxPlusMatrix, IsPosInt],
|
|
388
|
+
function(filter, mat, threshold)
|
|
389
|
+
return MatrixNC(filter, SEMIGROUPS.TropicalizeMat(AsMutableList(mat),
|
|
390
|
+
threshold));
|
|
391
|
+
end);
|
|
392
|
+
|
|
393
|
+
InstallMethod(AsMatrix,
|
|
394
|
+
"for IsTropicalMaxPlusMatrix, projective max-plus matrix, and pos int",
|
|
395
|
+
[IsTropicalMaxPlusMatrix, IsProjectiveMaxPlusMatrix, IsPosInt],
|
|
396
|
+
function(filter, mat, threshold)
|
|
397
|
+
return MatrixNC(filter, SEMIGROUPS.TropicalizeMat(AsMutableList(mat),
|
|
398
|
+
threshold));
|
|
399
|
+
end);
|
|
400
|
+
|
|
401
|
+
# change the threshold
|
|
402
|
+
|
|
403
|
+
InstallMethod(AsMatrix,
|
|
404
|
+
"for IsTropicalMaxPlusMatrix, max-plus matrix, and pos int",
|
|
405
|
+
[IsTropicalMaxPlusMatrix, IsTropicalMaxPlusMatrix, IsPosInt],
|
|
406
|
+
function(filter, mat, threshold)
|
|
407
|
+
return MatrixNC(filter, SEMIGROUPS.TropicalizeMat(AsMutableList(mat),
|
|
408
|
+
threshold));
|
|
409
|
+
end);
|
|
410
|
+
|
|
411
|
+
InstallMethod(AsMatrix,
|
|
412
|
+
"for IsTropicalMaxPlusMatrix, transformation, IsPosInt",
|
|
413
|
+
[IsTropicalMaxPlusMatrix, IsTransformation, IsPosInt],
|
|
414
|
+
{filter, x, threshold}
|
|
415
|
+
-> AsMatrix(filter, x, DegreeOfTransformation(x), threshold));
|
|
416
|
+
|
|
417
|
+
InstallMethod(AsMatrix,
|
|
418
|
+
"for IsTropicalMaxPlusMatrix, transformation, pos int, pos int",
|
|
419
|
+
[IsTropicalMaxPlusMatrix, IsTransformation, IsPosInt, IsPosInt],
|
|
420
|
+
function(filter, x, dim, threshold)
|
|
421
|
+
local mat;
|
|
422
|
+
mat := SEMIGROUPS.MatrixTrans(x, dim, -infinity, 0);
|
|
423
|
+
return MatrixNC(filter,
|
|
424
|
+
SEMIGROUPS.TropicalizeMat(mat, threshold));
|
|
425
|
+
end);
|
|
426
|
+
|
|
427
|
+
#############################################################################
|
|
428
|
+
## 5. Tropical min-plus matrices
|
|
429
|
+
#############################################################################
|
|
430
|
+
|
|
431
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
432
|
+
"for a tropical min-plus matrix",
|
|
433
|
+
[IsTropicalMinPlusMatrix], x -> "tropical min-plus");
|
|
434
|
+
|
|
435
|
+
InstallMethod(SEMIGROUPS_FilterOfMatrixOverSemiring,
|
|
436
|
+
"for a tropical min-plus matrix",
|
|
437
|
+
[IsTropicalMinPlusMatrix], x -> IsTropicalMinPlusMatrix);
|
|
438
|
+
|
|
439
|
+
InstallMethod(SEMIGROUPS_TypeOfMatrixOverSemiringCons,
|
|
440
|
+
"for IsTropicalMinPlusMatrix",
|
|
441
|
+
[IsTropicalMinPlusMatrix], x -> TropicalMinPlusMatrixType);
|
|
442
|
+
|
|
443
|
+
InstallMethod(SEMIGROUPS_MatrixOverSemiringEntryCheckerCons,
|
|
444
|
+
"for IsTropicalMinPlusMatrix and pos int",
|
|
445
|
+
[IsTropicalMinPlusMatrix, IsPosInt],
|
|
446
|
+
{filter, threshold}
|
|
447
|
+
-> x -> (IsInt(x) and x >= 0 and x <= threshold) or x = infinity);
|
|
448
|
+
|
|
449
|
+
InstallMethod(\*, "for tropical min-plus matrices",
|
|
450
|
+
[IsTropicalMinPlusMatrix, IsTropicalMinPlusMatrix],
|
|
451
|
+
function(x, y)
|
|
452
|
+
local n, threshold, xy, PlusMinMax, val, i, j, k;
|
|
453
|
+
|
|
454
|
+
n := Minimum(Length(x![1]), Length(y![1]));
|
|
455
|
+
threshold := ThresholdTropicalMatrix(x);
|
|
456
|
+
if threshold <> ThresholdTropicalMatrix(y) then
|
|
457
|
+
ErrorNoReturn("the arguments (tropical min-plus matrices) ",
|
|
458
|
+
"do not have the same threshold");
|
|
459
|
+
fi;
|
|
460
|
+
|
|
461
|
+
xy := List([1 .. n], x -> EmptyPlist(n));
|
|
462
|
+
PlusMinMax := SEMIGROUPS.PlusMinMax;
|
|
463
|
+
|
|
464
|
+
for i in [1 .. n] do
|
|
465
|
+
for j in [1 .. n] do
|
|
466
|
+
val := infinity;
|
|
467
|
+
for k in [1 .. n] do
|
|
468
|
+
val := Minimum(val, PlusMinMax(x![i][k], y![k][j]));
|
|
469
|
+
od;
|
|
470
|
+
if val <> infinity and val > threshold then
|
|
471
|
+
val := threshold;
|
|
472
|
+
fi;
|
|
473
|
+
xy[i][j] := val;
|
|
474
|
+
od;
|
|
475
|
+
od;
|
|
476
|
+
return MatrixNC(x, xy);
|
|
477
|
+
end);
|
|
478
|
+
|
|
479
|
+
InstallMethod(OneImmutable, "for a tropical min-plus matrix",
|
|
480
|
+
[IsTropicalMinPlusMatrix],
|
|
481
|
+
x -> MatrixNC(x, SEMIGROUPS.IdentityMat(x, infinity, 0)));
|
|
482
|
+
|
|
483
|
+
InstallMethod(RandomMatrixCons,
|
|
484
|
+
"for IsTropicalMinPlusMatrix, pos int, pos int",
|
|
485
|
+
[IsTropicalMinPlusMatrix, IsPosInt, IsPosInt],
|
|
486
|
+
function(filter, dim, threshold)
|
|
487
|
+
local mat;
|
|
488
|
+
mat := SEMIGROUPS.RandomIntegerMatrix(dim, infinity);
|
|
489
|
+
mat := SEMIGROUPS.TropicalizeMat(mat, threshold);
|
|
490
|
+
return MatrixNC(filter, mat);
|
|
491
|
+
end);
|
|
492
|
+
|
|
493
|
+
InstallMethod(AsMatrix,
|
|
494
|
+
"for IsTropicalMinPlusMatrix, min-plus matrix, and pos int",
|
|
495
|
+
[IsTropicalMinPlusMatrix, IsMinPlusMatrix, IsPosInt],
|
|
496
|
+
function(filter, mat, threshold)
|
|
497
|
+
return MatrixNC(filter, SEMIGROUPS.TropicalizeMat(AsMutableList(mat),
|
|
498
|
+
threshold));
|
|
499
|
+
end);
|
|
500
|
+
|
|
501
|
+
# change the threshold
|
|
502
|
+
|
|
503
|
+
InstallMethod(AsMatrix,
|
|
504
|
+
"for IsTropicalMinPlusMatrix, min-plus matrix, and pos int",
|
|
505
|
+
[IsTropicalMinPlusMatrix, IsTropicalMinPlusMatrix, IsPosInt],
|
|
506
|
+
function(filter, mat, threshold)
|
|
507
|
+
return MatrixNC(filter, SEMIGROUPS.TropicalizeMat(AsMutableList(mat),
|
|
508
|
+
threshold));
|
|
509
|
+
end);
|
|
510
|
+
|
|
511
|
+
InstallMethod(AsMatrix,
|
|
512
|
+
"for IsTropicalMinPlusMatrix, transformation, IsPosInt",
|
|
513
|
+
[IsTropicalMinPlusMatrix, IsTransformation, IsPosInt],
|
|
514
|
+
{filter, x, threshold}
|
|
515
|
+
-> AsMatrix(filter, x, DegreeOfTransformation(x), threshold));
|
|
516
|
+
|
|
517
|
+
InstallMethod(AsMatrix,
|
|
518
|
+
"for IsTropicalMinPlusMatrix, transformation, pos int, pos int",
|
|
519
|
+
[IsTropicalMinPlusMatrix, IsTransformation, IsPosInt, IsPosInt],
|
|
520
|
+
function(filter, x, dim, threshold)
|
|
521
|
+
local mat;
|
|
522
|
+
mat := SEMIGROUPS.MatrixTrans(x, dim, infinity, 0);
|
|
523
|
+
return MatrixNC(filter,
|
|
524
|
+
SEMIGROUPS.TropicalizeMat(mat, threshold));
|
|
525
|
+
end);
|
|
526
|
+
|
|
527
|
+
#############################################################################
|
|
528
|
+
## 6. Projective max-plus matrices
|
|
529
|
+
#############################################################################
|
|
530
|
+
|
|
531
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
532
|
+
"for a projective max-plus matrix",
|
|
533
|
+
[IsProjectiveMaxPlusMatrix], x -> "projective max-plus");
|
|
534
|
+
|
|
535
|
+
InstallMethod(SEMIGROUPS_FilterOfMatrixOverSemiring,
|
|
536
|
+
"for a projective max-plus matrix",
|
|
537
|
+
[IsProjectiveMaxPlusMatrix], x -> IsProjectiveMaxPlusMatrix);
|
|
538
|
+
|
|
539
|
+
InstallMethod(SEMIGROUPS_TypeOfMatrixOverSemiringCons,
|
|
540
|
+
"for IsProjectiveMaxPlusMatrix",
|
|
541
|
+
[IsProjectiveMaxPlusMatrix], x -> ProjectiveMaxPlusMatrixType);
|
|
542
|
+
|
|
543
|
+
InstallMethod(SEMIGROUPS_MatrixOverSemiringEntryCheckerCons,
|
|
544
|
+
"for IsProjectiveMaxPlusMatrix",
|
|
545
|
+
[IsProjectiveMaxPlusMatrix],
|
|
546
|
+
{filter} -> x -> IsInt(x) or x = -infinity);
|
|
547
|
+
|
|
548
|
+
InstallMethod(\*, "for projective max-plus matrices",
|
|
549
|
+
[IsProjectiveMaxPlusMatrix, IsProjectiveMaxPlusMatrix],
|
|
550
|
+
function(x, y)
|
|
551
|
+
local n, xy, norm, PlusMinMax, val, i, j, k;
|
|
552
|
+
|
|
553
|
+
n := Minimum(Length(x![1]), Length(y![1]));
|
|
554
|
+
xy := List([1 .. n], x -> EmptyPlist(n));
|
|
555
|
+
norm := -infinity;
|
|
556
|
+
PlusMinMax := SEMIGROUPS.PlusMinMax;
|
|
557
|
+
|
|
558
|
+
for i in [1 .. n] do
|
|
559
|
+
for j in [1 .. n] do
|
|
560
|
+
val := -infinity;
|
|
561
|
+
for k in [1 .. n] do
|
|
562
|
+
val := Maximum(val, PlusMinMax(x![i][k], y![k][j]));
|
|
563
|
+
od;
|
|
564
|
+
xy[i][j] := val;
|
|
565
|
+
if val > norm then
|
|
566
|
+
norm := val;
|
|
567
|
+
fi;
|
|
568
|
+
od;
|
|
569
|
+
od;
|
|
570
|
+
|
|
571
|
+
for i in [1 .. n] do
|
|
572
|
+
for j in [1 .. n] do
|
|
573
|
+
if xy[i][j] <> -infinity then
|
|
574
|
+
xy[i][j] := xy[i][j] - norm;
|
|
575
|
+
fi;
|
|
576
|
+
od;
|
|
577
|
+
od;
|
|
578
|
+
return MatrixNC(x, xy);
|
|
579
|
+
end);
|
|
580
|
+
|
|
581
|
+
InstallMethod(OneImmutable, "for a projective max-plus matrix",
|
|
582
|
+
[IsProjectiveMaxPlusMatrix],
|
|
583
|
+
x -> MatrixNC(x, SEMIGROUPS.IdentityMat(x, -infinity, 0)));
|
|
584
|
+
|
|
585
|
+
InstallMethod(RandomMatrixCons, "for IsProjectiveMaxPlusMatrix and pos int",
|
|
586
|
+
[IsProjectiveMaxPlusMatrix, IsPosInt],
|
|
587
|
+
function(filter, n)
|
|
588
|
+
return MatrixNC(filter,
|
|
589
|
+
SEMIGROUPS.RandomIntegerMatrix(n, -infinity));
|
|
590
|
+
end);
|
|
591
|
+
|
|
592
|
+
InstallMethod(AsMatrix,
|
|
593
|
+
"for IsProjectiveMaxPlusMatrix, max-plus matrix",
|
|
594
|
+
[IsProjectiveMaxPlusMatrix, IsMaxPlusMatrix],
|
|
595
|
+
{filter, mat} -> MatrixNC(filter, AsList(mat)));
|
|
596
|
+
|
|
597
|
+
InstallMethod(AsMatrix,
|
|
598
|
+
"for IsProjectiveMaxPlusMatrix, tropical max-plus matrix",
|
|
599
|
+
[IsProjectiveMaxPlusMatrix, IsTropicalMaxPlusMatrix],
|
|
600
|
+
{filter, mat} -> MatrixNC(filter, AsList(mat)));
|
|
601
|
+
|
|
602
|
+
InstallMethod(AsMatrix,
|
|
603
|
+
"for IsProjectiveMaxPlusMatrix, transformation",
|
|
604
|
+
[IsProjectiveMaxPlusMatrix, IsTransformation],
|
|
605
|
+
{filter, x} -> AsMatrix(filter, x, DegreeOfTransformation(x)));
|
|
606
|
+
|
|
607
|
+
InstallMethod(AsMatrix,
|
|
608
|
+
"for IsProjectiveMaxPlusMatrix, transformation, pos int",
|
|
609
|
+
[IsProjectiveMaxPlusMatrix, IsTransformation, IsPosInt],
|
|
610
|
+
{filter, x, dim}
|
|
611
|
+
-> MatrixNC(filter, SEMIGROUPS.MatrixTrans(x, dim, -infinity, 0)));
|
|
612
|
+
|
|
613
|
+
#############################################################################
|
|
614
|
+
## 7. NTP matrices
|
|
615
|
+
#############################################################################
|
|
616
|
+
|
|
617
|
+
InstallMethod(ThresholdNTPMatrix, "for a natural matrix",
|
|
618
|
+
[IsNTPMatrix], x -> x![DimensionOfMatrixOverSemiring(x) + 1]);
|
|
619
|
+
|
|
620
|
+
InstallMethod(PeriodNTPMatrix, "for a natural matrix",
|
|
621
|
+
[IsNTPMatrix], x -> x![DimensionOfMatrixOverSemiring(x) + 2]);
|
|
622
|
+
|
|
623
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
624
|
+
"for a natural number matrix",
|
|
625
|
+
[IsNTPMatrix], x -> "ntp");
|
|
626
|
+
|
|
627
|
+
InstallMethod(SEMIGROUPS_FilterOfMatrixOverSemiring,
|
|
628
|
+
"for a ntp matrix",
|
|
629
|
+
[IsNTPMatrix], x -> IsNTPMatrix);
|
|
630
|
+
|
|
631
|
+
InstallMethod(SEMIGROUPS_TypeOfMatrixOverSemiringCons, "for IsNTPMatrix",
|
|
632
|
+
[IsNTPMatrix], x -> NTPMatrixType);
|
|
633
|
+
|
|
634
|
+
InstallMethod(SEMIGROUPS_MatrixOverSemiringEntryCheckerCons,
|
|
635
|
+
"for IsNTPMatrix, pos int, pos int", [IsNTPMatrix, IsInt, IsInt],
|
|
636
|
+
function(_, threshold, period)
|
|
637
|
+
if threshold < 0 then
|
|
638
|
+
ErrorNoReturn("the 2nd argument (a pos. int.) is not >= 0");
|
|
639
|
+
elif period <= 0 then
|
|
640
|
+
ErrorNoReturn("the 3rd argument (a pos. int.) is not > 0");
|
|
641
|
+
fi;
|
|
642
|
+
return x -> (IsInt(x) and x >= 0 and x <= threshold + period - 1);
|
|
643
|
+
end);
|
|
644
|
+
|
|
645
|
+
InstallMethod(\*, "for natural number matrices",
|
|
646
|
+
[IsNTPMatrix, IsNTPMatrix],
|
|
647
|
+
function(x, y)
|
|
648
|
+
local n, period, threshold, xy, i, j, k;
|
|
649
|
+
|
|
650
|
+
n := Minimum(Length(x![1]), Length(y![1]));
|
|
651
|
+
period := PeriodNTPMatrix(x);
|
|
652
|
+
threshold := ThresholdNTPMatrix(x);
|
|
653
|
+
|
|
654
|
+
if period <> PeriodNTPMatrix(y) or threshold <> ThresholdNTPMatrix(y) then
|
|
655
|
+
ErrorNoReturn("the arguments (ntp matrices) are not over the same ",
|
|
656
|
+
"semiring");
|
|
657
|
+
fi;
|
|
658
|
+
|
|
659
|
+
xy := List([1 .. n], x -> EmptyPlist(n));
|
|
660
|
+
|
|
661
|
+
for i in [1 .. n] do
|
|
662
|
+
for j in [1 .. n] do
|
|
663
|
+
xy[i][j] := 0;
|
|
664
|
+
for k in [1 .. n] do
|
|
665
|
+
xy[i][j] := xy[i][j] + x![i][k] * y![k][j];
|
|
666
|
+
od;
|
|
667
|
+
if xy[i][j] > threshold then
|
|
668
|
+
xy[i][j] := threshold + (xy[i][j] - threshold) mod period;
|
|
669
|
+
fi;
|
|
670
|
+
od;
|
|
671
|
+
od;
|
|
672
|
+
return MatrixNC(x, xy);
|
|
673
|
+
end);
|
|
674
|
+
|
|
675
|
+
InstallMethod(OneImmutable, "for a ntp matrix",
|
|
676
|
+
[IsNTPMatrix],
|
|
677
|
+
x -> MatrixNC(x, SEMIGROUPS.IdentityMat(x, 0, 1)));
|
|
678
|
+
|
|
679
|
+
InstallMethod(RandomMatrixCons, "for IsNTPMatrix, pos int, pos int, pos int",
|
|
680
|
+
[IsNTPMatrix, IsPosInt, IsInt, IsInt],
|
|
681
|
+
function(filter, dim, threshold, period)
|
|
682
|
+
local mat;
|
|
683
|
+
mat := SEMIGROUPS.RandomIntegerMatrix(dim, false);
|
|
684
|
+
mat := SEMIGROUPS.NaturalizeMat(mat, threshold, period);
|
|
685
|
+
return MatrixNC(filter, mat);
|
|
686
|
+
end);
|
|
687
|
+
|
|
688
|
+
InstallMethod(AsMatrix,
|
|
689
|
+
"for IsNTPMatrix, ntp matrix, pos int, pos int",
|
|
690
|
+
[IsNTPMatrix, IsNTPMatrix, IsPosInt, IsPosInt],
|
|
691
|
+
function(filter, mat, threshold, period)
|
|
692
|
+
return MatrixNC(filter, SEMIGROUPS.NaturalizeMat(AsMutableList(mat),
|
|
693
|
+
threshold,
|
|
694
|
+
period));
|
|
695
|
+
end);
|
|
696
|
+
|
|
697
|
+
InstallMethod(AsMatrix,
|
|
698
|
+
"for IsNTPMatrix, ntp matrix, pos int, pos int",
|
|
699
|
+
[IsNTPMatrix, IsMatrixObj, IsPosInt, IsPosInt],
|
|
700
|
+
function(filter, mat, threshold, period)
|
|
701
|
+
if BaseDomain(mat) <> Integers then
|
|
702
|
+
TryNextMethod();
|
|
703
|
+
fi;
|
|
704
|
+
return MatrixNC(filter, SEMIGROUPS.NaturalizeMat(Unpack(mat),
|
|
705
|
+
threshold,
|
|
706
|
+
period));
|
|
707
|
+
end);
|
|
708
|
+
|
|
709
|
+
InstallMethod(AsMatrix,
|
|
710
|
+
"for IsNTPMatrix, transformation, pos int, pos int",
|
|
711
|
+
[IsNTPMatrix, IsTransformation, IsPosInt, IsPosInt],
|
|
712
|
+
{filter, x, threshold, period}
|
|
713
|
+
-> AsMatrix(filter, x, DegreeOfTransformation(x), threshold, period));
|
|
714
|
+
|
|
715
|
+
InstallMethod(AsMatrix,
|
|
716
|
+
"for IsNTPMatrix, transformation, pos int, pos int, pos int",
|
|
717
|
+
[IsNTPMatrix, IsTransformation, IsPosInt, IsPosInt, IsPosInt],
|
|
718
|
+
function(filter, x, dim, threshold, period)
|
|
719
|
+
local mat;
|
|
720
|
+
mat := SEMIGROUPS.MatrixTrans(x, dim, 0, 1);
|
|
721
|
+
return MatrixNC(filter,
|
|
722
|
+
SEMIGROUPS.NaturalizeMat(mat, threshold, period));
|
|
723
|
+
end);
|
|
724
|
+
|
|
725
|
+
#############################################################################
|
|
726
|
+
## 8. Integer matrices
|
|
727
|
+
#############################################################################
|
|
728
|
+
|
|
729
|
+
InstallMethod(SEMIGROUPS_TypeViewStringOfMatrixOverSemiring,
|
|
730
|
+
"for a matrix obj",
|
|
731
|
+
[IsMatrixObj],
|
|
732
|
+
function(x)
|
|
733
|
+
if BaseDomain(x) = Integers then
|
|
734
|
+
return "integer";
|
|
735
|
+
fi;
|
|
736
|
+
TryNextMethod();
|
|
737
|
+
end);
|
|
738
|
+
|
|
739
|
+
InstallMethod(OneImmutable, "for an integer matrix obj",
|
|
740
|
+
[IsMatrixObj],
|
|
741
|
+
function(x)
|
|
742
|
+
if BaseDomain(x) <> Integers or IsList(x) then
|
|
743
|
+
TryNextMethod();
|
|
744
|
+
fi;
|
|
745
|
+
return Matrix(x, SEMIGROUPS.IdentityMat(x, 0, 1));
|
|
746
|
+
end);
|
|
747
|
+
|
|
748
|
+
InstallMethod(RandomMatrixOp, "for Integers and pos int",
|
|
749
|
+
[IsIntegers, IsPosInt],
|
|
750
|
+
{semiring, n} -> Matrix(semiring, SEMIGROUPS.RandomIntegerMatrix(n, false)));
|
|
751
|
+
|
|
752
|
+
# TODO(MatrixObj-later) this method should be in the GAP library
|
|
753
|
+
InstallMethod(Order, "for an integer matrix obj",
|
|
754
|
+
[IsMatrixObj],
|
|
755
|
+
function(mat)
|
|
756
|
+
if not IsIntegers(BaseDomain(mat)) then
|
|
757
|
+
TryNextMethod();
|
|
758
|
+
fi;
|
|
759
|
+
return Order(Unpack(mat));
|
|
760
|
+
end);
|
|
761
|
+
|
|
762
|
+
InstallMethod(IsTorsion, "for an integer matrix obj",
|
|
763
|
+
[IsMatrixObj],
|
|
764
|
+
function(mat)
|
|
765
|
+
if not IsIntegers(BaseDomain(mat)) then
|
|
766
|
+
TryNextMethod();
|
|
767
|
+
fi;
|
|
768
|
+
return Order(mat) <> infinity;
|
|
769
|
+
end);
|
|
770
|
+
|
|
771
|
+
InstallMethod(Matrix,
|
|
772
|
+
"for Integers and transformation",
|
|
773
|
+
[IsIntegers, IsTransformation],
|
|
774
|
+
{semiring, x} -> Matrix(semiring, x, DegreeOfTransformation(x)));
|
|
775
|
+
|
|
776
|
+
InstallMethod(Matrix,
|
|
777
|
+
"for Integers, transformation, pos int",
|
|
778
|
+
[IsIntegers, IsTransformation, IsPosInt],
|
|
779
|
+
function(semiring, x, dim)
|
|
780
|
+
return Matrix(semiring,
|
|
781
|
+
SEMIGROUPS.MatrixTrans(x, dim, 0, 1));
|
|
782
|
+
end);
|