passagemath-gap-pkg-semigroups 10.6.29__cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-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/aarch64-unknown-linux-gnu-default64-kv10/semigroups.so +0 -0
- gap/pkg/semigroups/config.guess +1807 -0
- gap/pkg/semigroups/config.log +1016 -0
- gap/pkg/semigroups/config.status +1132 -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-8ea3c4e7.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,717 @@
|
|
|
1
|
+
############################################################################
|
|
2
|
+
##
|
|
3
|
+
## elements/semiringmat.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
|
+
# This file contains declarations for matrices over semirings.
|
|
12
|
+
|
|
13
|
+
# A matrix over semiring <mat> is:
|
|
14
|
+
#
|
|
15
|
+
# mat![i] = the ith row
|
|
16
|
+
#
|
|
17
|
+
# it is also square, any additional data (like the threshold for tropical
|
|
18
|
+
# matrices), is contained in the positions from Length(mat![1]) + 1 onwards.
|
|
19
|
+
|
|
20
|
+
#############################################################################
|
|
21
|
+
# Internal
|
|
22
|
+
#############################################################################
|
|
23
|
+
|
|
24
|
+
SEMIGROUPS.TropicalizeMat := function(mat, threshold)
|
|
25
|
+
local n, i, j;
|
|
26
|
+
|
|
27
|
+
n := Length(mat);
|
|
28
|
+
mat[n + 1] := threshold;
|
|
29
|
+
for i in [1 .. n] do
|
|
30
|
+
for j in [1 .. n] do
|
|
31
|
+
if IsInt(mat[i, j]) then
|
|
32
|
+
mat[i, j] := AbsInt(mat[i, j]);
|
|
33
|
+
if mat[i, j] > threshold then
|
|
34
|
+
mat[i, j] := threshold;
|
|
35
|
+
fi;
|
|
36
|
+
fi;
|
|
37
|
+
od;
|
|
38
|
+
od;
|
|
39
|
+
return mat;
|
|
40
|
+
end;
|
|
41
|
+
|
|
42
|
+
SEMIGROUPS.NaturalizeMat := function(x, threshold, period)
|
|
43
|
+
local n, i, j;
|
|
44
|
+
|
|
45
|
+
n := Length(x);
|
|
46
|
+
x[n + 1] := threshold;
|
|
47
|
+
x[n + 2] := period;
|
|
48
|
+
for i in [1 .. n] do
|
|
49
|
+
for j in [1 .. n] do
|
|
50
|
+
x[i][j] := AbsInt(x[i][j]);
|
|
51
|
+
if x[i][j] > threshold then
|
|
52
|
+
x[i][j] := threshold + (x[i][j] - threshold) mod period;
|
|
53
|
+
fi;
|
|
54
|
+
od;
|
|
55
|
+
od;
|
|
56
|
+
return x;
|
|
57
|
+
end;
|
|
58
|
+
|
|
59
|
+
SEMIGROUPS.HashFunctionMatrixOverSemiring := function(x, data)
|
|
60
|
+
local n, h, i, j;
|
|
61
|
+
n := DimensionOfMatrixOverSemiring(x);
|
|
62
|
+
h := 0;
|
|
63
|
+
for i in [1 .. n] do
|
|
64
|
+
for j in [1 .. n] do
|
|
65
|
+
if x![i][j] <> infinity and x![i][j] <> -infinity then
|
|
66
|
+
h := ((h / 4) + x![i][j]) mod data;
|
|
67
|
+
fi;
|
|
68
|
+
od;
|
|
69
|
+
od;
|
|
70
|
+
return h + 1;
|
|
71
|
+
end;
|
|
72
|
+
|
|
73
|
+
SEMIGROUPS.MatrixTrans := function(x, dim, zero, one)
|
|
74
|
+
local mat, i;
|
|
75
|
+
|
|
76
|
+
mat := List([1 .. dim], x -> ShallowCopy([1 .. dim] * 0 + zero));
|
|
77
|
+
for i in [1 .. dim] do
|
|
78
|
+
mat[i, i ^ x] := one;
|
|
79
|
+
od;
|
|
80
|
+
return mat;
|
|
81
|
+
end;
|
|
82
|
+
|
|
83
|
+
#############################################################################
|
|
84
|
+
# Pickler
|
|
85
|
+
#############################################################################
|
|
86
|
+
|
|
87
|
+
InstallMethod(IO_Pickle, "for a matrix over semiring",
|
|
88
|
+
[IsFile, IsPlistMatrixOverSemiringPositionalRep],
|
|
89
|
+
function(file, mat)
|
|
90
|
+
local pickle, i;
|
|
91
|
+
|
|
92
|
+
if IO_Write(file, "MOSR") = fail then
|
|
93
|
+
return IO_Error;
|
|
94
|
+
fi;
|
|
95
|
+
pickle := [SEMIGROUPS_FilterOfMatrixOverSemiring(mat), []];
|
|
96
|
+
i := 1;
|
|
97
|
+
while IsBound(mat![i]) do
|
|
98
|
+
pickle[2, i] := mat![i];
|
|
99
|
+
i := i + 1;
|
|
100
|
+
od;
|
|
101
|
+
|
|
102
|
+
return IO_Pickle(file, pickle);
|
|
103
|
+
end);
|
|
104
|
+
|
|
105
|
+
IO_Unpicklers.MOSR := function(file)
|
|
106
|
+
local arg;
|
|
107
|
+
arg := IO_Unpickle(file);
|
|
108
|
+
if arg = IO_Error then
|
|
109
|
+
return IO_Error;
|
|
110
|
+
elif arg[1] = IsBooleanMat then
|
|
111
|
+
Perform(arg[2], ConvertToBlistRep);
|
|
112
|
+
fi;
|
|
113
|
+
return CallFuncList(MatrixNC, arg);
|
|
114
|
+
end;
|
|
115
|
+
|
|
116
|
+
InstallMethod(IsGeneratorsOfSemigroup, "for a generalized row vector",
|
|
117
|
+
[IsGeneralizedRowVector],
|
|
118
|
+
# TODO(MatrixObj-later) is this the best way to recognise a collection of
|
|
119
|
+
# MatrixObj?
|
|
120
|
+
function(coll)
|
|
121
|
+
local n;
|
|
122
|
+
if ForAll(coll, IsMatrixObj)
|
|
123
|
+
and ForAll(coll, x -> BaseDomain(x) = Integers) then
|
|
124
|
+
n := NrRows(Representative(coll));
|
|
125
|
+
return ForAll(coll, x -> NrRows(x) = n and NrCols(x) = n);
|
|
126
|
+
fi;
|
|
127
|
+
TryNextMethod();
|
|
128
|
+
end);
|
|
129
|
+
|
|
130
|
+
InstallMethod(IsGeneratorsOfSemigroup,
|
|
131
|
+
"for a matrix over semiring collection",
|
|
132
|
+
[IsMatrixOverSemiringCollection],
|
|
133
|
+
function(coll)
|
|
134
|
+
local n;
|
|
135
|
+
if IsGreensClass(coll) or IsSemigroup(coll) then
|
|
136
|
+
return true;
|
|
137
|
+
elif (IsTropicalMaxPlusMatrixCollection(coll)
|
|
138
|
+
or IsTropicalMinPlusMatrixCollection(coll))
|
|
139
|
+
and ForAny(coll, x -> ThresholdTropicalMatrix(x)
|
|
140
|
+
<> ThresholdTropicalMatrix(coll[1])) then
|
|
141
|
+
return false;
|
|
142
|
+
elif IsNTPMatrixCollection(coll)
|
|
143
|
+
and (ForAny(coll, x -> ThresholdNTPMatrix(x)
|
|
144
|
+
<> ThresholdNTPMatrix(coll[1]))
|
|
145
|
+
or ForAny(coll, x -> PeriodNTPMatrix(x)
|
|
146
|
+
<> PeriodNTPMatrix(coll[1]))) then
|
|
147
|
+
return false;
|
|
148
|
+
fi;
|
|
149
|
+
n := DimensionOfMatrixOverSemiring(coll[1]);
|
|
150
|
+
return ForAll(coll, x -> DimensionOfMatrixOverSemiring(x) = n);
|
|
151
|
+
end);
|
|
152
|
+
|
|
153
|
+
#############################################################################
|
|
154
|
+
# Constructors
|
|
155
|
+
#############################################################################
|
|
156
|
+
|
|
157
|
+
# Note that MatrixNC changes its argument in place!!
|
|
158
|
+
|
|
159
|
+
InstallMethod(MatrixNC, "for a type and list",
|
|
160
|
+
[IsType, IsList],
|
|
161
|
+
function(type, mat)
|
|
162
|
+
MakeImmutable(mat);
|
|
163
|
+
return Objectify(type, mat);
|
|
164
|
+
end);
|
|
165
|
+
|
|
166
|
+
InstallMethod(MatrixNC, "for a filter and list",
|
|
167
|
+
[IsOperation, IsList],
|
|
168
|
+
{filter, mat}
|
|
169
|
+
-> MatrixNC(SEMIGROUPS_TypeOfMatrixOverSemiringCons(filter), mat));
|
|
170
|
+
|
|
171
|
+
InstallMethod(MatrixNC, "for a filter, list, function",
|
|
172
|
+
[IsOperation, IsList, IsFunction],
|
|
173
|
+
function(filter, mat, preproc)
|
|
174
|
+
return MatrixNC(SEMIGROUPS_TypeOfMatrixOverSemiringCons(filter),
|
|
175
|
+
preproc(mat));
|
|
176
|
+
end);
|
|
177
|
+
|
|
178
|
+
InstallMethod(MatrixNC,
|
|
179
|
+
"for a plist matrix over semiring positional rep and mutable list",
|
|
180
|
+
[IsPlistMatrixOverSemiringPositionalRep, IsList and IsMutable],
|
|
181
|
+
function(sample, mat)
|
|
182
|
+
local n, filter;
|
|
183
|
+
|
|
184
|
+
# transfer whatever comes after the rows of the matrix, i.e. threshold,
|
|
185
|
+
# period etc.
|
|
186
|
+
n := Length(sample![1]) + 1;
|
|
187
|
+
while IsBound(sample![n]) do
|
|
188
|
+
mat[n] := sample![n];
|
|
189
|
+
n := n + 1;
|
|
190
|
+
od;
|
|
191
|
+
|
|
192
|
+
# Cannot use TypeObj(sample) since it can contain information about
|
|
193
|
+
# properties satisfied (or not) by x.
|
|
194
|
+
filter := SEMIGROUPS_FilterOfMatrixOverSemiring(sample);
|
|
195
|
+
return MatrixNC(SEMIGROUPS_TypeOfMatrixOverSemiringCons(filter), mat);
|
|
196
|
+
end);
|
|
197
|
+
|
|
198
|
+
InstallMethod(Matrix,
|
|
199
|
+
"for a filter, homogeneous list, pos int, and pos int",
|
|
200
|
+
[IsOperation, IsHomogeneousList, IsInt, IsInt],
|
|
201
|
+
function(filter, mat, threshold, period)
|
|
202
|
+
local checker, row;
|
|
203
|
+
|
|
204
|
+
if not IsRectangularTable(mat) or Length(mat) <> Length(mat[1]) then
|
|
205
|
+
TryNextMethod();
|
|
206
|
+
elif filter <> IsNTPMatrix then
|
|
207
|
+
TryNextMethod();
|
|
208
|
+
fi;
|
|
209
|
+
|
|
210
|
+
checker := SEMIGROUPS_MatrixOverSemiringEntryCheckerCons(filter,
|
|
211
|
+
threshold,
|
|
212
|
+
period);
|
|
213
|
+
for row in mat do
|
|
214
|
+
if not ForAll(row, checker) then
|
|
215
|
+
ErrorNoReturn("the entries in the 2nd argument do not define a matrix ",
|
|
216
|
+
"of type ", NameFunction(filter));
|
|
217
|
+
fi;
|
|
218
|
+
od;
|
|
219
|
+
|
|
220
|
+
return MatrixNC(filter,
|
|
221
|
+
List(mat, ShallowCopy),
|
|
222
|
+
x -> SEMIGROUPS.NaturalizeMat(x, threshold, period));
|
|
223
|
+
end);
|
|
224
|
+
|
|
225
|
+
InstallMethod(Matrix,
|
|
226
|
+
"for a filter, homogeneous list, and pos int",
|
|
227
|
+
[IsOperation, IsHomogeneousList, IsPosInt],
|
|
228
|
+
function(filter, mat, threshold)
|
|
229
|
+
local checker, row;
|
|
230
|
+
|
|
231
|
+
if not IsRectangularTable(mat) or Length(mat) <> Length(mat[1]) then
|
|
232
|
+
ErrorNoReturn("the 2nd argument must define a square matrix");
|
|
233
|
+
elif filter <> IsTropicalMaxPlusMatrix
|
|
234
|
+
and filter <> IsTropicalMinPlusMatrix then
|
|
235
|
+
ErrorNoReturn("cannot create a matrix from the given arguments");
|
|
236
|
+
fi;
|
|
237
|
+
|
|
238
|
+
checker := SEMIGROUPS_MatrixOverSemiringEntryCheckerCons(filter,
|
|
239
|
+
threshold);
|
|
240
|
+
for row in mat do
|
|
241
|
+
if not ForAll(row, checker) then
|
|
242
|
+
ErrorNoReturn("the entries in the 2nd argument do not define a matrix ",
|
|
243
|
+
"of type ", NameFunction(filter));
|
|
244
|
+
fi;
|
|
245
|
+
od;
|
|
246
|
+
|
|
247
|
+
return MatrixNC(filter,
|
|
248
|
+
List(mat, ShallowCopy),
|
|
249
|
+
x -> SEMIGROUPS.TropicalizeMat(x, threshold));
|
|
250
|
+
end);
|
|
251
|
+
|
|
252
|
+
InstallMethod(Matrix, "for a filter and homogeneous list",
|
|
253
|
+
[IsOperation, IsHomogeneousList],
|
|
254
|
+
function(filter, mat)
|
|
255
|
+
local row;
|
|
256
|
+
|
|
257
|
+
if not IsRectangularTable(mat) or Length(mat) <> Length(mat[1]) then
|
|
258
|
+
TryNextMethod();
|
|
259
|
+
elif not filter in [IsBooleanMat,
|
|
260
|
+
IsMaxPlusMatrix,
|
|
261
|
+
IsMinPlusMatrix,
|
|
262
|
+
IsProjectiveMaxPlusMatrix] then
|
|
263
|
+
TryNextMethod();
|
|
264
|
+
elif filter = IsBooleanMat then
|
|
265
|
+
return BooleanMat(mat);
|
|
266
|
+
fi;
|
|
267
|
+
|
|
268
|
+
for row in mat do
|
|
269
|
+
if not ForAll(row, SEMIGROUPS_MatrixOverSemiringEntryCheckerCons(filter))
|
|
270
|
+
then
|
|
271
|
+
ErrorNoReturn("the entries in the 2nd argument do not define a matrix ",
|
|
272
|
+
"of type ", NameFunction(filter));
|
|
273
|
+
fi;
|
|
274
|
+
od;
|
|
275
|
+
|
|
276
|
+
return MatrixNC(filter, List(mat, ShallowCopy));
|
|
277
|
+
end);
|
|
278
|
+
|
|
279
|
+
InstallMethod(Matrix, "for a semiring and empty list",
|
|
280
|
+
[IsSemiring, IsList and IsEmpty],
|
|
281
|
+
function(semiring, mat)
|
|
282
|
+
if IsIntegers(semiring) then
|
|
283
|
+
return Matrix(Integers, mat);
|
|
284
|
+
fi;
|
|
285
|
+
TryNextMethod();
|
|
286
|
+
end);
|
|
287
|
+
|
|
288
|
+
InstallMethod(Matrix, "for a semiring and matrix over semiring",
|
|
289
|
+
[IsSemiring, IsMatrixOverSemiring],
|
|
290
|
+
{R, mat} -> Matrix(R, AsList(mat)));
|
|
291
|
+
|
|
292
|
+
InstallMethod(RandomMatrix, "for an operation and pos int",
|
|
293
|
+
[IsOperation, IsPosInt], RandomMatrixCons);
|
|
294
|
+
|
|
295
|
+
InstallMethod(RandomMatrix, "for an operation, pos int, and int",
|
|
296
|
+
[IsOperation, IsPosInt, IsInt], RandomMatrixCons);
|
|
297
|
+
|
|
298
|
+
InstallMethod(RandomMatrix, "for an operation, pos int, int, and int",
|
|
299
|
+
[IsOperation, IsPosInt, IsInt, IsInt], RandomMatrixCons);
|
|
300
|
+
|
|
301
|
+
InstallMethod(RandomMatrix, "for a semiring and non-negative int",
|
|
302
|
+
[IsSemiring, IsInt],
|
|
303
|
+
function(semiring, dim)
|
|
304
|
+
if dim < 0 then
|
|
305
|
+
TryNextMethod();
|
|
306
|
+
fi;
|
|
307
|
+
return RandomMatrixOp(semiring, dim);
|
|
308
|
+
end);
|
|
309
|
+
|
|
310
|
+
InstallMethod(RandomMatrix, "for a semiring, non-negative int, and pos int",
|
|
311
|
+
[IsSemiring, IsInt, IsPosInt],
|
|
312
|
+
function(semiring, dim, rank)
|
|
313
|
+
if dim < 0 then
|
|
314
|
+
TryNextMethod();
|
|
315
|
+
fi;
|
|
316
|
+
return RandomMatrixOp(semiring, dim, rank);
|
|
317
|
+
end);
|
|
318
|
+
|
|
319
|
+
InstallMethod(RandomMatrix, "for a semiring, non-negative int, and list",
|
|
320
|
+
[IsSemiring, IsInt, IsList],
|
|
321
|
+
function(semiring, dim, ranks)
|
|
322
|
+
if dim < 0 then
|
|
323
|
+
TryNextMethod();
|
|
324
|
+
fi;
|
|
325
|
+
return RandomMatrixOp(semiring, dim, ranks);
|
|
326
|
+
end);
|
|
327
|
+
|
|
328
|
+
InstallMethod(AsTransformation, "for a matrix over semiring",
|
|
329
|
+
[IsMatrixOverSemiring],
|
|
330
|
+
function(mat)
|
|
331
|
+
local one, dim;
|
|
332
|
+
|
|
333
|
+
one := One(mat);
|
|
334
|
+
dim := DimensionOfMatrixOverSemiring(mat);
|
|
335
|
+
if Union(AsList(mat)) <> Union(AsList(one))
|
|
336
|
+
or ForAny([1 .. dim], i -> Number(mat[i], j -> j = one[1][1]) <> 1) then
|
|
337
|
+
return fail;
|
|
338
|
+
fi;
|
|
339
|
+
|
|
340
|
+
one := one[1][1];
|
|
341
|
+
return Transformation(List([1 .. dim], i -> Position(mat[i], one)));
|
|
342
|
+
end);
|
|
343
|
+
|
|
344
|
+
InstallMethod(AsMutableList, "for matrix over semiring",
|
|
345
|
+
[IsMatrixOverSemiring],
|
|
346
|
+
mat -> List([1 .. NrRows(mat)], i -> ShallowCopy(mat[i])));
|
|
347
|
+
|
|
348
|
+
InstallMethod(AsList, "for matrix over semiring",
|
|
349
|
+
[IsMatrixOverSemiring],
|
|
350
|
+
mat -> List([1 .. NrRows(mat)], i -> mat[i]));
|
|
351
|
+
|
|
352
|
+
InstallMethod(Iterator, "for a matrix over semiring",
|
|
353
|
+
[IsMatrixOverSemiring],
|
|
354
|
+
function(mat)
|
|
355
|
+
local iter;
|
|
356
|
+
|
|
357
|
+
iter := rec(pos := 0);
|
|
358
|
+
|
|
359
|
+
iter.NextIterator := function(iter)
|
|
360
|
+
if IsDoneIterator(iter) then
|
|
361
|
+
return fail;
|
|
362
|
+
fi;
|
|
363
|
+
iter!.pos := iter!.pos + 1;
|
|
364
|
+
return mat[iter!.pos];
|
|
365
|
+
end;
|
|
366
|
+
|
|
367
|
+
iter.IsDoneIterator := function(iter)
|
|
368
|
+
if iter!.pos = Length(mat[1]) then
|
|
369
|
+
return true;
|
|
370
|
+
fi;
|
|
371
|
+
return false;
|
|
372
|
+
end;
|
|
373
|
+
|
|
374
|
+
iter.ShallowCopy := iter -> rec(pos := 0);
|
|
375
|
+
|
|
376
|
+
return IteratorByFunctions(iter);
|
|
377
|
+
end);
|
|
378
|
+
|
|
379
|
+
InstallOtherMethod(\[\], "for a matrix over semiring and a pos int",
|
|
380
|
+
[IsPlistMatrixOverSemiringPositionalRep, IsPosInt],
|
|
381
|
+
function(mat, pos)
|
|
382
|
+
if pos > Length(mat![1]) then
|
|
383
|
+
ErrorNoReturn("the position is greater than the dimension of the matrix");
|
|
384
|
+
|
|
385
|
+
fi;
|
|
386
|
+
return mat![pos];
|
|
387
|
+
end);
|
|
388
|
+
|
|
389
|
+
InstallMethod(MatElm,
|
|
390
|
+
"for a plist matrix over semiring positional rep, and two pos ints",
|
|
391
|
+
[IsPlistMatrixOverSemiringPositionalRep, IsPosInt, IsPosInt],
|
|
392
|
+
function(mat, row, col)
|
|
393
|
+
if Maximum(row, col) > NumberRows(mat) then
|
|
394
|
+
ErrorNoReturn(
|
|
395
|
+
StringFormatted("the 1st argument (a matrix) only is {1}x{1}, ",
|
|
396
|
+
NrRows(mat)),
|
|
397
|
+
StringFormatted("but trying to access [{}, {}]", row, col));
|
|
398
|
+
fi;
|
|
399
|
+
return mat![row][col];
|
|
400
|
+
end);
|
|
401
|
+
|
|
402
|
+
InstallMethod(IsBound\[\],
|
|
403
|
+
"for a plist matrix over semiring positional rep and pos int",
|
|
404
|
+
[IsPlistMatrixOverSemiringPositionalRep, IsPosInt],
|
|
405
|
+
{mat, pos} -> IsBound(mat![pos]) and pos <= Length(mat![1]));
|
|
406
|
+
|
|
407
|
+
InstallMethod(TransposedMatImmutable, "for a matrix over semiring",
|
|
408
|
+
[IsPlistMatrixOverSemiringPositionalRep],
|
|
409
|
+
function(x)
|
|
410
|
+
local n, y, i, j;
|
|
411
|
+
|
|
412
|
+
n := DimensionOfMatrixOverSemiring(x);
|
|
413
|
+
y := EmptyPlist(n + 2);
|
|
414
|
+
for i in [1 .. n] do
|
|
415
|
+
y[i] := [];
|
|
416
|
+
for j in [1 .. n] do
|
|
417
|
+
y[i][j] := x[j][i];
|
|
418
|
+
od;
|
|
419
|
+
od;
|
|
420
|
+
|
|
421
|
+
return MatrixNC(x, y);
|
|
422
|
+
end);
|
|
423
|
+
|
|
424
|
+
InstallMethod(OneMutable, "for a matrix over semiring",
|
|
425
|
+
[IsMatrixOverSemiring], OneImmutable);
|
|
426
|
+
|
|
427
|
+
InstallMethod(OneMutable, "for a matrix over semiring collection",
|
|
428
|
+
[IsMatrixOverSemiringCollection], OneImmutable);
|
|
429
|
+
|
|
430
|
+
InstallMethod(OneImmutable, "for a matrix over semiring collection",
|
|
431
|
+
[IsMatrixOverSemiringCollection],
|
|
432
|
+
function(coll)
|
|
433
|
+
if IsGeneratorsOfSemigroup(coll) then
|
|
434
|
+
return OneImmutable(Representative(coll));
|
|
435
|
+
fi;
|
|
436
|
+
return fail;
|
|
437
|
+
end);
|
|
438
|
+
|
|
439
|
+
InstallMethod(InverseMutable, "for a matrix over semiring",
|
|
440
|
+
[IsMatrixOverSemiring], ReturnFail);
|
|
441
|
+
|
|
442
|
+
InstallMethod(InverseImmutable, "for a matrix over semiring",
|
|
443
|
+
[IsMatrixOverSemiring], ReturnFail);
|
|
444
|
+
|
|
445
|
+
InstallMethod(IsGeneratorsOfInverseSemigroup,
|
|
446
|
+
"for a matrix over semiring coll",
|
|
447
|
+
[IsMatrixOverSemiringCollection], ReturnFalse);
|
|
448
|
+
|
|
449
|
+
InstallMethod(DimensionOfMatrixOverSemiring, "for a matrix over a semiring",
|
|
450
|
+
[IsMatrixOverSemiring], NumberColumns);
|
|
451
|
+
|
|
452
|
+
InstallMethod(NumberRows, "for a matrix over a semiring",
|
|
453
|
+
[IsMatrixOverSemiring], NumberColumns);
|
|
454
|
+
|
|
455
|
+
InstallMethod(NumberColumns, "for a matrix over a semiring",
|
|
456
|
+
[IsMatrixOverSemiring],
|
|
457
|
+
function(mat)
|
|
458
|
+
if IsBound(mat[1]) then
|
|
459
|
+
return Length(mat[1]);
|
|
460
|
+
fi;
|
|
461
|
+
return 0;
|
|
462
|
+
end);
|
|
463
|
+
|
|
464
|
+
InstallMethod(DimensionOfMatrixOverSemiringCollection,
|
|
465
|
+
"for a matrix over semiring collection",
|
|
466
|
+
[IsMatrixOverSemiringCollection],
|
|
467
|
+
function(coll)
|
|
468
|
+
local dim;
|
|
469
|
+
|
|
470
|
+
dim := DimensionOfMatrixOverSemiring(Representative(coll));
|
|
471
|
+
if not ForAll(coll, x -> DimensionOfMatrixOverSemiring(x) = dim) then
|
|
472
|
+
ErrorNoReturn("the argument <coll> must be a collection of ",
|
|
473
|
+
"matrices of equal dimension");
|
|
474
|
+
fi;
|
|
475
|
+
return dim;
|
|
476
|
+
end);
|
|
477
|
+
|
|
478
|
+
# The next method is required because the previous one will try to enumerate
|
|
479
|
+
# the whole semigroup to check that the elements all have the same dimension,
|
|
480
|
+
# which they have to by default anyway.
|
|
481
|
+
|
|
482
|
+
InstallMethod(DimensionOfMatrixOverSemiringCollection,
|
|
483
|
+
"for a matrix over semiring semigroup",
|
|
484
|
+
[IsMatrixOverSemiringSemigroup],
|
|
485
|
+
S -> DimensionOfMatrixOverSemiring(Representative(S)));
|
|
486
|
+
|
|
487
|
+
InstallMethod(Display, "for a matrix over semiring collection",
|
|
488
|
+
[IsMatrixOverSemiringCollection],
|
|
489
|
+
function(coll)
|
|
490
|
+
Print(DisplayString(coll));
|
|
491
|
+
end);
|
|
492
|
+
|
|
493
|
+
InstallMethod(DisplayString, "for a matrix over semiring collection",
|
|
494
|
+
[IsMatrixOverSemiringCollection],
|
|
495
|
+
coll -> JoinStringsWithSeparator(List(coll, DisplayString), "\n"));
|
|
496
|
+
|
|
497
|
+
InstallMethod(DisplayString, "for a matrix over semiring",
|
|
498
|
+
[IsMatrixOverSemiring],
|
|
499
|
+
function(x)
|
|
500
|
+
local n, max, length, pad, str, i, j;
|
|
501
|
+
|
|
502
|
+
n := DimensionOfMatrixOverSemiring(x);
|
|
503
|
+
|
|
504
|
+
# find the max entry
|
|
505
|
+
max := 0;
|
|
506
|
+
for i in [1 .. n] do
|
|
507
|
+
for j in [1 .. n] do
|
|
508
|
+
if x[i][j] = infinity then
|
|
509
|
+
length := 1;
|
|
510
|
+
elif x[i][j] = -infinity then
|
|
511
|
+
length := 2;
|
|
512
|
+
else
|
|
513
|
+
length := Length(String(x[i][j]));
|
|
514
|
+
fi;
|
|
515
|
+
if length > max then
|
|
516
|
+
max := length;
|
|
517
|
+
fi;
|
|
518
|
+
od;
|
|
519
|
+
od;
|
|
520
|
+
|
|
521
|
+
pad := function(entry)
|
|
522
|
+
local n;
|
|
523
|
+
if entry = infinity then
|
|
524
|
+
entry := "∞";
|
|
525
|
+
n := 1;
|
|
526
|
+
elif entry = -infinity then
|
|
527
|
+
entry := "-∞";
|
|
528
|
+
n := 2;
|
|
529
|
+
else
|
|
530
|
+
entry := String(entry);
|
|
531
|
+
n := Length(entry);
|
|
532
|
+
fi;
|
|
533
|
+
return Concatenation(ListWithIdenticalEntries(max - n, ' '),
|
|
534
|
+
entry, " ");
|
|
535
|
+
end;
|
|
536
|
+
|
|
537
|
+
str := "";
|
|
538
|
+
for i in [1 .. n] do
|
|
539
|
+
for j in [1 .. n] do
|
|
540
|
+
Append(str, pad(x[i][j]));
|
|
541
|
+
od;
|
|
542
|
+
Remove(str, Length(str));
|
|
543
|
+
Append(str, "\n");
|
|
544
|
+
od;
|
|
545
|
+
return str;
|
|
546
|
+
end);
|
|
547
|
+
|
|
548
|
+
InstallMethod(ViewString, "for a matrix over semiring", [IsMatrixOverSemiring],
|
|
549
|
+
function(x)
|
|
550
|
+
local str;
|
|
551
|
+
if DimensionOfMatrixOverSemiring(x) < 9 then
|
|
552
|
+
return PrintString(x);
|
|
553
|
+
fi;
|
|
554
|
+
str := "<";
|
|
555
|
+
Append(str, String(DimensionOfMatrixOverSemiring(x)));
|
|
556
|
+
Append(str, "x");
|
|
557
|
+
Append(str, String(DimensionOfMatrixOverSemiring(x)));
|
|
558
|
+
Append(str, " ");
|
|
559
|
+
Append(str, SEMIGROUPS_TypeViewStringOfMatrixOverSemiring(x));
|
|
560
|
+
Append(str, " matrix>");
|
|
561
|
+
return str;
|
|
562
|
+
end);
|
|
563
|
+
|
|
564
|
+
InstallMethod(PrintString, "for a matrix over semiring collection",
|
|
565
|
+
[IsMatrixOverSemiringCollection],
|
|
566
|
+
function(coll)
|
|
567
|
+
local str, i;
|
|
568
|
+
if IsGreensClass(coll) or IsSemigroup(coll) then
|
|
569
|
+
TryNextMethod();
|
|
570
|
+
fi;
|
|
571
|
+
str := ShallowCopy(PrintString(coll[1]));
|
|
572
|
+
for i in [2 .. Length(coll)] do
|
|
573
|
+
Append(str, "\>");
|
|
574
|
+
Append(str, PrintString(coll[i]));
|
|
575
|
+
Append(str, "\<, ");
|
|
576
|
+
od;
|
|
577
|
+
Remove(str, Length(str));
|
|
578
|
+
Remove(str, Length(str));
|
|
579
|
+
return str;
|
|
580
|
+
end);
|
|
581
|
+
|
|
582
|
+
InstallMethod(PrintString, "for a matrix over semiring",
|
|
583
|
+
[IsMatrixOverSemiring],
|
|
584
|
+
function(x)
|
|
585
|
+
local n, str, i, j;
|
|
586
|
+
|
|
587
|
+
n := DimensionOfMatrixOverSemiring(x);
|
|
588
|
+
str := "\>\>Matrix(\<\>";
|
|
589
|
+
Append(str, NameFunction(SEMIGROUPS_FilterOfMatrixOverSemiring(x)));
|
|
590
|
+
Append(str, "\<, \>[");
|
|
591
|
+
for i in [1 .. n] do
|
|
592
|
+
Append(str, "\>\>[");
|
|
593
|
+
for j in [1 .. n] do
|
|
594
|
+
if IsBooleanMat(x) then
|
|
595
|
+
if x[i][j] then
|
|
596
|
+
Append(str, String(1));
|
|
597
|
+
else
|
|
598
|
+
Append(str, String(0));
|
|
599
|
+
fi;
|
|
600
|
+
else
|
|
601
|
+
Append(str, String(x[i][j]));
|
|
602
|
+
fi;
|
|
603
|
+
|
|
604
|
+
Append(str, ", ");
|
|
605
|
+
od;
|
|
606
|
+
Remove(str, Length(str));
|
|
607
|
+
Remove(str, Length(str));
|
|
608
|
+
Append(str, "]\<, \<");
|
|
609
|
+
od;
|
|
610
|
+
|
|
611
|
+
for i in [1 .. 4] do
|
|
612
|
+
Remove(str, Length(str));
|
|
613
|
+
od;
|
|
614
|
+
Append(str, "\<\<]");
|
|
615
|
+
|
|
616
|
+
if IsNTPMatrix(x) then
|
|
617
|
+
Append(str, ", \>");
|
|
618
|
+
Append(str, PrintString(ThresholdNTPMatrix(x)));
|
|
619
|
+
Append(str, "\<");
|
|
620
|
+
Append(str, ", \>");
|
|
621
|
+
Append(str, PrintString(PeriodNTPMatrix(x)));
|
|
622
|
+
Append(str, "\<");
|
|
623
|
+
elif IsTropicalMatrix(x) then
|
|
624
|
+
Append(str, ", \>");
|
|
625
|
+
Append(str, PrintString(ThresholdTropicalMatrix(x)));
|
|
626
|
+
Append(str, "\<");
|
|
627
|
+
fi;
|
|
628
|
+
Append(str, "\<)\<");
|
|
629
|
+
|
|
630
|
+
return str;
|
|
631
|
+
end);
|
|
632
|
+
|
|
633
|
+
InstallMethod(String, "for a matrix over semiring",
|
|
634
|
+
[IsMatrixOverSemiring],
|
|
635
|
+
function(x)
|
|
636
|
+
local str;
|
|
637
|
+
|
|
638
|
+
str := "Matrix(";
|
|
639
|
+
Append(str, NameFunction(SEMIGROUPS_FilterOfMatrixOverSemiring(x)));
|
|
640
|
+
Append(str, ", ");
|
|
641
|
+
Append(str, String(AsList(x)));
|
|
642
|
+
|
|
643
|
+
if IsNTPMatrix(x) then
|
|
644
|
+
Append(str, ", ");
|
|
645
|
+
Append(str, String(ThresholdNTPMatrix(x)));
|
|
646
|
+
Append(str, ", ");
|
|
647
|
+
Append(str, String(PeriodNTPMatrix(x)));
|
|
648
|
+
elif IsTropicalMatrix(x) then
|
|
649
|
+
Append(str, ", ");
|
|
650
|
+
Append(str, String(ThresholdTropicalMatrix(x)));
|
|
651
|
+
fi;
|
|
652
|
+
Append(str, ")");
|
|
653
|
+
|
|
654
|
+
return str;
|
|
655
|
+
end);
|
|
656
|
+
|
|
657
|
+
InstallMethod(\=, "for matrices over a semiring",
|
|
658
|
+
[IsPlistMatrixOverSemiringPositionalRep,
|
|
659
|
+
IsPlistMatrixOverSemiringPositionalRep],
|
|
660
|
+
function(x, y)
|
|
661
|
+
local n, i;
|
|
662
|
+
if SEMIGROUPS_FilterOfMatrixOverSemiring(x) <>
|
|
663
|
+
SEMIGROUPS_FilterOfMatrixOverSemiring(y) then
|
|
664
|
+
return false;
|
|
665
|
+
fi;
|
|
666
|
+
|
|
667
|
+
n := Length(x![1]);
|
|
668
|
+
if Length(y![1]) <> n then
|
|
669
|
+
return false;
|
|
670
|
+
fi;
|
|
671
|
+
|
|
672
|
+
i := 1;
|
|
673
|
+
while IsBound(x![i]) do
|
|
674
|
+
if x![i] <> y![i] then
|
|
675
|
+
return false;
|
|
676
|
+
fi;
|
|
677
|
+
i := i + 1;
|
|
678
|
+
od;
|
|
679
|
+
|
|
680
|
+
return true;
|
|
681
|
+
end);
|
|
682
|
+
|
|
683
|
+
InstallMethod(\<, "for matrices over a semiring",
|
|
684
|
+
[IsPlistMatrixOverSemiringPositionalRep,
|
|
685
|
+
IsPlistMatrixOverSemiringPositionalRep],
|
|
686
|
+
function(x, y)
|
|
687
|
+
local n, i;
|
|
688
|
+
|
|
689
|
+
if SEMIGROUPS_FilterOfMatrixOverSemiring(x) <>
|
|
690
|
+
SEMIGROUPS_FilterOfMatrixOverSemiring(y) then
|
|
691
|
+
ErrorNoReturn("the matrices are not of the same type");
|
|
692
|
+
fi;
|
|
693
|
+
n := Length(x![1]);
|
|
694
|
+
if n < Length(y![1]) then
|
|
695
|
+
return true;
|
|
696
|
+
elif n > Length(y![1]) then
|
|
697
|
+
return false;
|
|
698
|
+
fi;
|
|
699
|
+
|
|
700
|
+
i := 1;
|
|
701
|
+
while IsBound(x![i]) do
|
|
702
|
+
if x![i] < y![i] then
|
|
703
|
+
return true;
|
|
704
|
+
elif x![i] > y![i] then
|
|
705
|
+
return false;
|
|
706
|
+
fi;
|
|
707
|
+
i := i + 1;
|
|
708
|
+
od;
|
|
709
|
+
return false;
|
|
710
|
+
end);
|
|
711
|
+
|
|
712
|
+
InstallMethod(ChooseHashFunction, "for a matrix over semiring",
|
|
713
|
+
[IsMatrixOverSemiring, IsInt],
|
|
714
|
+
function(_, hashlen)
|
|
715
|
+
return rec(func := SEMIGROUPS.HashFunctionMatrixOverSemiring,
|
|
716
|
+
data := hashlen);
|
|
717
|
+
end);
|