<p>This is a collection of examples showing how the <strong class="pkg">GAP</strong> system <a href="chapBib.html#biBGAP">[GAP24]</a> can be used to compute information about the probabilistic generation of finite almost simple groups. It includes all examples that were needed for the computational results in <a href="chapBib.html#biBBGK">[BGK08]</a>.</p>
<p>The purpose of this writeup is twofold. On the one hand, the computations are documented this way. On the other hand, the <strong class="pkg">GAP</strong> code shown for the examples can be used as test input for automatic checking of the data and the functions used.</p>
<p>A first version of this document, which was based on <strong class="pkg">GAP</strong> 4.4.10, had been accessible in the web since April 2006 and is available in the arXiv (no. 0710.3267) since October 2007. The differences between that document and the current version are as follows.</p>
<ul>
<li><p>The format of the <strong class="pkg">GAP</strong> output was adjusted to the changed behaviour of <strong class="pkg">GAP</strong> until version 4.10. This affects mainly the way how <strong class="pkg">GAP</strong> records are printed.</p>
</li>
<li><p>Several computations are now easier because more character tables of almost simple groups and maximal subgroups of such groups are available in the <strong class="pkg">GAP</strong> Character Table Library. (The more involved computations from the original version have been kept in the file.)</p>
</li>
<li><p>The computation of all conjugacy classes of a subgroup of <span class="SimpleMath">PΩ^+(12,3)</span> has been replaced by the computation of the conjugacy classes of elements of prime order in this subgroup.</p>
</li>
<li><p>The irreducible element chosen in the simple group <span class="SimpleMath">PΩ^-(10,3)</span> has order <span class="SimpleMath">61</span> not <span class="SimpleMath">122</span>.</p>
<p>The main purpose of this note is to document the <strong class="pkg">GAP</strong> computations that were carried out in order to obtain the computational results in <a href="chapBib.html#biBBGK">[BGK08]</a>. Table I lists the simple groups among these examples. The first column gives the group names, the second and third columns contain a plus sign <span class="SimpleMath">+</span> or a minus sign <span class="SimpleMath">-</span>, depending on whether the quantities <span class="SimpleMath">σ(G,s)</span> and <span class="SimpleMath">P(G,s)</span>, respectively, are less than <span class="SimpleMath">1/3</span>. The fourth column lists the orders of elements <span class="SimpleMath">s</span> which either prove the <span class="SimpleMath">+</span> signs or cover most of the cases for proving these signs. The fifth column lists the sections in this note where the example is treated. The rows of the table are ordered alphabetically w.r.t. the group names.</p>
<p>In order to keep this note self-contained, we first describe the theory needed, in Section <a href="chap11.html#X7B4649CF7B7CFAA1"><span class="RefLink">11.2</span></a>. The translation of the relevant formulae into <strong class="pkg">GAP</strong> functions can be found in Section <a href="chap11.html#X7B56BE5384BAD54E"><span class="RefLink">11.3</span></a>. Then Section <a href="chap11.html#X7A221012861440E2"><span class="RefLink">11.4</span></a> describes the computations that only require (ordinary) character tables in the <strong class="pkg">GAP</strong> Character Table Library <a href="chapBib.html#biBCTblLib">[Bre25]</a>. Computations using also the groups are shown in Section <a href="chap11.html#X8237B8617D6F6027"><span class="RefLink">11.5</span></a>. In each of the last two sections, the examples are ordered alphabetically w.r.t. the names of the simple groups.</p>
<p>Contrary to <a href="chapBib.html#biBBGK">[BGK08]</a>, <strong class="pkg">Atlas</strong> notation is used throughout this note, because the identifiers used for character tables in the <strong class="pkg">GAP</strong> Character Table Library follow mainly the <strong class="pkg">Atlas</strong> <a href="chapBib.html#biBCCN85">[CCN+85]</a>. For example, we write <span class="SimpleMath">L_d(q)</span> for <span class="SimpleMath">PSL(d,q)</span>, <span class="SimpleMath">S_d(q)</span> for <span class="SimpleMath">PSp(d,q)</span>, <span class="SimpleMath">U_d(q)</span> for <span class="SimpleMath">PSU(d,q)</span>, and <span class="SimpleMath">O^+_2d(q)</span>, <span class="SimpleMath">O^-_2d(q)</span>, <span class="SimpleMath">O_2d+1(q)</span> for <span class="SimpleMath">PΩ^+(2d,q)</span>, <span class="SimpleMath">PΩ^-(2d,q)</span>, <span class="SimpleMath">PΩ(2d+1,q)</span>, respectively.</p>
<p>Furthermore, in the case of classical groups, the character tables of the (almost) <em>simple</em> groups are considered not the tables of the matrix groups (which are in fact often not available in the <strong class="pkg">GAP</strong> Character Table Library). Consequently, also element orders and the description of maximal subgroups refer to the (almost) simple groups not to the matrix groups.</p>
<p>This note contains also several examples that are not needed for the proofs in <a href="chapBib.html#biBBGK">[BGK08]</a>. Besides several small simple groups <span class="SimpleMath">G</span> whose character table is contained in the <strong class="pkg">GAP</strong> Character Table Library and for which enough information is available for computing <span class="SimpleMath">σ(G)</span>, in Section <a href="chap11.html#X80DA58F187CDCF5F"><span class="RefLink">11.4-4</span></a>, a few such examples appear in individual sections. In the table of contents, the section headers of the latter kind of examples are marked with an asterisk <span class="SimpleMath">(∗)</span>.</p>
<p>The examples use the <strong class="pkg">GAP</strong> Character Table Library, the <strong class="pkg">GAP</strong> Library of Tables of Marks, and the <strong class="pkg">GAP</strong> interface <a href="chapBib.html#biBAtlasRep">[WPN+22]</a> to the <strong class="pkg">Atlas</strong> of Group Representations <a href="chapBib.html#biBAGRv3">[WWT+]</a>, so we first load these three packages in the required versions. The <strong class="pkg">GAP</strong> output was adjusted to the versions shown below; in older versions, features necessary for the computations may be missing, and it may happen that with newer versions, the behaviour is different.</p>
<p>Some of the computations in Section <a href="chap11.html#X8237B8617D6F6027"><span class="RefLink">11.5</span></a> require about <span class="SimpleMath">800</span> MB of space (on <span class="SimpleMath">32</span> bit machines). Therefore we check whether <strong class="pkg">GAP</strong> was started with sufficient maximal memory; the command line option for this is <code class="code">-o 800m</code>.</p>
<p>Several computations involve calls to the <strong class="pkg">GAP</strong> function <code class="func">Random</code> (<a href="../../../doc/ref/chap30.html#X7FF906E57D6936F8"><span class="RefLink">Reference: Random</span></a>). In order to make the results of individual examples reproducible, independent of the rest of the computations, we reset the relevant random number generators whenever this is appropriate. For that, we store the initial states in the variable <code class="code">staterandom</code>, and provide a function for resetting the random number generators. (The <code class="func">Random</code> (<a href="../../../doc/ref/chap30.html#X7FF906E57D6936F8"><span class="RefLink">Reference: Random</span></a>) calls in the <strong class="pkg">GAP</strong> library use the two random number generators <code class="func">GlobalRandomSource</code> (<a href="../../../doc/ref/chap14.html#X7AC96008820FAF1F"><span class="RefLink">Reference: GlobalRandomSource</span></a>) and <code class="func">GlobalMersenneTwister</code> (<a href="../../../doc/ref/chap14.html#X7AC96008820FAF1F"><span class="RefLink">Reference: GlobalMersenneTwister</span></a>).)</p>
<p>Let <span class="SimpleMath">G</span> be a finite group, <span class="SimpleMath">S</span> the socle of <span class="SimpleMath">G</span>, and denote by <span class="SimpleMath">G^×</span> the set of nonidentity elements in <span class="SimpleMath">G</span>. For <span class="SimpleMath">s, g ∈ G^×</span>, let <span class="SimpleMath">P( g, s ):= |{ h ∈ G; S ⊈ ⟨ s^h, g ⟩ }| / |G|</span>, the proportion of elements in the class <span class="SimpleMath">s^G</span> which fail to generate at least <span class="SimpleMath">S</span> with <span class="SimpleMath">g</span>; we set <span class="SimpleMath">P( G, s ):= max{ P( g, s ); g ∈ G^× }</span>. We are interested in finding a class <span class="SimpleMath">s^G</span> of elements in <span class="SimpleMath">S</span> such that <span class="SimpleMath">P( G, s ) < 1/3</span> holds.</p>
<p>First consider <span class="SimpleMath">g ∈ S</span>, and let <span class="SimpleMath">(S,s)</span> denote the set of those maximal subgroups of <span class="SimpleMath">S</span> that contain <span class="SimpleMath">s</span>. We have</p>
<p class="pcenter">|{ h ∈ S; S ⊈ ⟨ s^h, g ⟩ }| = |{ h ∈ S; ⟨ s, h g h^-1 ⟩ ≠ S }| ≤ ∑_M ∈ (S,s) |{ h ∈ S; h g h^-1 ∈ M }|</p>
<p>Since <span class="SimpleMath">h g h^-1 ∈ M</span> holds if and only if the coset <span class="SimpleMath">M h</span> is fixed by <span class="SimpleMath">g</span> under the permutation action of <spanclass="SimpleMath">S</span> on the right cosets of <span class="SimpleMath">M</span> in <span class="SimpleMath">S</span>, we get that <span class="SimpleMath">|{ h ∈ S; h g h^-1 ∈ M }| = |C_S(g)| ⋅ |g^S ∩ M| = |M| ⋅ 1_M^S(g)</span>, where <span class="SimpleMath">1_M^S</span> is the permutation character of this action, of degree <span class="SimpleMath">|S|/|M|</span>. Thus</p>
<p class="pcenter">|{ h ∈ S; ⟨ s, h g h^-1 ⟩ ≠ S }| / |S| ≤ ∑_M ∈ (S,s) 1_M^S(g) / 1_M^S(1) .</p>
<p>We abbreviate the right hand side of this inequality by <span class="SimpleMath">σ( g, s )</span>, set <span class="SimpleMath">σ( S, s ):= max{ σ( g, s ); g ∈ S^× }</span>, and choose a transversal <span class="SimpleMath">T</span> of <span class="SimpleMath">S</span> in <span class="SimpleMath">G</span>. Then <span class="SimpleMath">P( g, s ) ≤ |T|^-1 ⋅ ∑_t ∈ T σ( g^t, s )</span> and thus <span class="SimpleMath">P( G, s ) ≤ σ( S, s )</span> holds.</p>
<p>If <span class="SimpleMath">S = G</span> and if <span class="SimpleMath">(G,s)</span> consists of a single maximal subgroup <span class="SimpleMath">M</span> of <span class="SimpleMath">G</span> then equality holds, i.e., <span class="SimpleMath">P( g, s ) = σ( g, s ) = 1_M^S(g) / 1_M^S(1)</span>.</p>
<p>The quantity <span class="SimpleMath">1_M^S(g) / 1_M^S(1) = |g^S ∩ M| / |g^S|</span> is the proportion of fixed points of <span class="SimpleMath">g</span> in the permutation action of <span class="SimpleMath">S</span> on the right cosets of its subgroup <span class="SimpleMath">M</span>. This is called the <em>fixed point ratio</em> of <span class="SimpleMath">g</span> w. r. t. <span class="SimpleMath">S/M</span>, and is denoted as <span class="SimpleMath">μ(g,S/M)</span>.</p>
<p>For a subgroup <span class="SimpleMath">M</span> of <span class="SimpleMath">S</span>, the number <span class="SimpleMath">n</span> of <span class="SimpleMath">S</span>-conjugates of <span class="SimpleMath">M</span> containing <span class="SimpleMath">s</span> is equal to <span class="SimpleMath">|M^S| ⋅ |s^S ∩ M| / |s^S|</span>. To see this, consider the set <span class="SimpleMath">{ (s^h, M^k); h, k ∈ S, s^h ∈ M^k }</span>, the cardinality of which can be counted either as <span class="SimpleMath">|M^S| ⋅ |s^S ∩ M|</span> or as <span class="SimpleMath">|s^S| ⋅ n</span>. So we get <span class="SimpleMath">n = |M| ⋅ 1_M^S(s) / |N_S(M)|</span>.</p>
<p>If <span class="SimpleMath">S</span> is a finite <em>nonabelian simple</em> group then each maximal subgroup in <span class="SimpleMath">S</span> is self-normalizing, and we have <span class="SimpleMath">n = 1_M^S(s)</span> if <span class="SimpleMath">M</span> is maximal. So we can replace the summation over <span class="SimpleMath">(S,s)</span> by one over a set <span class="SimpleMath">/~(S,s)</span> of representatives of conjugacy classes of maximal subgroups of <span class="SimpleMath">S</span>, and get that</p>
<p>Furthermore, we have <span class="SimpleMath">|(S,s)| = ∑_M ∈ /~(S,s) 1_M^S(s)</span>.</p>
<p>In the following, we will often deal with the quantities <span class="SimpleMath">σ(S):= min{ σ( S, s ); s ∈ S^× }</span> and <span class="SimpleMath">/~(S):= ⌈ 1 / σ(S) - 1 ⌉</span>. These values can be computed easily from the primitive permutation characters of <span class="SimpleMath">S</span>.</p>
<p>Analogously, we set <span class="SimpleMath">P(S):= min { P( S, s ); s ∈ S^× }</span> and <span class="SimpleMath">P(S):= ⌈ 1 / P(S) - 1 ⌉</span>. Clearly we have <span class="SimpleMath">P(S) ≤ σ(S)</span> and <span class="SimpleMath">P(S) ≥ /~(S)</span>.</p>
<p>One interpretation of <span class="SimpleMath">P(S)</span> is that if this value is at least <span class="SimpleMath">k</span> then it follows that for any <span class="SimpleMath">g_1, g_2, ..., g_k ∈ S^×</span>, there is some <span class="SimpleMath">s ∈ S</span> such that <span class="SimpleMath">S = ⟨ g_i, s ⟩</span>, for <span class="SimpleMath">1 ≤ i ≤ k</span>. In this case, <span class="SimpleMath">S</span> is said to have <em>spread</em> at least <span class="SimpleMath">k</span>. (Note that the lower bound <span class="SimpleMath">/~(S)</span> for <span class="SimpleMath">P(S)</span> can be computed from the list of primitive permutation characters of <span class="SimpleMath">S</span>.)</p>
<p>Moreover, <span class="SimpleMath">P(S) ≥ k</span> implies that the element <span class="SimpleMath">s</span> can be chosen uniformly from a fixed conjugacy class of <span class="SimpleMath">S</span>. This is called <em>uniform spread</em> at least <span class="SimpleMath">k</span> in <a href="chapBib.html#biBBGK">[BGK08]</a>.</p>
<p>It is proved in <a href="chapBib.html#biBGK">[GK00]</a> that all finite simple groups have uniform spread at least <span class="SimpleMath">1</span>, that is, for any element <span class="SimpleMath">x ∈ S^×</span>, there is an element <span class="SimpleMath">y</span> in a prescribed class of <span class="SimpleMath">S</span> such that <span class="SimpleMath">G = ⟨ x, y ⟩</span> holds. In <a href="chapBib.html#biBBGK">[BGK08, Corollary 1.3]</a>, it is shown that all finite simple groups have uniform spread at least <span class="SimpleMath">2</span>, and the finite simple groups with (uniform) spread exactly <span class="SimpleMath">2</span> are listed.</p>
<p>Concerning the spread, it should be mentioned that the methods used here and in <a href="chapBib.html#biBBGK">[BGK08]</a> are nonconstructive in the sense that they cannot be used for finding an element <span class="SimpleMath">s</span> that generates <span class="SimpleMath">G</span> together with each of the <span class="SimpleMath">k</span> prescribed elements <span class="SimpleMath">g_1, g_2, ..., g_k</span>.</p>
<p>Now consider <span class="SimpleMath">g ∈ G ∖ S</span>. Since <span class="SimpleMath">P( g^k, s ) ≥ P( g, s )</span> for any positive integer <span class="SimpleMath">k</span>, we can assume that <span class="SimpleMath">g</span> has prime order <span class="SimpleMath">p</span>, say. We set <span class="SimpleMath">H = ⟨ S, g ⟩ ≤ G</span>, with <span class="SimpleMath">[H:S] = p</span>, choose a transversal <span class="SimpleMath">T</span> of <span class="SimpleMath">H</span> in <span class="SimpleMath">G</span>, let <span class="SimpleMath">^'(H,s):= 𝕄(H,s) ∖ { S }, and let 𝕄/~^'(H,s)</span> denote a set of representatives of <span class="SimpleMath">H</span>-conjugacy classes of these groups. As above,</p>
<div class="pcenter"><table class="GAPDocTablenoborder">
<tr>
<td class="tdright"><span class="SimpleMath">|{ h ∈ H; S ⊈ ⟨ s^h, g ⟩ }| / |H|</span></td>
<td class="tdcenter"><span class="SimpleMath">=</span></td>
<td class="tdleft"><span class="SimpleMath">|{ h ∈ H; ⟨ s^h, g ⟩ ≠ H }| / |H|</span></td>
</tr>
<tr>
<td class="tdright"> </td>
<td class="tdcenter"><span class="SimpleMath">≤</span></td>
<td class="tdleft"><span class="SimpleMath">∑_M ∈ ^'(H,s) |{ h ∈ H; h g h^-1 ∈ M }| / |H|
<p>(Note that no summand for <span class="SimpleMath">M = S</span> occurs, so each group in <span class="SimpleMath">/~^'(H,s) is self-normalizing.) We abbreviate the right hand side by σ(H,g,s), and set σ^'( H, s ) = max{ σ(H,g,s); g ∈ H ∖ S, |g| = [H:S] }</span>. Then we get <span class="SimpleMath">P( g, s ) ≤ |T|^-1 ⋅ ∑_t ∈ T σ(H^t,g^t,s)</span> and thus</p>
<p class="pcenter">P( G, s ) ≤ max{ P( S, s ), max{ σ^'( H, s ); S ≤ H ≤ G, [H:S] prime } } .
<p>For convenience, we set <span class="SimpleMath">P^'(G,s) = max{ P(g,s); g ∈ G ∖ S }.
<p>The following criteria will be used when we have to show the existence or nonexistence of <span class="SimpleMath">x_1, x_2, ..., x_k</span>, and <span class="SimpleMath">s ∈ G</span> with the property <span class="SimpleMath">⟨ x_i, s ⟩ = G</span> for <span class="SimpleMath">1 ≤ i ≤ k</span>. Note that manipulating lists of integers (representing fixed or moved points) is much more efficient than testing whether certain permutations generate a given group.</p>
<p>Lemma:</p>
<p>Let <span class="SimpleMath">G</span> be a finite group, <span class="SimpleMath">s ∈ G^×</span>, and <span class="SimpleMath">X = ⋃_M ∈ (G,s) G/M</span>. For <span class="SimpleMath">x_1, x_2, ..., x_k ∈ G</span>, the conjugate <span class="SimpleMath">s^' of s satisfies ⟨ x_i, s^' ⟩ = G</span> for <span class="SimpleMath">1 ≤ i ≤ k</span> if and only if <span class="SimpleMath">Fix_X(s^') ∩ ⋃_i=1^k Fix_X(x_i) = ∅ holds.
<p><em>Proof.</em> If <span class="SimpleMath">s^g ∈ U ≤ G</span> for some <span class="SimpleMath">g ∈ G</span> then <span class="SimpleMath">Fix_X(U) = ∅</span> if and only if <span class="SimpleMath">U = G</span> holds; note that <span class="SimpleMath">Fix_X(G) = ∅</span>, and <span class="SimpleMath">Fix_X(U) = ∅</span> implies that <span class="SimpleMath">U ⊈ h^-1 M h</span> holds for all <span class="SimpleMath">h ∈ G</span> and <span class="SimpleMath">M ∈ (G,s)</span>, thus <span class="SimpleMath">U = G</span>. Applied to <span class="SimpleMath">U = ⟨ x_i, s^' ⟩, we get ⟨ x_i, s^' ⟩ = G</span> if and only if <span class="SimpleMath">Fix_X(s^') ∩ Fix_X(x_i) = Fix_X(U) = ∅.
<p>Corollary 1:</p>
<p>If <span class="SimpleMath">(G,s) = { M }</span> in the situation of the above Lemma then there is a conjugate <span class="SimpleMath">s^' of s that satisfies ⟨ x_i, s^' ⟩ = G</span> for <span class="SimpleMath">1 ≤ i ≤ k</span> if and only if <span class="SimpleMath">⋃_i=1^k Fix_X(x_i) ≠ X</span>.</p>
<p>Corollary 2:</p>
<p>Let <span class="SimpleMath">G</span> be a finite simple group and let <span class="SimpleMath">X</span> be a <span class="SimpleMath">G</span>-set such that each <span class="SimpleMath">g ∈ G</span> fixes at least one point in <span class="SimpleMath">X</span> but that <span class="SimpleMath">Fix_X(G) = ∅</span> holds. If <span class="SimpleMath">x_1, x_2, ... x_k</span> are elements in <span class="SimpleMath">G</span> such that <span class="SimpleMath">⋃_i=1^k Fix_X(x_i) = X</span> holds then for each <span class="SimpleMath">s ∈ G</span> there is at least one <span class="SimpleMath">i</span> with <span class="SimpleMath">⟨ x_i, s ⟩ ≠ G</span>.</p>
<h4>11.3 <span class="Heading"><strong class="pkg">GAP</strong> Functions for the Computations</span></h4>
<p>After the introduction of general utilities in Section <a href="chap11.html#X806328747D1D4ECC"><span class="RefLink">11.3-1</span></a>, we distinguish two different tasks. Section <a href="chap11.html#X7A221012861440E2"><span class="RefLink">11.3-2</span></a> introduces functions that will be used in the following to compute <span class="SimpleMath">σ(g,s)</span> with character-theoretic methods. Functions for computing <span class="SimpleMath">P(g,s)</span> or an upper bound for this value will be introduced in Section <a href="chap11.html#X83DACCF07EF62FAE"><span class="RefLink">11.3-3</span></a>.</p>
<p>The <strong class="pkg">GAP</strong> functions shown in this section are collected in the file <code class="file">tst/probgen.g</code> that is distributed with the <strong class="pkg">GAP</strong> Character Table Library, see <span class="URL"><a href="http://www.math.rwth-aachen.de/~Thomas.Breuer/ctbllib">http://www.math.rwth-aachen.de/~Thomas.Breuer/ctbllib</a></span>.</p>
<p>The functions have been designed for the examples in the later sections, they could be generalized and optimized for other examples. It is not our aim to provide a package for this functionality.</p>
<p>Let <code class="code">list</code> be a dense list and <code class="code">prop</code> be a unary function that returns <code class="keyw">true</code> or <code class="keyw">false</code> when applied to the entries of <code class="code">list</code>. <code class="code">PositionsProperty</code> returns the set of positions in <code class="code">list</code> for which <code class="keyw">true</code> is returned.</p>
<p>The following two functions implement loops over ordered triples (and quadruples, respectively) in a Cartesian product. A prescribed function <code class="code">prop</code> is subsequently applied to the triples (quadruples), and if the result of this call is <code class="keyw">true</code> then this triple (quadruple) is returned immediately; if none of the calls to <code class="code">prop</code> yields <code class="keyw">true</code> then <code class="keyw">fail</code> is returned.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">BindGlobal( "TripleWithProperty", function( threelists, prop )</span>
<span class="GAPprompt">></span> <span class="GAPinput"> local i, j, k, test;</span>
<span class="GAPprompt">></span> <span class="GAPinput"></span>
<span class="GAPprompt">></span> <span class="GAPinput"> for i in threelists[1] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for j in threelists[2] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for k in threelists[3] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> test:= [ i, j, k ];</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if prop( test ) then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> return test;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"></span>
<span class="GAPprompt">></span> <span class="GAPinput"> return fail;</span>
<span class="GAPprompt">></span> <span class="GAPinput">end );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BindGlobal( "QuadrupleWithProperty", function( fourlists, prop )</span>
<span class="GAPprompt">></span> <span class="GAPinput"> local i, j, k, l, test;</span>
<span class="GAPprompt">></span> <span class="GAPinput"></span>
<span class="GAPprompt">></span> <span class="GAPinput"> for i in fourlists[1] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for j in fourlists[2] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for k in fourlists[3] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for l in fourlists[4] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> test:= [ i, j, k, l ];</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if prop( test ) then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> return test;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"></span>
<span class="GAPprompt">></span> <span class="GAPinput"> return fail;</span>
<span class="GAPprompt">></span> <span class="GAPinput">end );</span>
</pre></div>
<p>Of course one could do better by considering <em>un</em>ordered <span class="SimpleMath">n</span>-tuples when several of the argument lists are equal, and in practice, backtrack searches would often allow one to prune parts of the search tree in early stages. However, the above loops are not time critical in the examples presented here, so the possible improvements are not worth the effort for our purposes.</p>
<p>The function <code class="code">PrintFormattedArray</code> prints the matrix <code class="code">array</code> in a columnwise formatted way. (The only diference to the <strong class="pkg">GAP</strong> library function <code class="func">PrintArray</code> (<a href="../../../doc/ref/chap24.html#X7DEBC9967DFDFC18"><span class="RefLink">Reference: PrintArray</span></a>) is that <code class="code">PrintFormattedArray</code> chooses each column width according to the entries only in this column not w.r.t. the whole matrix.)</p>
<p>Finally, <code class="code">CleanWorkspace</code> is a utility for reducing the space needed. This is achieved by unbinding those user variables that are not write protected and are not mentioned in the list <code class="code">NeededVariables</code> of variable names that are bound now, and by flushing the caches of tables of marks and character tables.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">BindGlobal( "NeededVariables", NamesUserGVars() );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BindGlobal( "CleanWorkspace", function()</span>
<span class="GAPprompt">></span> <span class="GAPinput"> local name, record;</span>
<span class="GAPprompt">></span> <span class="GAPinput"></span>
<span class="GAPprompt">></span> <span class="GAPinput"> for name in Difference( NamesUserGVars(), NeededVariables ) do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if not IsReadOnlyGlobal( name ) then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> UnbindGlobal( name );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for record in [ LIBTOMKNOWN, LIBTABLE ] do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> for name in RecNames( record.LOADSTATUS ) do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> Unbind( record.LOADSTATUS.( name ) );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> Unbind( record.( name ) );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput">end );</span>
</pre></div>
--> --------------------
--> maximum size reached
--> --------------------
¤ Dauer der Verarbeitung: 0.35 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.