passagemath-gap-pkg-semigroups 10.6.30__cp310-cp310-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-gap-pkg-semigroups might be problematic. Click here for more details.

Files changed (354) hide show
  1. gap/pkg/semigroups/CHANGELOG.md +1699 -0
  2. gap/pkg/semigroups/CONTRIBUTING.md +91 -0
  3. gap/pkg/semigroups/GNUmakefile +110 -0
  4. gap/pkg/semigroups/GNUmakefile.in +110 -0
  5. gap/pkg/semigroups/GPL +674 -0
  6. gap/pkg/semigroups/LICENSE +16 -0
  7. gap/pkg/semigroups/Makefile +26 -0
  8. gap/pkg/semigroups/Makefile.gappkg +225 -0
  9. gap/pkg/semigroups/PackageInfo.g +529 -0
  10. gap/pkg/semigroups/README.md +102 -0
  11. gap/pkg/semigroups/VERSIONS +112 -0
  12. gap/pkg/semigroups/aclocal.m4 +375 -0
  13. gap/pkg/semigroups/autogen.sh +25 -0
  14. gap/pkg/semigroups/bin/aarch64-apple-darwin23-default64-kv10/semigroups.so +0 -0
  15. gap/pkg/semigroups/config.guess +1807 -0
  16. gap/pkg/semigroups/config.log +1158 -0
  17. gap/pkg/semigroups/config.status +1131 -0
  18. gap/pkg/semigroups/config.sub +1960 -0
  19. gap/pkg/semigroups/configure +9742 -0
  20. gap/pkg/semigroups/configure.ac +71 -0
  21. gap/pkg/semigroups/data/doc/greens.pickle +1 -0
  22. gap/pkg/semigroups/data/gens/fullbool-8.pickle.gz +0 -0
  23. gap/pkg/semigroups/data/gens/fullbool.pickle.gz +0 -0
  24. gap/pkg/semigroups/data/gens/hall.pickle.gz +0 -0
  25. gap/pkg/semigroups/data/gens/reflex-6.pickle.gz +0 -0
  26. gap/pkg/semigroups/data/gens/reflex.pickle.gz +0 -0
  27. gap/pkg/semigroups/data/tst/bipart4 +10 -0
  28. gap/pkg/semigroups/data/tst/pperm10 +1 -0
  29. gap/pkg/semigroups/data/tst/tables.gz +0 -0
  30. gap/pkg/semigroups/data/tst/testdata +1 -0
  31. gap/pkg/semigroups/data/tst/testinstall.pickle +1 -0
  32. gap/pkg/semigroups/data/tst/trans3 +7 -0
  33. gap/pkg/semigroups/data/tst/trans3-old +7 -0
  34. gap/pkg/semigroups/environment.yml +7 -0
  35. gap/pkg/semigroups/gap/attributes/acting.gd +15 -0
  36. gap/pkg/semigroups/gap/attributes/acting.gi +297 -0
  37. gap/pkg/semigroups/gap/attributes/attr.gd +91 -0
  38. gap/pkg/semigroups/gap/attributes/attr.gi +1214 -0
  39. gap/pkg/semigroups/gap/attributes/dual.gd +25 -0
  40. gap/pkg/semigroups/gap/attributes/dual.gi +209 -0
  41. gap/pkg/semigroups/gap/attributes/factor.gd +17 -0
  42. gap/pkg/semigroups/gap/attributes/factor.gi +453 -0
  43. gap/pkg/semigroups/gap/attributes/homomorph.gd +84 -0
  44. gap/pkg/semigroups/gap/attributes/homomorph.gi +591 -0
  45. gap/pkg/semigroups/gap/attributes/inverse.gd +38 -0
  46. gap/pkg/semigroups/gap/attributes/inverse.gi +708 -0
  47. gap/pkg/semigroups/gap/attributes/isomorph.gd +16 -0
  48. gap/pkg/semigroups/gap/attributes/isomorph.gi +377 -0
  49. gap/pkg/semigroups/gap/attributes/isorms.gd +49 -0
  50. gap/pkg/semigroups/gap/attributes/isorms.gi +1383 -0
  51. gap/pkg/semigroups/gap/attributes/maximal.gd +16 -0
  52. gap/pkg/semigroups/gap/attributes/maximal.gi +1876 -0
  53. gap/pkg/semigroups/gap/attributes/properties.gd +109 -0
  54. gap/pkg/semigroups/gap/attributes/properties.gi +1658 -0
  55. gap/pkg/semigroups/gap/attributes/rms-translat.gd +39 -0
  56. gap/pkg/semigroups/gap/attributes/rms-translat.gi +1078 -0
  57. gap/pkg/semigroups/gap/attributes/semifp.gd +12 -0
  58. gap/pkg/semigroups/gap/attributes/semifp.gi +84 -0
  59. gap/pkg/semigroups/gap/attributes/translat.gd +474 -0
  60. gap/pkg/semigroups/gap/attributes/translat.gi +1779 -0
  61. gap/pkg/semigroups/gap/congruences/cong.gd +154 -0
  62. gap/pkg/semigroups/gap/congruences/cong.gi +351 -0
  63. gap/pkg/semigroups/gap/congruences/conginv.gd +38 -0
  64. gap/pkg/semigroups/gap/congruences/conginv.gi +589 -0
  65. gap/pkg/semigroups/gap/congruences/conglatt.gd +101 -0
  66. gap/pkg/semigroups/gap/congruences/conglatt.gi +886 -0
  67. gap/pkg/semigroups/gap/congruences/congpairs.gd +21 -0
  68. gap/pkg/semigroups/gap/congruences/congpairs.gi +272 -0
  69. gap/pkg/semigroups/gap/congruences/congpart.gd +90 -0
  70. gap/pkg/semigroups/gap/congruences/congpart.gi +449 -0
  71. gap/pkg/semigroups/gap/congruences/congrees.gd +20 -0
  72. gap/pkg/semigroups/gap/congruences/congrees.gi +313 -0
  73. gap/pkg/semigroups/gap/congruences/congrms.gd +54 -0
  74. gap/pkg/semigroups/gap/congruences/congrms.gi +1467 -0
  75. gap/pkg/semigroups/gap/congruences/congsemigraph.gd +28 -0
  76. gap/pkg/semigroups/gap/congruences/congsemigraph.gi +289 -0
  77. gap/pkg/semigroups/gap/congruences/congsimple.gd +27 -0
  78. gap/pkg/semigroups/gap/congruences/congsimple.gi +236 -0
  79. gap/pkg/semigroups/gap/congruences/conguniv.gd +20 -0
  80. gap/pkg/semigroups/gap/congruences/conguniv.gi +271 -0
  81. gap/pkg/semigroups/gap/congruences/congwordgraph.gd +21 -0
  82. gap/pkg/semigroups/gap/congruences/congwordgraph.gi +250 -0
  83. gap/pkg/semigroups/gap/elements/bipart.gd +71 -0
  84. gap/pkg/semigroups/gap/elements/bipart.gi +995 -0
  85. gap/pkg/semigroups/gap/elements/blocks.gd +31 -0
  86. gap/pkg/semigroups/gap/elements/blocks.gi +134 -0
  87. gap/pkg/semigroups/gap/elements/boolmat.gd +74 -0
  88. gap/pkg/semigroups/gap/elements/boolmat.gi +726 -0
  89. gap/pkg/semigroups/gap/elements/elements.gd +11 -0
  90. gap/pkg/semigroups/gap/elements/elements.gi +121 -0
  91. gap/pkg/semigroups/gap/elements/ffmat.gd +71 -0
  92. gap/pkg/semigroups/gap/elements/ffmat.gi +311 -0
  93. gap/pkg/semigroups/gap/elements/maxplusmat.gd +131 -0
  94. gap/pkg/semigroups/gap/elements/maxplusmat.gi +782 -0
  95. gap/pkg/semigroups/gap/elements/pbr.gd +51 -0
  96. gap/pkg/semigroups/gap/elements/pbr.gi +740 -0
  97. gap/pkg/semigroups/gap/elements/pperm.gd +11 -0
  98. gap/pkg/semigroups/gap/elements/pperm.gi +14 -0
  99. gap/pkg/semigroups/gap/elements/semiringmat.gd +136 -0
  100. gap/pkg/semigroups/gap/elements/semiringmat.gi +717 -0
  101. gap/pkg/semigroups/gap/elements/star.gd +21 -0
  102. gap/pkg/semigroups/gap/elements/star.gi +21 -0
  103. gap/pkg/semigroups/gap/elements/trans.gd +13 -0
  104. gap/pkg/semigroups/gap/elements/trans.gi +50 -0
  105. gap/pkg/semigroups/gap/fp/freeband.gd +22 -0
  106. gap/pkg/semigroups/gap/fp/freeband.gi +502 -0
  107. gap/pkg/semigroups/gap/fp/freeinverse.gd +30 -0
  108. gap/pkg/semigroups/gap/fp/freeinverse.gi +465 -0
  109. gap/pkg/semigroups/gap/fp/tietze.gd +89 -0
  110. gap/pkg/semigroups/gap/fp/tietze.gi +1578 -0
  111. gap/pkg/semigroups/gap/fp/word.gd +15 -0
  112. gap/pkg/semigroups/gap/fp/word.gi +67 -0
  113. gap/pkg/semigroups/gap/greens/acting-inverse.gi +774 -0
  114. gap/pkg/semigroups/gap/greens/acting-regular.gi +553 -0
  115. gap/pkg/semigroups/gap/greens/acting.gd +81 -0
  116. gap/pkg/semigroups/gap/greens/acting.gi +2433 -0
  117. gap/pkg/semigroups/gap/greens/froidure-pin.gd +25 -0
  118. gap/pkg/semigroups/gap/greens/froidure-pin.gi +741 -0
  119. gap/pkg/semigroups/gap/greens/generic.gd +117 -0
  120. gap/pkg/semigroups/gap/greens/generic.gi +630 -0
  121. gap/pkg/semigroups/gap/ideals/acting.gd +17 -0
  122. gap/pkg/semigroups/gap/ideals/acting.gi +1155 -0
  123. gap/pkg/semigroups/gap/ideals/froidure-pin.gd +11 -0
  124. gap/pkg/semigroups/gap/ideals/froidure-pin.gi +105 -0
  125. gap/pkg/semigroups/gap/ideals/ideals.gd +45 -0
  126. gap/pkg/semigroups/gap/ideals/ideals.gi +442 -0
  127. gap/pkg/semigroups/gap/ideals/lambda-rho.gd +16 -0
  128. gap/pkg/semigroups/gap/ideals/lambda-rho.gi +614 -0
  129. gap/pkg/semigroups/gap/libsemigroups/cong.gd +24 -0
  130. gap/pkg/semigroups/gap/libsemigroups/cong.gi +431 -0
  131. gap/pkg/semigroups/gap/libsemigroups/fpsemi.gd +16 -0
  132. gap/pkg/semigroups/gap/libsemigroups/fpsemi.gi +53 -0
  133. gap/pkg/semigroups/gap/libsemigroups/froidure-pin.gd +17 -0
  134. gap/pkg/semigroups/gap/libsemigroups/froidure-pin.gi +945 -0
  135. gap/pkg/semigroups/gap/libsemigroups/sims1.gd +38 -0
  136. gap/pkg/semigroups/gap/libsemigroups/sims1.gi +308 -0
  137. gap/pkg/semigroups/gap/main/acting.gd +36 -0
  138. gap/pkg/semigroups/gap/main/acting.gi +779 -0
  139. gap/pkg/semigroups/gap/main/froidure-pin.gd +72 -0
  140. gap/pkg/semigroups/gap/main/froidure-pin.gi +655 -0
  141. gap/pkg/semigroups/gap/main/graded.gd +26 -0
  142. gap/pkg/semigroups/gap/main/graded.gi +355 -0
  143. gap/pkg/semigroups/gap/main/lambda-rho.gd +29 -0
  144. gap/pkg/semigroups/gap/main/lambda-rho.gi +514 -0
  145. gap/pkg/semigroups/gap/main/orbits.gd +24 -0
  146. gap/pkg/semigroups/gap/main/orbits.gi +512 -0
  147. gap/pkg/semigroups/gap/main/semiact.gd +20 -0
  148. gap/pkg/semigroups/gap/main/semiact.gi +821 -0
  149. gap/pkg/semigroups/gap/main/setup.gd +61 -0
  150. gap/pkg/semigroups/gap/main/setup.gi +1094 -0
  151. gap/pkg/semigroups/gap/obsolete.gd +9 -0
  152. gap/pkg/semigroups/gap/obsolete.gi +14 -0
  153. gap/pkg/semigroups/gap/options.g +55 -0
  154. gap/pkg/semigroups/gap/semigroups/grpperm.gd +12 -0
  155. gap/pkg/semigroups/gap/semigroups/grpperm.gi +177 -0
  156. gap/pkg/semigroups/gap/semigroups/semibipart.gd +28 -0
  157. gap/pkg/semigroups/gap/semigroups/semibipart.gi +570 -0
  158. gap/pkg/semigroups/gap/semigroups/semiboolmat.gd +20 -0
  159. gap/pkg/semigroups/gap/semigroups/semiboolmat.gi +104 -0
  160. gap/pkg/semigroups/gap/semigroups/semicons.gd +52 -0
  161. gap/pkg/semigroups/gap/semigroups/semicons.gi +1194 -0
  162. gap/pkg/semigroups/gap/semigroups/semidp.gd +13 -0
  163. gap/pkg/semigroups/gap/semigroups/semidp.gi +509 -0
  164. gap/pkg/semigroups/gap/semigroups/semieunit.gd +126 -0
  165. gap/pkg/semigroups/gap/semigroups/semieunit.gi +889 -0
  166. gap/pkg/semigroups/gap/semigroups/semiex.gd +104 -0
  167. gap/pkg/semigroups/gap/semigroups/semiex.gi +1590 -0
  168. gap/pkg/semigroups/gap/semigroups/semiffmat.gd +37 -0
  169. gap/pkg/semigroups/gap/semigroups/semiffmat.gi +565 -0
  170. gap/pkg/semigroups/gap/semigroups/semifp.gd +28 -0
  171. gap/pkg/semigroups/gap/semigroups/semifp.gi +1364 -0
  172. gap/pkg/semigroups/gap/semigroups/semigraph.gd +40 -0
  173. gap/pkg/semigroups/gap/semigroups/semigraph.gi +292 -0
  174. gap/pkg/semigroups/gap/semigroups/semigrp.gd +165 -0
  175. gap/pkg/semigroups/gap/semigroups/semigrp.gi +1225 -0
  176. gap/pkg/semigroups/gap/semigroups/semimaxplus.gd +72 -0
  177. gap/pkg/semigroups/gap/semigroups/semimaxplus.gi +710 -0
  178. gap/pkg/semigroups/gap/semigroups/semintmat.gd +13 -0
  179. gap/pkg/semigroups/gap/semigroups/semintmat.gi +74 -0
  180. gap/pkg/semigroups/gap/semigroups/semipbr.gd +19 -0
  181. gap/pkg/semigroups/gap/semigroups/semipbr.gi +139 -0
  182. gap/pkg/semigroups/gap/semigroups/semipperm.gd +27 -0
  183. gap/pkg/semigroups/gap/semigroups/semipperm.gi +711 -0
  184. gap/pkg/semigroups/gap/semigroups/semiquo.gd +14 -0
  185. gap/pkg/semigroups/gap/semigroups/semiquo.gi +97 -0
  186. gap/pkg/semigroups/gap/semigroups/semiringmat.gd +16 -0
  187. gap/pkg/semigroups/gap/semigroups/semiringmat.gi +21 -0
  188. gap/pkg/semigroups/gap/semigroups/semirms.gd +19 -0
  189. gap/pkg/semigroups/gap/semigroups/semirms.gi +977 -0
  190. gap/pkg/semigroups/gap/semigroups/semitrans.gd +49 -0
  191. gap/pkg/semigroups/gap/semigroups/semitrans.gi +909 -0
  192. gap/pkg/semigroups/gap/tools/display.gd +24 -0
  193. gap/pkg/semigroups/gap/tools/display.gi +749 -0
  194. gap/pkg/semigroups/gap/tools/io.gd +17 -0
  195. gap/pkg/semigroups/gap/tools/io.gi +543 -0
  196. gap/pkg/semigroups/gap/tools/iterators.gd +16 -0
  197. gap/pkg/semigroups/gap/tools/iterators.gi +253 -0
  198. gap/pkg/semigroups/gap/tools/utils.gd +19 -0
  199. gap/pkg/semigroups/gap/tools/utils.gi +756 -0
  200. gap/pkg/semigroups/gapbind14/.ccls +18 -0
  201. gap/pkg/semigroups/gapbind14/.clang-format +104 -0
  202. gap/pkg/semigroups/gapbind14/CPPLINT.cfg +5 -0
  203. gap/pkg/semigroups/gapbind14/LICENSE +674 -0
  204. gap/pkg/semigroups/gapbind14/README.md +76 -0
  205. gap/pkg/semigroups/gapbind14/demo/.gitignore +4 -0
  206. gap/pkg/semigroups/gapbind14/demo/LICENSE +293 -0
  207. gap/pkg/semigroups/gapbind14/demo/Makefile.gappkg +220 -0
  208. gap/pkg/semigroups/gapbind14/demo/Makefile.in +19 -0
  209. gap/pkg/semigroups/gapbind14/demo/PackageInfo.g +87 -0
  210. gap/pkg/semigroups/gapbind14/demo/README.md +17 -0
  211. gap/pkg/semigroups/gapbind14/demo/configure +34 -0
  212. gap/pkg/semigroups/gapbind14/demo/gap/gapbind_demo.gd +19 -0
  213. gap/pkg/semigroups/gapbind14/demo/gap/gapbind_demo.gi +10 -0
  214. gap/pkg/semigroups/gapbind14/demo/init.g +16 -0
  215. gap/pkg/semigroups/gapbind14/demo/makedoc.g +10 -0
  216. gap/pkg/semigroups/gapbind14/demo/read.g +6 -0
  217. gap/pkg/semigroups/gapbind14/demo/src/gapbind_demo.cc +142 -0
  218. gap/pkg/semigroups/gapbind14/demo/tst/testall.g +12 -0
  219. gap/pkg/semigroups/gapbind14/include/gapbind14/cpp_fn.hpp +223 -0
  220. gap/pkg/semigroups/gapbind14/include/gapbind14/gap_include.hpp +26 -0
  221. gap/pkg/semigroups/gapbind14/include/gapbind14/gapbind14.hpp +445 -0
  222. gap/pkg/semigroups/gapbind14/include/gapbind14/tame_free_fn.hpp +420 -0
  223. gap/pkg/semigroups/gapbind14/include/gapbind14/tame_mem_fn.hpp +556 -0
  224. gap/pkg/semigroups/gapbind14/include/gapbind14/to_cpp.hpp +162 -0
  225. gap/pkg/semigroups/gapbind14/include/gapbind14/to_gap.hpp +158 -0
  226. gap/pkg/semigroups/gapbind14/src/.clang-format +108 -0
  227. gap/pkg/semigroups/gapbind14/src/gapbind14.cpp +334 -0
  228. gap/pkg/semigroups/init.g +150 -0
  229. gap/pkg/semigroups/m4/ax_append_flag.m4 +50 -0
  230. gap/pkg/semigroups/m4/ax_check_compile_flag.m4 +53 -0
  231. gap/pkg/semigroups/m4/ax_check_hpcombi.m4 +121 -0
  232. gap/pkg/semigroups/m4/ax_check_libsemigroup.m4 +68 -0
  233. gap/pkg/semigroups/m4/ax_compare_version.m4 +177 -0
  234. gap/pkg/semigroups/m4/ax_cxx_compile_stdcxx.m4 +1009 -0
  235. gap/pkg/semigroups/m4/ax_cxx_compile_stdcxx_14.m4 +34 -0
  236. gap/pkg/semigroups/m4/ax_prefix_config_h.m4 +203 -0
  237. gap/pkg/semigroups/m4/ax_pthread.m4 +522 -0
  238. gap/pkg/semigroups/m4/find_gap.m4 +94 -0
  239. gap/pkg/semigroups/makedoc.g +153 -0
  240. gap/pkg/semigroups/prerequisites.sh +62 -0
  241. gap/pkg/semigroups/read.g +105 -0
  242. gap/pkg/semigroups/release.toml +6 -0
  243. gap/pkg/semigroups/tst/extreme/README +2 -0
  244. gap/pkg/semigroups/tst/extreme/attrinv.tst +703 -0
  245. gap/pkg/semigroups/tst/extreme/bipart.tst +2803 -0
  246. gap/pkg/semigroups/tst/extreme/closure.tst +652 -0
  247. gap/pkg/semigroups/tst/extreme/cong.tst +286 -0
  248. gap/pkg/semigroups/tst/extreme/conginv.tst +43 -0
  249. gap/pkg/semigroups/tst/extreme/examples.tst +2449 -0
  250. gap/pkg/semigroups/tst/extreme/freeband.tst +37 -0
  251. gap/pkg/semigroups/tst/extreme/greens-acting-regular.tst +27 -0
  252. gap/pkg/semigroups/tst/extreme/greens-acting.tst +1999 -0
  253. gap/pkg/semigroups/tst/extreme/ideals.tst +858 -0
  254. gap/pkg/semigroups/tst/extreme/inverse.tst +1025 -0
  255. gap/pkg/semigroups/tst/extreme/maximal.tst +856 -0
  256. gap/pkg/semigroups/tst/extreme/misc.tst +4236 -0
  257. gap/pkg/semigroups/tst/extreme/monoid_pkg.tst +1488 -0
  258. gap/pkg/semigroups/tst/extreme/properties.tst +914 -0
  259. gap/pkg/semigroups/tst/extreme/semibipart.tst +2837 -0
  260. gap/pkg/semigroups/tst/extreme/semieunit.tst +49 -0
  261. gap/pkg/semigroups/tst/extreme/semiffmat.tst +353 -0
  262. gap/pkg/semigroups/tst/extreme/semigroups.tst +245 -0
  263. gap/pkg/semigroups/tst/extreme/semiiter.tst +58 -0
  264. gap/pkg/semigroups/tst/extreme/semirms.tst +1091 -0
  265. gap/pkg/semigroups/tst/extreme/transform.tst +305 -0
  266. gap/pkg/semigroups/tst/extreme/translat.tst +44 -0
  267. gap/pkg/semigroups/tst/standard/README +2 -0
  268. gap/pkg/semigroups/tst/standard/attributes/acting.tst +388 -0
  269. gap/pkg/semigroups/tst/standard/attributes/attr.tst +2404 -0
  270. gap/pkg/semigroups/tst/standard/attributes/dual.tst +308 -0
  271. gap/pkg/semigroups/tst/standard/attributes/factor.tst +629 -0
  272. gap/pkg/semigroups/tst/standard/attributes/homomorph.tst +1134 -0
  273. gap/pkg/semigroups/tst/standard/attributes/inverse.tst +1521 -0
  274. gap/pkg/semigroups/tst/standard/attributes/isomorph.tst +435 -0
  275. gap/pkg/semigroups/tst/standard/attributes/isorms.tst +1147 -0
  276. gap/pkg/semigroups/tst/standard/attributes/maximal.tst +853 -0
  277. gap/pkg/semigroups/tst/standard/attributes/properties.tst +2028 -0
  278. gap/pkg/semigroups/tst/standard/attributes/semifp.tst +53 -0
  279. gap/pkg/semigroups/tst/standard/attributes/translat.tst +796 -0
  280. gap/pkg/semigroups/tst/standard/congruences/cong.tst +1044 -0
  281. gap/pkg/semigroups/tst/standard/congruences/conginv.tst +292 -0
  282. gap/pkg/semigroups/tst/standard/congruences/conglatt.tst +421 -0
  283. gap/pkg/semigroups/tst/standard/congruences/congpairs.tst +1011 -0
  284. gap/pkg/semigroups/tst/standard/congruences/congrees.tst +288 -0
  285. gap/pkg/semigroups/tst/standard/congruences/congrms.tst +701 -0
  286. gap/pkg/semigroups/tst/standard/congruences/congsemigraph.tst +422 -0
  287. gap/pkg/semigroups/tst/standard/congruences/congsimple.tst +311 -0
  288. gap/pkg/semigroups/tst/standard/congruences/conguniv.tst +259 -0
  289. gap/pkg/semigroups/tst/standard/congruences/congwordgraph.tst +330 -0
  290. gap/pkg/semigroups/tst/standard/elements/bipart.tst +783 -0
  291. gap/pkg/semigroups/tst/standard/elements/blocks.tst +166 -0
  292. gap/pkg/semigroups/tst/standard/elements/boolmat.tst +608 -0
  293. gap/pkg/semigroups/tst/standard/elements/elements.tst +117 -0
  294. gap/pkg/semigroups/tst/standard/elements/ffmat.tst +349 -0
  295. gap/pkg/semigroups/tst/standard/elements/maxplusmat.tst +613 -0
  296. gap/pkg/semigroups/tst/standard/elements/pbr.tst +506 -0
  297. gap/pkg/semigroups/tst/standard/elements/pperm.tst +32 -0
  298. gap/pkg/semigroups/tst/standard/elements/semiringmat.tst +601 -0
  299. gap/pkg/semigroups/tst/standard/elements/trans.tst +58 -0
  300. gap/pkg/semigroups/tst/standard/fp/freeband.tst +311 -0
  301. gap/pkg/semigroups/tst/standard/fp/freeinverse.tst +147 -0
  302. gap/pkg/semigroups/tst/standard/fp/tietze.tst +780 -0
  303. gap/pkg/semigroups/tst/standard/fp/word.tst +106 -0
  304. gap/pkg/semigroups/tst/standard/greens/acting-inverse.tst +545 -0
  305. gap/pkg/semigroups/tst/standard/greens/acting-regular.tst +396 -0
  306. gap/pkg/semigroups/tst/standard/greens/acting.tst +2033 -0
  307. gap/pkg/semigroups/tst/standard/greens/froidure-pin.tst +1831 -0
  308. gap/pkg/semigroups/tst/standard/greens/generic.tst +1436 -0
  309. gap/pkg/semigroups/tst/standard/ideals/acting.tst +279 -0
  310. gap/pkg/semigroups/tst/standard/ideals/froidure-pin.tst +178 -0
  311. gap/pkg/semigroups/tst/standard/ideals/ideals.tst +380 -0
  312. gap/pkg/semigroups/tst/standard/libsemigroups/cong.tst +310 -0
  313. gap/pkg/semigroups/tst/standard/libsemigroups/froidure-pin.tst +778 -0
  314. gap/pkg/semigroups/tst/standard/libsemigroups/sims1.tst +379 -0
  315. gap/pkg/semigroups/tst/standard/main/acting.tst +411 -0
  316. gap/pkg/semigroups/tst/standard/main/froidure-pin.tst +392 -0
  317. gap/pkg/semigroups/tst/standard/main/semiact.tst +203 -0
  318. gap/pkg/semigroups/tst/standard/main/setup.tst +1144 -0
  319. gap/pkg/semigroups/tst/standard/obsolete.tst +19 -0
  320. gap/pkg/semigroups/tst/standard/options.tst +54 -0
  321. gap/pkg/semigroups/tst/standard/semigroups/grpperm.tst +581 -0
  322. gap/pkg/semigroups/tst/standard/semigroups/semibipart.tst +2635 -0
  323. gap/pkg/semigroups/tst/standard/semigroups/semiboolmat.tst +1871 -0
  324. gap/pkg/semigroups/tst/standard/semigroups/semicons.tst +1173 -0
  325. gap/pkg/semigroups/tst/standard/semigroups/semidp.tst +739 -0
  326. gap/pkg/semigroups/tst/standard/semigroups/semieunit.tst +339 -0
  327. gap/pkg/semigroups/tst/standard/semigroups/semiex.tst +2055 -0
  328. gap/pkg/semigroups/tst/standard/semigroups/semiffmat.tst +746 -0
  329. gap/pkg/semigroups/tst/standard/semigroups/semifp.tst +2702 -0
  330. gap/pkg/semigroups/tst/standard/semigroups/semigraph.tst +133 -0
  331. gap/pkg/semigroups/tst/standard/semigroups/semigrp.tst +1112 -0
  332. gap/pkg/semigroups/tst/standard/semigroups/semimaxplus.tst +654 -0
  333. gap/pkg/semigroups/tst/standard/semigroups/semipbr.tst +2142 -0
  334. gap/pkg/semigroups/tst/standard/semigroups/semipperm.tst +2169 -0
  335. gap/pkg/semigroups/tst/standard/semigroups/semiquo.tst +278 -0
  336. gap/pkg/semigroups/tst/standard/semigroups/semirms.tst +3010 -0
  337. gap/pkg/semigroups/tst/standard/semigroups/semitrans.tst +2758 -0
  338. gap/pkg/semigroups/tst/standard/tools/display.tst +1040 -0
  339. gap/pkg/semigroups/tst/standard/tools/io.tst +363 -0
  340. gap/pkg/semigroups/tst/testinstall.tst +1815 -0
  341. gap/pkg/semigroups/tst/teststandard.g +22 -0
  342. gap/pkg/semigroups/tst/workspaces/load-workspace.tst +142 -0
  343. gap/pkg/semigroups/tst/workspaces/load.g +11 -0
  344. gap/pkg/semigroups/tst/workspaces/save-workspace.tst +166 -0
  345. gap/pkg/semigroups/tst/workspaces/save.g +14 -0
  346. passagemath_gap_pkg_semigroups-10.6.30.dist-info/METADATA +93 -0
  347. passagemath_gap_pkg_semigroups-10.6.30.dist-info/METADATA.bak +94 -0
  348. passagemath_gap_pkg_semigroups-10.6.30.dist-info/RECORD +354 -0
  349. passagemath_gap_pkg_semigroups-10.6.30.dist-info/WHEEL +6 -0
  350. passagemath_gap_pkg_semigroups-10.6.30.dist-info/top_level.txt +1 -0
  351. passagemath_gap_pkg_semigroups.dylibs/libsemigroups.2.dylib +0 -0
  352. sage/all__sagemath_gap_pkg_semigroups.py +1 -0
  353. sage/libs/all__sagemath_gap_pkg_semigroups.py +1 -0
  354. sage/libs/gap_pkg_semigroups.cpython-310-darwin.so +0 -0
@@ -0,0 +1,995 @@
1
+ ############################################################################
2
+ ##
3
+ ## elements/bipart.gi
4
+ ## Copyright (C) 2013-2022 James D. Mitchell
5
+ ##
6
+ ## Licensing information can be found in the README file of this package.
7
+ ##
8
+ #############################################################################
9
+ ##
10
+
11
+ #############################################################################
12
+ # Family and type.
13
+ #
14
+ # One per degree to avoid lists with bipartitions of different degrees
15
+ # belonging to IsAssociativeElementCollection.
16
+ #############################################################################
17
+
18
+ BindGlobal("TYPES_BIPART", []);
19
+ BindGlobal("TYPE_BIPART",
20
+ function(n)
21
+ local fam, type;
22
+
23
+ n := n + 1; # since the degree can be 0
24
+
25
+ if IsBound(TYPES_BIPART[n]) then
26
+ return TYPES_BIPART[n];
27
+ fi;
28
+
29
+ fam := NewFamily(Concatenation("BipartitionFamily", String(n - 1)),
30
+ IsBipartition,
31
+ CanEasilySortElements,
32
+ CanEasilySortElements);
33
+
34
+ type := NewType(fam,
35
+ IsBipartition and IsInternalRep);
36
+ TYPES_BIPART[n] := type;
37
+ return type;
38
+ end);
39
+
40
+ #############################################################################
41
+ # Pickler
42
+ #############################################################################
43
+
44
+ InstallMethod(IO_Pickle, "for a bipartition",
45
+ [IsFile, IsBipartition],
46
+ function(file, x)
47
+ if IO_Write(file, "BIPA") = fail then
48
+ return IO_Error;
49
+ fi;
50
+ return IO_Pickle(file, IntRepOfBipartition(x));
51
+ end);
52
+
53
+ IO_Unpicklers.BIPA := function(file)
54
+ local blocks;
55
+
56
+ blocks := IO_Unpickle(file);
57
+ if blocks = IO_Error then
58
+ return IO_Error;
59
+ fi;
60
+ return BIPART_NC(blocks);
61
+ end;
62
+
63
+ #############################################################################
64
+ # Implications
65
+ #############################################################################
66
+
67
+ InstallTrueMethod(IsPermBipartition, IsTransBipartition
68
+ and IsDualTransBipartition);
69
+
70
+ InstallTrueMethod(IsBlockBijection, IsPermBipartition);
71
+
72
+ #############################################################################
73
+ # GAP level - directly using interface to C/C++ level
74
+ #############################################################################
75
+
76
+ # Fundamental attributes
77
+
78
+ InstallMethod(DegreeOfBipartition, "for a bipartition",
79
+ [IsBipartition], BIPART_DEGREE);
80
+
81
+ InstallMethod(NrBlocks, "for a bipartition",
82
+ [IsBipartition], BIPART_NR_BLOCKS);
83
+
84
+ InstallMethod(NrLeftBlocks, "for a bipartition",
85
+ [IsBipartition], BIPART_NR_LEFT_BLOCKS);
86
+
87
+ InstallMethod(RankOfBipartition, "for a bipartition",
88
+ [IsBipartition], x -> BIPART_RANK(x, 0));
89
+
90
+ # Constructors
91
+
92
+ InstallGlobalFunction(Bipartition,
93
+ function(classes)
94
+ local n, copy, i, j;
95
+
96
+ if not IsList(classes)
97
+ or ForAny(classes, x -> not IsHomogeneousList(x)
98
+ or not IsDuplicateFree(x)) then
99
+ ErrorNoReturn("the argument does not consist of duplicate-free ",
100
+ "homogeneous lists");
101
+ fi;
102
+
103
+ n := Sum(classes, Length) / 2;
104
+
105
+ if n >= 2 ^ 29 then
106
+ ErrorNoReturn("the maximum degree of a bipartition is 2 ^ 29 - 1");
107
+ elif not ForAll(classes, x -> ForAll(x,
108
+ i -> (IsPosInt(i) or IsNegInt(i))
109
+ and AbsInt(i) <= n)) then
110
+ ErrorNoReturn("the argument does not consist of lists of ",
111
+ "integers from [-", n, " .. -1, 1 .. ", n, "]");
112
+ elif not IsEmpty(classes)
113
+ and Union(classes) <> Concatenation([-n .. -1], [1 .. n]) then
114
+ ErrorNoReturn("the union of the argument <classes> is not ",
115
+ "[-", n, " .. -1, 1 .. ", n, "]");
116
+ fi;
117
+
118
+ copy := List(classes, ShallowCopy);
119
+ for i in [1 .. Length(copy)] do
120
+ for j in [1 .. Length(copy[i])] do
121
+ if copy[i][j] < 0 then
122
+ copy[i][j] := AbsInt(copy[i][j]) + n;
123
+ fi;
124
+ od;
125
+ od;
126
+
127
+ Perform(copy, Sort);
128
+ Sort(copy);
129
+
130
+ for i in [1 .. Length(copy)] do
131
+ for j in [1 .. Length(copy[i])] do
132
+ if copy[i][j] > n then
133
+ copy[i][j] := -copy[i][j] + n;
134
+ fi;
135
+ od;
136
+ od;
137
+ return BIPART_NC(copy);
138
+ end);
139
+
140
+ InstallMethod(BipartitionByIntRep, "for a list", [IsHomogeneousList],
141
+ function(blocks)
142
+ local n, next, seen, i;
143
+ n := Length(blocks);
144
+ if not IsEvenInt(n) then
145
+ ErrorNoReturn("the degree of a bipartition must be even, found ", n);
146
+ elif n >= 2 ^ 30 then
147
+ ErrorNoReturn("the length of the argument (a list) exceeds ",
148
+ "2 ^ 30 - 1");
149
+ elif not (IsEmpty(blocks) or IsPosInt(blocks[1])) then
150
+ ErrorNoReturn("the items in the argument (a list) must be positive ",
151
+ "integers");
152
+ fi;
153
+
154
+ next := 0;
155
+ seen := BlistList([1 .. Maximum(blocks)], []);
156
+
157
+ for i in [1 .. n] do
158
+ if not seen[blocks[i]] then
159
+ next := next + 1;
160
+ if blocks[i] <> next then
161
+ ErrorNoReturn("expected ", next, " but found ", blocks[i],
162
+ ", in position ", i);
163
+ fi;
164
+ seen[blocks[i]] := true;
165
+ fi;
166
+ od;
167
+
168
+ return BIPART_NC(blocks);
169
+ end);
170
+
171
+ InstallMethod(IdentityBipartition, "for zero", [IsZeroCyc],
172
+ _ -> Bipartition([]));
173
+
174
+ InstallMethod(IdentityBipartition, "for a positive integer", [IsPosInt],
175
+ function(n)
176
+ local blocks, i;
177
+
178
+ if n >= 2 ^ 29 then
179
+ ErrorNoReturn("the argument (a pos. int) must not exceed 2 ^ 29 - 1");
180
+ fi;
181
+ blocks := EmptyPlist(2 * n);
182
+
183
+ for i in [1 .. n] do
184
+ blocks[i] := i;
185
+ blocks[i + n] := i;
186
+ od;
187
+
188
+ return BIPART_NC(blocks);
189
+ end);
190
+
191
+ InstallMethod(RandomBipartition, "for a random source and pos int",
192
+ [IsRandomSource, IsPosInt],
193
+ function(rs, n)
194
+ local out, nrblocks, vals, j, i;
195
+
196
+ if n >= 2 ^ 29 then
197
+ ErrorNoReturn("the argument (a pos. int.) must not exceed 2 ^ 29 - 1");
198
+ fi;
199
+ out := EmptyPlist(2 * n);
200
+ nrblocks := 0;
201
+ vals := [1];
202
+
203
+ for i in [1 .. 2 * n] do
204
+ j := Random(rs, vals);
205
+ if j = nrblocks + 1 then
206
+ nrblocks := nrblocks + 1;
207
+ Add(vals, nrblocks + 1);
208
+ fi;
209
+ out[i] := j;
210
+ od;
211
+
212
+ return BIPART_NC(out);
213
+ end);
214
+
215
+ InstallMethod(RandomBipartition, "for a pos int", [IsPosInt],
216
+ n -> RandomBipartition(GlobalMersenneTwister, n));
217
+
218
+ InstallMethod(RandomBlockBijection, "for a random source and pos int",
219
+ [IsRandomSource, IsPosInt],
220
+ function(rs, n)
221
+ local out, nrblocks, j, free, i;
222
+
223
+ if n >= 2 ^ 29 then
224
+ ErrorNoReturn("the argument (a pos. int.) must not exceed 2 ^ 29 - 1");
225
+ fi;
226
+
227
+ out := EmptyPlist(2 * n);
228
+ out[1] := 1;
229
+ nrblocks := 1;
230
+
231
+ for i in [2 .. n] do
232
+ j := Random(rs, [1 .. nrblocks + 1]);
233
+ if j = nrblocks + 1 then
234
+ nrblocks := nrblocks + 1;
235
+ fi;
236
+ out[i] := j;
237
+ od;
238
+
239
+ free := [n + 1 .. 2 * n];
240
+ for i in [1 .. nrblocks] do
241
+ j := Random(rs, free);
242
+ out[j] := i;
243
+ RemoveSet(free, j);
244
+ od;
245
+
246
+ for i in free do
247
+ out[i] := Random(rs, [1 .. nrblocks]);
248
+ od;
249
+
250
+ return BIPART_NC(out);
251
+ end);
252
+
253
+ InstallMethod(RandomBlockBijection, "for a pos int", [IsPosInt],
254
+ n -> RandomBlockBijection(GlobalMersenneTwister, n));
255
+
256
+ # Operators
257
+
258
+ InstallMethod(PermLeftQuoBipartition, "for a bipartition and bipartition",
259
+ IsIdenticalObj, [IsBipartition, IsBipartition],
260
+ function(x, y)
261
+
262
+ if LeftBlocks(x) <> LeftBlocks(y) or RightBlocks(x) <> RightBlocks(y) then
263
+ ErrorNoReturn("the arguments (bipartitions) do not have equal left ",
264
+ "and right blocks");
265
+ fi;
266
+ return BIPART_PERM_LEFT_QUO(x, y);
267
+ end);
268
+
269
+ # Attributes
270
+
271
+ InstallMethod(DomainOfBipartition, "for a bipartition", [IsBipartition],
272
+ function(x)
273
+ local out;
274
+ out := [];
275
+ for x in ExtRepOfObj(LeftBlocks(x)) do
276
+ if IsPosInt(x[1]) then
277
+ Append(out, x);
278
+ fi;
279
+ od;
280
+ return out;
281
+ end);
282
+
283
+ InstallMethod(CodomainOfBipartition, "for a bipartition", [IsBipartition],
284
+ function(x)
285
+ local out;
286
+ out := [];
287
+ for x in ExtRepOfObj(RightBlocks(x)) do
288
+ if IsPosInt(x[1]) then
289
+ Append(out, -x);
290
+ fi;
291
+ od;
292
+ return out;
293
+ end);
294
+
295
+ InstallMethod(ExtRepOfObj, "for a bipartition", [IsBipartition],
296
+ BIPART_EXT_REP);
297
+
298
+ InstallMethod(IntRepOfBipartition, "for a bipartition", [IsBipartition],
299
+ BIPART_INT_REP);
300
+
301
+ # xx ^ * - linear - 2 * degree
302
+
303
+ InstallMethod(LeftProjection, "for a bipartition", [IsBipartition],
304
+ BIPART_LEFT_PROJ);
305
+
306
+ InstallMethod(RightProjection, "for a bipartition", [IsBipartition],
307
+ BIPART_RIGHT_PROJ);
308
+
309
+ # linear - 2 * degree
310
+
311
+ InstallMethod(StarOp, "for a bipartition", [IsBipartition], BIPART_STAR);
312
+
313
+ InstallMethod(ChooseHashFunction, "for a bipartition",
314
+ [IsBipartition, IsInt],
315
+ {_, hashlen} -> rec(func := BIPART_HASH, data := hashlen));
316
+
317
+ #############################################################################
318
+ # GAP level
319
+ #############################################################################
320
+
321
+ # Attributes
322
+
323
+ # not a synonym since NrTransverseBlocks also applies to blocks
324
+
325
+ InstallMethod(NrTransverseBlocks, "for a bipartition", [IsBipartition],
326
+ RankOfBipartition);
327
+
328
+ InstallMethod(NrRightBlocks, "for a bipartition", [IsBipartition],
329
+ x -> NrBlocks(x) - NrLeftBlocks(x) + NrTransverseBlocks(x));
330
+
331
+ InstallMethod(OneMutable, "for a bipartition",
332
+ [IsBipartition], x -> IdentityBipartition(DegreeOfBipartition(x)));
333
+
334
+ InstallMethod(OneMutable, "for a bipartition collection",
335
+ [IsBipartitionCollection], x ->
336
+ IdentityBipartition(DegreeOfBipartitionCollection(x)));
337
+
338
+ # the Other is to avoid warning on opening GAP
339
+
340
+ InstallOtherMethod(InverseMutable, "for a bipartition", [IsBipartition],
341
+ function(x)
342
+ if IsBlockBijection(x) or IsPartialPermBipartition(x) then
343
+ return Star(x);
344
+ fi;
345
+ return fail;
346
+ end);
347
+
348
+ # Properties
349
+
350
+ InstallMethod(IsBlockBijection, "for a bipartition",
351
+ [IsBipartition],
352
+ x -> NrBlocks(x) = NrLeftBlocks(x) and NrRightBlocks(x) = NrLeftBlocks(x));
353
+
354
+ InstallMethod(IsPartialPermBipartition, "for a bipartition",
355
+ [IsBipartition],
356
+ function(x)
357
+ return NrLeftBlocks(x) = DegreeOfBipartition(x)
358
+ and NrRightBlocks(x) = DegreeOfBipartition(x);
359
+ end);
360
+
361
+ # a bipartition is a transformation if and only if the second row is a
362
+ # permutation of [1 .. n], where n is the degree.
363
+
364
+ InstallMethod(IsTransBipartition, "for a bipartition",
365
+ [IsBipartition],
366
+ function(x)
367
+ return NrLeftBlocks(x) = NrTransverseBlocks(x)
368
+ and NrRightBlocks(x) = DegreeOfBipartition(x);
369
+ end);
370
+
371
+ InstallMethod(IsDualTransBipartition, "for a bipartition", [IsBipartition],
372
+ function(x)
373
+ return NrRightBlocks(x) = NrTransverseBlocks(x)
374
+ and NrLeftBlocks(x) = DegreeOfBipartition(x);
375
+ end);
376
+
377
+ InstallMethod(IsPermBipartition, "for a bipartition",
378
+ [IsBipartition],
379
+ function(x)
380
+ return IsPartialPermBipartition(x)
381
+ and NrTransverseBlocks(x) = DegreeOfBipartition(x);
382
+ end);
383
+
384
+ # Fundamental operators
385
+
386
+ InstallMethod(\*, "for a bipartition and a perm",
387
+ [IsBipartition, IsPerm],
388
+ function(x, p)
389
+ if LargestMovedPoint(p) <= DegreeOfBipartition(x) then
390
+ return x * AsBipartition(p, DegreeOfBipartition(x));
391
+ fi;
392
+ ErrorNoReturn("the largest moved point of the 2nd argument ",
393
+ "(a permutation) exceeds",
394
+ " the degree of the 1st argument (a bipartition)");
395
+ end);
396
+
397
+ InstallMethod(\*, "for a perm and a bipartition",
398
+ [IsPerm, IsBipartition],
399
+ function(p, x)
400
+ if LargestMovedPoint(p) <= DegreeOfBipartition(x) then
401
+ return AsBipartition(p, DegreeOfBipartition(x)) * x;
402
+ fi;
403
+ ErrorNoReturn("the largest moved point of the 1st argument ",
404
+ "(a permutation) exceeds",
405
+ " the degree of the 2nd argument (a bipartition)");
406
+ end);
407
+
408
+ InstallMethod(\*, "for a bipartition and a transformation",
409
+ [IsBipartition, IsTransformation],
410
+ function(x, f)
411
+ if DegreeOfTransformation(f) <= DegreeOfBipartition(x) then
412
+ return x * AsBipartition(f, DegreeOfBipartition(x));
413
+ fi;
414
+ ErrorNoReturn("the degree of the 2nd argument (a transformation)",
415
+ " exceeds the degree of the 1st argument",
416
+ " (a bipartition)");
417
+ end);
418
+
419
+ InstallMethod(\*, "for a transformation and a bipartition",
420
+ [IsTransformation, IsBipartition],
421
+ function(f, g)
422
+ if DegreeOfTransformation(f) <= DegreeOfBipartition(g) then
423
+ return AsBipartition(f, DegreeOfBipartition(g)) * g;
424
+ fi;
425
+ ErrorNoReturn("the degree of the 1st argument (a transformation)",
426
+ " exceeds the degree of the 2nd argument",
427
+ " (a bipartition)");
428
+ end);
429
+
430
+ InstallMethod(\*, "for a bipartition and a partial perm",
431
+ [IsBipartition, IsPartialPerm],
432
+ function(f, g)
433
+ local n;
434
+ n := DegreeOfBipartition(f);
435
+ if ForAll([1 .. n], i -> i ^ g <= n) then
436
+ return f * AsBipartition(g, DegreeOfBipartition(f));
437
+ fi;
438
+ ErrorNoReturn("the 2nd argument (a partial perm) does not map ",
439
+ "[1 .. ", String(n), "] into [1 .. ", String(n), "]");
440
+ end);
441
+
442
+ InstallMethod(\*, "for a partial perm and a bipartition",
443
+ [IsPartialPerm, IsBipartition],
444
+ function(f, g)
445
+ local n;
446
+ n := DegreeOfBipartition(g);
447
+ if ForAll([1 .. n], i -> i ^ f <= n) then
448
+ return AsBipartition(f, DegreeOfBipartition(g)) * g;
449
+ fi;
450
+ ErrorNoReturn("the 1st argument (a partial perm) does not map [1 .. ",
451
+ String(n), "] into [1 .. ", String(n), "]");
452
+ end);
453
+
454
+ InstallMethod(\^, "for a bipartition and permutation",
455
+ [IsBipartition, IsPerm],
456
+ {f, p} -> p ^ -1 * f * p);
457
+
458
+ # Other operators
459
+
460
+ InstallMethod(PartialPermLeqBipartition, "for a bipartition and a bipartition",
461
+ IsIdenticalObj, [IsBipartition, IsBipartition],
462
+ function(x, y)
463
+ if not (IsPartialPermBipartition(x) and IsPartialPermBipartition(y)) then
464
+ ErrorNoReturn("the arguments (bipartitions) do not both satisfy ",
465
+ "IsPartialPermBipartition");
466
+ fi;
467
+
468
+ return AsPartialPerm(x) < AsPartialPerm(y);
469
+ end);
470
+
471
+ # Changing representations
472
+
473
+ InstallMethod(AsBipartition, "for a permutation and zero",
474
+ [IsPerm, IsZeroCyc],
475
+ {f, n} -> Bipartition([]));
476
+
477
+ InstallMethod(AsBipartition, "for a permutation",
478
+ [IsPerm], x -> AsBipartition(x, LargestMovedPoint(x)));
479
+
480
+ InstallMethod(AsBipartition, "for a partial perm",
481
+ [IsPartialPerm],
482
+ function(x)
483
+ return AsBipartition(x, Maximum(DegreeOfPartialPerm(x),
484
+ CodegreeOfPartialPerm(x)));
485
+ end);
486
+
487
+ InstallMethod(AsBipartition, "for a partial perm and zero",
488
+ [IsPartialPerm, IsZeroCyc],
489
+ {f, n} -> Bipartition([]));
490
+
491
+ InstallMethod(AsBipartition, "for a transformation",
492
+ [IsTransformation], x -> AsBipartition(x, DegreeOfTransformation(x)));
493
+
494
+ InstallMethod(AsBipartition, "for a transformation and zero",
495
+ [IsTransformation, IsZeroCyc],
496
+ {f, n} -> Bipartition([]));
497
+
498
+ InstallMethod(AsBipartition, "for a bipartition", [IsBipartition], IdFunc);
499
+
500
+ InstallMethod(AsBipartition, "for a bipartition", [IsBipartition, IsZeroCyc],
501
+ {f, n} -> Bipartition([]));
502
+
503
+ InstallMethod(AsBipartition, "for a pbr and pos int",
504
+ [IsPBR, IsZeroCyc],
505
+ {x, deg} -> Bipartition([]));
506
+
507
+ InstallMethod(AsBipartition, "for a pbr and pos int",
508
+ [IsPBR, IsPosInt],
509
+ function(x, deg)
510
+ if not IsBipartitionPBR(x) then
511
+ ErrorNoReturn("the 1st argument (a pbr) does not satisfy",
512
+ " 'IsBipartitionPBR'");
513
+ fi;
514
+
515
+ return AsBipartition(AsBipartition(x), deg);
516
+ end);
517
+
518
+ InstallMethod(AsBipartition, "for a pbr",
519
+ [IsPBR],
520
+ function(x)
521
+ if not IsBipartitionPBR(x) then
522
+ ErrorNoReturn("the argument (a pbr) does not satisfy 'IsBipartitionPBR'");
523
+ fi;
524
+ return Bipartition(Union(ExtRepOfObj(x)));
525
+ end);
526
+
527
+ InstallMethod(AsBlockBijection, "for a partial perm",
528
+ [IsPartialPerm],
529
+ function(x)
530
+ return AsBlockBijection(x, Maximum(DegreeOfPartialPerm(x),
531
+ CodegreeOfPartialPerm(x)) + 1);
532
+ end);
533
+
534
+ # Viewing, printing etc
535
+
536
+ InstallMethod(ViewString, "for a bipartition",
537
+ [IsBipartition],
538
+ function(x)
539
+ local str, ext, i;
540
+
541
+ if DegreeOfBipartition(x) = 0 then
542
+ return "\><empty bipartition>\<";
543
+ elif IsBlockBijection(x) then
544
+ str := "\>\><block bijection:\< ";
545
+ else
546
+ str := "\>\><bipartition:\< ";
547
+ fi;
548
+
549
+ ext := ExtRepOfObj(x);
550
+ Append(str, "\>");
551
+ Append(str, String(ext[1]));
552
+ Append(str, "\<");
553
+
554
+ for i in [2 .. Length(ext)] do
555
+ Append(str, ", \>");
556
+ Append(str, String(ext[i]));
557
+ Append(str, "\<");
558
+ od;
559
+ Append(str, ">\<");
560
+ return str;
561
+ end);
562
+
563
+ InstallMethod(String, "for a bipartition", [IsBipartition],
564
+ x -> Concatenation("Bipartition(", String(ExtRepOfObj(x)), ")"));
565
+
566
+ InstallMethod(PrintString, "for a bipartition",
567
+ [IsBipartition],
568
+ function(x)
569
+ local ext, str, i;
570
+ if DegreeOfBipartition(x) = 0 then
571
+ return "\>\>Bipartition(\< \>[]\<)\<";
572
+ fi;
573
+ ext := ExtRepOfObj(x);
574
+ str := Concatenation("\>\>Bipartition(\< \>[ ", PrintString(ext[1]));
575
+ for i in [2 .. Length(ext)] do
576
+ Append(str, ",\< \>");
577
+ Append(str, PrintString(ext[i]));
578
+ od;
579
+ Append(str, " \<]");
580
+ Append(str, " )\<");
581
+ return str;
582
+ end);
583
+
584
+ InstallMethod(PrintString, "for a bipartition collection",
585
+ [IsBipartitionCollection],
586
+ function(coll)
587
+ local str, i;
588
+
589
+ if IsGreensClass(coll) or IsSemigroup(coll) then
590
+ TryNextMethod();
591
+ fi;
592
+
593
+ str := "\>[ ";
594
+ for i in [1 .. Length(coll)] do
595
+ if i <> 1 then
596
+ Append(str, " ");
597
+ fi;
598
+ Append(str, "\>");
599
+ Append(str, PrintString(coll[i]));
600
+ if i <> Length(coll) then
601
+ Append(str, ",\<\n");
602
+ else
603
+ Append(str, " ]\<\n");
604
+ fi;
605
+ od;
606
+ return str;
607
+ end);
608
+
609
+ # Bipartition collections
610
+
611
+ InstallMethod(DegreeOfBipartitionCollection, "for a bipartition semigroup",
612
+ [IsBipartitionSemigroup], DegreeOfBipartitionSemigroup);
613
+
614
+ InstallMethod(DegreeOfBipartitionCollection, "for a bipartition collection",
615
+ [IsBipartitionCollection],
616
+ {coll} -> DegreeOfBipartition(coll[1]));
617
+
618
+ #############################################################################
619
+ # All of the methods in this section could be done in C/C++
620
+ #############################################################################
621
+
622
+ # Change representations . . .
623
+
624
+ InstallMethod(AsBipartition, "for a permutation and pos int",
625
+ [IsPerm, IsPosInt],
626
+ function(x, n)
627
+ if n >= 2 ^ 29 then
628
+ ErrorNoReturn("the 2nd argument (a pos. int.) exceeds 2 ^ 29 - 1");
629
+ elif OnSets([1 .. n], x) <> [1 .. n] then
630
+ ErrorNoReturn("the 1st argument (a permutation) does not permute ",
631
+ "[1 .. ", String(n), "]");
632
+ fi;
633
+ return BIPART_NC(Concatenation([1 .. n], ListPerm(x ^ -1, n)));
634
+ end);
635
+
636
+ InstallMethod(AsPartialPerm, "for a bipartition", [IsBipartition],
637
+ function(x)
638
+ local n, blocks, nrleft, im, out, i;
639
+
640
+ if not IsPartialPermBipartition(x) then
641
+ ErrorNoReturn("the argument (a bipartition) does not define ",
642
+ "a partial perm");
643
+ fi;
644
+
645
+ n := DegreeOfBipartition(x);
646
+ blocks := IntRepOfBipartition(x);
647
+ nrleft := NrLeftBlocks(x);
648
+ im := [1 .. n] * 0;
649
+
650
+ for i in [n + 1 .. 2 * n] do
651
+ if blocks[i] <= nrleft then
652
+ im[blocks[i]] := i - n;
653
+ fi;
654
+ od;
655
+
656
+ out := EmptyPlist(n);
657
+ for i in [1 .. n] do
658
+ out[i] := im[blocks[i]];
659
+ od;
660
+ return PartialPermNC(out);
661
+ end);
662
+
663
+ InstallMethod(AsPermutation, "for a bipartition", [IsBipartition],
664
+ function(x)
665
+ local n, blocks, im, out, i;
666
+
667
+ if not IsPermBipartition(x) then
668
+ ErrorNoReturn("the argument (a bipartition) does not define a ",
669
+ "permutation");
670
+ fi;
671
+
672
+ n := DegreeOfBipartition(x);
673
+ blocks := IntRepOfBipartition(x);
674
+ im := EmptyPlist(n);
675
+
676
+ for i in [n + 1 .. 2 * n] do
677
+ im[blocks[i]] := i - n;
678
+ od;
679
+
680
+ out := EmptyPlist(n);
681
+ for i in [1 .. n] do
682
+ out[i] := im[blocks[i]];
683
+ od;
684
+ return PermList(out);
685
+ end);
686
+
687
+ InstallMethod(AsTransformation, "for a bipartition", [IsBipartition],
688
+ function(x)
689
+ local n, blocks, nr, im, out, i;
690
+
691
+ if not IsTransBipartition(x) then
692
+ ErrorNoReturn("the argument (a bipartition) does not define a ",
693
+ "transformation");
694
+ fi;
695
+
696
+ n := DegreeOfBipartition(x);
697
+ blocks := IntRepOfBipartition(x);
698
+ nr := NrLeftBlocks(x);
699
+ im := EmptyPlist(n);
700
+
701
+ for i in [n + 1 .. 2 * n] do
702
+ if blocks[i] <= nr then
703
+ im[blocks[i]] := i - n;
704
+ fi;
705
+ od;
706
+
707
+ out := EmptyPlist(n);
708
+ for i in [1 .. n] do
709
+ out[i] := im[blocks[i]];
710
+ od;
711
+ return TransformationNC(out);
712
+ end);
713
+
714
+ InstallMethod(AsBipartition, "for a partial perm and pos int",
715
+ [IsPartialPerm, IsPosInt],
716
+ function(x, n)
717
+ local r, out, y, j, i;
718
+
719
+ if n >= 2 ^ 29 then
720
+ ErrorNoReturn("the 2nd argument (a pos. int.) exceeds 2 ^ 29 - 1");
721
+ fi;
722
+
723
+ r := n;
724
+ out := EmptyPlist(2 * n);
725
+ y := x ^ -1;
726
+
727
+ for i in [1 .. n] do
728
+ out[i] := i;
729
+ j := i ^ y;
730
+ if j <> 0 then
731
+ out[n + i] := j;
732
+ else
733
+ r := r + 1;
734
+ out[n + i] := r;
735
+ fi;
736
+ od;
737
+ return BIPART_NC(out);
738
+ end);
739
+
740
+ InstallMethod(AsBipartition, "for a transformation and a positive integer",
741
+ [IsTransformation, IsPosInt],
742
+ function(f, n)
743
+ local r, ker, out, g, i;
744
+
745
+ if n >= 2 ^ 29 then
746
+ ErrorNoReturn("the 2nd argument (a pos. int.) exceeds 2 ^ 29 - 1");
747
+ elif n < DegreeOfTransformation(f) then
748
+ # Verify f is a transformation on [1 .. n].
749
+ for i in [1 .. n] do
750
+ if i ^ f > n then
751
+ ErrorNoReturn("the 1st argument (a transformation) does not map [1 .. ",
752
+ String(n), "] to itself");
753
+ fi;
754
+ od;
755
+ fi;
756
+
757
+ r := RankOfTransformation(f, n);
758
+ ker := FlatKernelOfTransformation(f, n);
759
+
760
+ out := EmptyPlist(2 * n);
761
+ g := List([1 .. n], x -> 0);
762
+
763
+ # The inverse of f.
764
+ for i in [1 .. n] do
765
+ g[i ^ f] := i;
766
+ od;
767
+
768
+ for i in [1 .. n] do
769
+ out[i] := ker[i];
770
+ if g[i] <> 0 then
771
+ out[n + i] := ker[g[i]];
772
+ else
773
+ r := r + 1;
774
+ out[n + i] := r;
775
+ fi;
776
+ od;
777
+ return BIPART_NC(out);
778
+ end);
779
+
780
+ InstallMethod(AsBipartition, "for a bipartition and pos int",
781
+ [IsBipartition, IsPosInt],
782
+ function(f, n)
783
+ local deg, blocks, out, nrblocks, nrleft, lookup, j, i;
784
+
785
+ if n >= 2 ^ 29 then
786
+ ErrorNoReturn("the 2nd argument (a pos. int.) exceeds 2 ^ 29 - 1");
787
+ fi;
788
+ deg := DegreeOfBipartition(f);
789
+ if n = deg then
790
+ return f;
791
+ fi;
792
+ blocks := IntRepOfBipartition(f);
793
+ out := [];
794
+ nrblocks := 0;
795
+
796
+ if n < deg then
797
+ for i in [1 .. n] do
798
+ out[i] := blocks[i];
799
+ if out[i] > nrblocks then
800
+ nrblocks := nrblocks + 1;
801
+ fi;
802
+ od;
803
+ nrleft := nrblocks;
804
+ lookup := EmptyPlist(NrBlocks(f));
805
+ for i in [n + 1 .. 2 * n] do
806
+ j := blocks[i + deg - n];
807
+ if j > nrleft then
808
+ if not IsBound(lookup[j]) then
809
+ nrblocks := nrblocks + 1;
810
+ lookup[j] := nrblocks;
811
+ fi;
812
+ j := lookup[j];
813
+ fi;
814
+ out[i] := j;
815
+ od;
816
+ else # n > deg
817
+ for i in [1 .. deg] do
818
+ out[i] := blocks[i];
819
+ od;
820
+ nrblocks := NrLeftBlocks(f);
821
+ for i in [deg + 1 .. n] do
822
+ nrblocks := nrblocks + 1;
823
+ out[i] := nrblocks;
824
+ od;
825
+ nrleft := nrblocks; # = n - deg + NrLeftBlocks(f)
826
+ for i in [n + 1 .. n + deg] do
827
+ if blocks[i - n + deg] <= nrleft - n + deg then # it's a left block
828
+ out[i] := blocks[i - n + deg];
829
+ else
830
+ out[i] := blocks[i - n + deg] + n - deg;
831
+ fi;
832
+ od;
833
+ nrblocks := NrBlocks(f) + n - deg;
834
+ for i in [n + deg + 1 .. 2 * n] do
835
+ nrblocks := nrblocks + 1;
836
+ out[i] := nrblocks;
837
+ od;
838
+ fi;
839
+ return BIPART_NC(out);
840
+ end);
841
+
842
+ # same as AsBipartition except that all undefined points are in a single block
843
+ # together with an extra (pair of) points.
844
+
845
+ InstallMethod(AsBlockBijection, "for a partial perm and pos int",
846
+ [IsPartialPerm, IsPosInt],
847
+ function(f, n)
848
+ local bigblock, nr, out, i;
849
+
850
+ if n >= 2 ^ 29 then
851
+ ErrorNoReturn("the 2nd argument (a pos. int.) exceeds 2 ^ 29 - 1");
852
+ elif n <= Maximum(DegreeOfPartialPerm(f), CodegreeOfPartialPerm(f)) then
853
+ ErrorNoReturn("the 2nd argument (a pos. int.) is less than or equal to ",
854
+ "the maximum of the degree and codegree of the ",
855
+ "1st argument (a partial perm)");
856
+ fi;
857
+
858
+ nr := 0;
859
+ out := [1 .. 2 * n] * 0;
860
+ bigblock := n;
861
+
862
+ for i in [1 .. n - 1] do
863
+ if i ^ f = 0 then
864
+ if bigblock = n then
865
+ nr := nr + 1;
866
+ bigblock := nr;
867
+ fi;
868
+ out[i] := bigblock;
869
+ else
870
+ nr := nr + 1;
871
+ out[i] := nr;
872
+ out[n + i ^ f] := nr;
873
+ fi;
874
+ od;
875
+
876
+ out[n] := bigblock;
877
+ out[2 * n] := bigblock;
878
+
879
+ for i in [n + 1 .. 2 * n - 1] do
880
+ if out[i] = 0 then
881
+ out[i] := bigblock;
882
+ fi;
883
+ od;
884
+
885
+ return BIPART_NC(out);
886
+ end);
887
+
888
+ InstallMethod(AsBlockBijection, "for a bipartition and pos int",
889
+ [IsBipartition, IsPosInt],
890
+ function(x, n)
891
+ if not IsPartialPermBipartition(x) then
892
+ ErrorNoReturn("the 1st argument (a bipartition) is not a ",
893
+ "partial perm bipartition");
894
+ fi;
895
+ return AsBlockBijection(AsPartialPerm(x), n);
896
+ end);
897
+
898
+ InstallMethod(AsBlockBijection, "for a bipartition",
899
+ [IsBipartition],
900
+ function(x)
901
+ if not IsPartialPermBipartition(x) then
902
+ ErrorNoReturn("the argument (a bipartion) does not satisfy ",
903
+ "IsPartialPermBipartition");
904
+ fi;
905
+ return AsBlockBijection(AsPartialPerm(x));
906
+ end);
907
+
908
+ InstallMethod(NaturalLeqBlockBijection, "for a bipartition and bipartition",
909
+ IsIdenticalObj, [IsBipartition, IsBipartition],
910
+ function(x, y)
911
+ local xblocks, yblocks, n, lookup, i;
912
+
913
+ if not IsBlockBijection(x) or not IsBlockBijection(y) then
914
+ ErrorNoReturn("the arguments (bipartitions) are not block bijections");
915
+ elif NrBlocks(x) > NrBlocks(y) then
916
+ return false;
917
+ fi;
918
+
919
+ xblocks := IntRepOfBipartition(x);
920
+ yblocks := IntRepOfBipartition(y);
921
+ n := DegreeOfBipartition(x);
922
+
923
+ lookup := [];
924
+ for i in [1 .. n] do
925
+ if IsBound(lookup[yblocks[i]]) and lookup[yblocks[i]] <> xblocks[i] then
926
+ return false;
927
+ else
928
+ lookup[yblocks[i]] := xblocks[i];
929
+ fi;
930
+ od;
931
+ for i in [n + 1 .. 2 * n] do
932
+ if lookup[yblocks[i]] <> xblocks[i] then
933
+ return false;
934
+ fi;
935
+ od;
936
+ return true;
937
+ end);
938
+
939
+ InstallMethod(NaturalLeqPartialPermBipartition,
940
+ "for a bipartition and bipartition",
941
+ IsIdenticalObj, [IsBipartition, IsBipartition],
942
+ function(x, y)
943
+ local n, xblocks, yblocks, val, i;
944
+
945
+ if not IsPartialPermBipartition(x) or not IsPartialPermBipartition(y) then
946
+ ErrorNoReturn("the arguments (bipartitions) are not partial perm ",
947
+ "bipartitions");
948
+ fi;
949
+
950
+ n := DegreeOfBipartition(x);
951
+
952
+ xblocks := IntRepOfBipartition(x);
953
+ yblocks := IntRepOfBipartition(y);
954
+
955
+ for i in [n + 1 .. 2 * n] do
956
+ val := xblocks[i];
957
+ if val <= n and val <> yblocks[i] then
958
+ return false;
959
+ fi;
960
+ od;
961
+ return true;
962
+ end);
963
+
964
+ InstallMethod(IsUniformBlockBijection, "for a bipartition",
965
+ [IsBipartition],
966
+ function(x)
967
+ local blocks, n, sizesleft, sizesright, i;
968
+
969
+ if not IsBlockBijection(x) then
970
+ return false;
971
+ fi;
972
+
973
+ blocks := IntRepOfBipartition(x);
974
+ n := DegreeOfBipartition(x);
975
+ sizesleft := [1 .. NrBlocks(x)] * 0;
976
+ sizesright := [1 .. NrBlocks(x)] * 0;
977
+
978
+ for i in [1 .. n] do
979
+ sizesleft[blocks[i]] := sizesleft[blocks[i]] + 1;
980
+ od;
981
+ for i in [n + 1 .. 2 * n] do
982
+ sizesright[blocks[i]] := sizesright[blocks[i]] + 1;
983
+ od;
984
+ for i in [1 .. NrBlocks(x)] do
985
+ if sizesright[i] <> sizesleft[i] then
986
+ return false;
987
+ fi;
988
+ od;
989
+
990
+ return true;
991
+ end);
992
+
993
+ InstallMethod(IndexPeriodOfSemigroupElement, "for a bipartition",
994
+ [IsBipartition],
995
+ x -> SEMIGROUPS.IndexPeriodByRank(x, RankOfBipartition));