<h3>5 <span class="Heading">
Matrices over semirings
</span></h3>
<p>In this chapter we describe the functionality in <strong class="pkg">Semigroups</strong> for creating matrices over semirings. <strong class="button">Only square matrices are currently supported.</strong> We use the term <strong class="button">matrix</strong> to mean <strong class="button">square matrix</strong> everywhere in this manual.</p>
<p>For reference, matrices over the following semirings are currently supported:</p>
</dd>
<dt><strong class="Mark">the max-plus semiring</strong></dt>
<dd><p>the set of integers and negative infinity <span class="SimpleMath">\(\mathbb{Z}\cup \{-\infty\}\)</span> with operations max and plus.</p>
</dd>
<dt><strong class="Mark">the min-plus semiring</strong></dt>
<dd><p>the set of integers and infinity <span class="SimpleMath">\(\mathbb{Z}\cup \{\infty\}\)</span> with operations min and plus;</p>
</dd>
<dt><strong class="Mark">tropical max-plus semirings</strong></dt>
<dd><p>the set <span class="SimpleMath">\(\{-\infty, 0, 1, \ldots, t\}\)</span> for some threshold <span class="SimpleMath">\(t\)</span> with operations max and plus;</p>
</dd>
<dt><strong class="Mark">tropical min-plus semirings</strong></dt>
<dd><p>the set <span class="SimpleMath">\(\{0, 1, \ldots, t, \infty\}\)</span> for some threshold <span class="SimpleMath">\(t\)</span> with operations min and plus;</p>
</dd>
<dt><strong class="Mark">the semiring <span class="SimpleMath">\(\mathbb{N}_{t,p}\)</span></strong></dt>
<dd><p>the semiring <span class="SimpleMath">\(\mathbb{N}_{t,p} = \{0, 1, \ldots, t, t + 1, \ldots, t + p - 1\}\)</span> for some threshold <span class="SimpleMath">\(t\)</span> and period <span class="SimpleMath">\(p\)</span> under addition and multiplication modulo the congruence <span class="SimpleMath">\(t = t + p\)</span>;</p>
</dd>
<dt><strong class="Mark">the integers</strong></dt>
<dd><p>the usual ring of integers;</p>
</dd>
<dt><strong class="Mark">finite fields</strong></dt>
<dd><p>the finite fields <code class="code">GF(q^d)</code> for prime <code class="code">q</code> and some positive integer <code class="code">d</code>.</p>
</dd>
</dl>
<p>With the exception of matrices of finite fields, semigroups of matrices in <strong class="pkg">Semigroups</strong> are of the second type described in Section <a href="chap6_mj.html#X7A19D22B7A05CC2F"><span class="RefLink">6.1</span></a>. In other words, a version of the Froidure-Pin Algorithm <a href="chapBib_mj.html#biBFroidure1997aa">[FP97]</a> is used to compute semigroups of these types, i.e it is possible that all of the elements of such a semigroup are enumerated and stored in the memory of your computer.</p>
<h4>5.1 <span class="Heading">Creating matrices over semirings</span></h4>
<p>In this section we describe the two main operations for creating matrices over semirings in <strong class="pkg">Semigroups</strong>, and the categories, attributes, and operations which apply to every matrix over one of the semirings given at the start of this chapter.</p>
<p>There are several special methods for boolean matrices, which can be found in Section <a href="chap5_mj.html#X844A32A184E5EB75"><span class="RefLink">5.3</span></a>. There are also several special methods for finite fields, which can be found in section <a href="chap5_mj.html#X873822B6830CE367"><span class="RefLink">5.4</span></a>.</p>
<p>Every matrix over a semiring in <strong class="pkg">Semigroups</strong> is a member of the category <code class="code">IsMatrixOverSemiring</code>, which is a subcategory of <code class="func">IsMultiplicativeElementWithOne</code> (<a href="../../../doc/ref/chap31_mj.html#X82BC294F7D388AE8"><span class="RefLink">Reference: IsMultiplicativeElementWithOne</span></a>), <code class="func">IsAssociativeElement</code> (<a href="../../../doc/ref/chap31_mj.html#X7979AFAA80FF795A"><span class="RefLink">Reference: IsAssociativeElement</span></a>), and <code class="code">IsPositionalObjectRep</code>; see <a href="../../../doc/ref/chap13_mj.html#X8698205F8648EB33"><span class="RefLink">Reference: Representation</span></a>.</p>
<p>Every matrix over a semiring in <strong class="pkg">Semigroups</strong> is a square matrix.</p>
<p>Basic operations for matrices over semirings are: <code class="func">DimensionOfMatrixOverSemiring</code> (<a href="chap5_mj.html#X7C1CDA817CE076FD"><span class="RefLink">5.1-3</span></a>), <code class="func">TransposedMat</code> (<a href="../../../doc/ref/chap24_mj.html#X7C52A38C79C36C35"><span class="RefLink">Reference: TransposedMat</span></a>), and <code class="func">One</code> (<a href="../../../doc/ref/chap31_mj.html#X8046262384895B2A"><span class="RefLink">Reference: One</span></a>).</p>
<p>Every collection of matrices over the same semiring belongs to the category <code class="code">IsMatrixOverSemiringCollection</code>. For example, semigroups of matrices over a semiring belong to <code class="code">IsMatrixOverSemiringCollection</code>.</p>
<p>Every collection of collections of matrices over the same semiring belongs to the category <code class="code">IsMatrixOverSemiringCollColl</code>. For example, a list of semigroups of matrices over semirings belongs to <code class="code">IsMatrixOverSemiringCollColl</code>.</p>
<p>If <var class="Arg">mat</var> is a matrix over a semiring (i.e. belongs to the category <code class="func">IsMatrixOverSemiring</code> (<a href="chap5_mj.html#X8711618C7A8A1B60"><span class="RefLink">5.1-1</span></a>)), then <var class="Arg">mat</var> is a square <code class="code">n</code> by <code class="code">n</code> matrix. <code class="code">DimensionOfMatrixOverSemiring</code> returns the dimension <code class="code">n</code> of <var class="Arg">mat</var>.</p>
<p>If <var class="Arg">coll</var> is a collection of matrices over a semiring (i.e. belongs to the category <code class="func">IsMatrixOverSemiringCollection</code> (<a href="chap5_mj.html#X86F696B883677D6B"><span class="RefLink">5.1-2</span></a>)), then the elements of <var class="Arg">coll</var> are square <code class="code">n</code> by <code class="code">n</code> matrices. <code class="code">DimensionOfMatrixOverSemiringCollection</code> returns the dimension <code class="code">n</code> of these matrices.</p>
<p>This operation can be used to construct a matrix over a semiring in <strong class="pkg">Semigroups</strong>.</p>
<p>In its first form, the first argument <var class="Arg">filt</var> specifies the filter to be used to create the matrix, the second argument <var class="Arg">mat</var> is a <strong class="pkg">GAP</strong> matrix (i.e. a list of lists) compatible with <var class="Arg">filt</var>, the third and fourth arguments <var class="Arg">threshold</var> and <var class="Arg">period</var> (if required) must be positive integers.</p>
<dl>
<dt><strong class="Mark"><var class="Arg">filt</var></strong></dt>
<dd><p>This must be one of the filters given in Section <a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>.</p>
</dd>
<dt><strong class="Mark"><var class="Arg">mat</var></strong></dt>
<dd><p>This must be a list of <code class="code">n</code> lists each of length <code class="code">n</code> (i.e. a square matrix), consisting of elements belonging to the underlying semiring described by <var class="Arg">filt</var>, and <var class="Arg">threshold</var> and <var class="Arg">period</var> if present. An error is given if <var class="Arg">mat</var> is not compatible with the other arguments.</p>
<p>For example, if <var class="Arg">filt</var> is <code class="code">IsMaxPlusMatrix</code>, then the entries of <var class="Arg">mat</var> must belong to the max-plus semiring, i.e. they must be integers or -<span class="SimpleMath">\(\infty\)</span>.</p>
<p>The supported semirings are fully described at the start of this chapter.</p>
</dd>
<dt><strong class="Mark"><var class="Arg">threshold</var></strong></dt>
<dd><p>If <var class="Arg">filt</var> is any of <code class="func">IsTropicalMaxPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), <code class="func">IsTropicalMinPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), or <code class="func">IsNTPMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), then this argument specifies the threshold of the underlying semiring of the matrix being created.</p>
</dd>
<dt><strong class="Mark"><var class="Arg">period</var></strong></dt>
<dd><p>If <var class="Arg">filt</var> is <code class="func">IsNTPMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), then this argument specifies the period of the underlying semiring of the matrix being created.</p>
</dd>
</dl>
<p>In its second form, the arguments should be a semiring <var class="Arg">semiring</var> and matrix <var class="Arg">mat</var> with entries in <var class="Arg">semiring</var>. Currently, the only supported semirings are finite fields of prime order, and the integers <code class="func">Integers</code> (<a href="../../../doc/ref/chap14_mj.html#X853DF11B80068ED5"><span class="RefLink">Reference: Integers</span></a>).</p>
<p>The function <code class="func">BooleanMat</code> (<a href="chap5_mj.html#X84A16D4D7D015885"><span class="RefLink">5.3-1</span></a>) is provided for specifically creating boolean matrices.</p>
<p>This operation can be used to change the representation of certain matrices over semirings. If <var class="Arg">mat</var> is a matrix over a semiring (in the category <code class="func">IsMatrixOverSemiring</code> (<a href="chap5_mj.html#X8711618C7A8A1B60"><span class="RefLink">5.1-1</span></a>)), then <code class="code">AsMatrix</code> returns a new matrix corresponding to <var class="Arg">mat</var> of the type specified by the filter <var class="Arg">filt</var>, and if applicable the arguments <var class="Arg">threshold</var> and <var class="Arg">period</var>. The dimension of the matrix <var class="Arg">mat</var> is not changed by this operation.</p>
<p>The version of the operation with arguments <var class="Arg">filt</var> and <var class="Arg">mat</var> can be applied to:</p>
<ul>
<li><p><code class="func">IsMinPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>) and a tropical min-plus matrix (i.e. convert a tropical min-plus matrix to a (non-tropical) min-plus matrix);</p>
</li>
<li><p><code class="func">IsMaxPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>) and a tropical max-plus matrix;</p>
</li>
</ul>
<p>The version of the operation with arguments <var class="Arg">filt</var>, <var class="Arg">mat</var>, and <var class="Arg">threshold</var> can be applied to:</p>
<ul>
<li><p><code class="func">IsTropicalMinPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), a tropical min-plus or min-plus matrix, and a value for the threshold of the resulting matrix.</p>
</li>
<li><p><code class="func">IsTropicalMaxPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>) and a tropical max-plus, or max-plus matrix, and a value for the threshold of the resulting matrix.</p>
</li>
</ul>
<p>The version of the operation with arguments <var class="Arg">filt</var>, <var class="Arg">mat</var>, <var class="Arg">threshold</var>, and <var class="Arg">period</var> can be applied to <code class="func">IsNTPMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>) and an ntp matrix, or integer matrix.</p>
<p>When converting matrices with negative entries to an ntp, tropical max-plus, or tropical min-plus matrix, the entry is replaced with its absolute value.</p>
<p>When converting non-tropical matrices to tropical matrices entries higher than the specified threshold are reduced to the threshold.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RandomMatrix</code>( <var class="Arg">filt</var>, <var class="Arg">dim</var>[, <var class="Arg">threshold</var>[, <var class="Arg">period</var>]] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RandomMatrix</code>( <var class="Arg">semiring</var>, <var class="Arg">dim</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A matrix over semiring.</p>
<p>This operation can be used to construct a random matrix over a semiring in <strong class="pkg">Semigroups</strong>. The usage of <code class="code">RandomMatrix</code> is similar to that of <codeclass="func">Matrix</code> (<a href="chap5_mj.html#X7DCA234C86ED8BD3"><span class="RefLink">5.1-5</span></a>).</p>
<p>In its first form, the first argument <var class="Arg">filt</var> specifies the filter to be used to create the matrix, the second argument <var class="Arg">dim</var> is dimension of the matrix, the third and fourth arguments <var class="Arg">threshold</var> and <var class="Arg">period</var> (if required) must be positive integers.</p>
<dl>
<dt><strong class="Mark"><var class="Arg">filt</var></strong></dt>
<dd><p>This must be one of the filters given in Section <a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>.</p>
</dd>
<dt><strong class="Mark"><var class="Arg">dim</var></strong></dt>
<dd><p>This must be a positive integer.</p>
</dd>
<dt><strong class="Mark"><var class="Arg">threshold</var></strong></dt>
<dd><p>If <var class="Arg">filt</var> is any of <code class="func">IsTropicalMaxPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), <code class="func">IsTropicalMinPlusMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), or <code class="func">IsNTPMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), then this argument specifies the threshold of the underlying semiring of the matrix being created.</p>
</dd>
<dt><strong class="Mark"><var class="Arg">period</var></strong></dt>
<dd><p>If <var class="Arg">filt</var> is <code class="func">IsNTPMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>), then this argument specifies the period of the underlying semiring of the matrix being created.</p>
</dd>
</dl>
<p>In its second form, the arguments should be a semiring <var class="Arg">semiring</var> and dimension <var class="Arg">dim</var>. Currently, the only supported semirings are finite fields of prime order and the integers <code class="func">Integers</code> (<a href="../../../doc/ref/chap14_mj.html#X853DF11B80068ED5"><span class="RefLink">Reference: Integers</span></a>).</p>
<p>Every matrix over a semiring in <strong class="pkg">Semigroups</strong> is a member of one of these categories, which are subcategory of <code class="func">IsMatrixOverSemiring</code> (<a href="chap5_mj.html#X8711618C7A8A1B60"><span class="RefLink">5.1-1</span></a>).</p>
<p><code class="code">IsTropicalMatrix</code> is a supercategory of <code class="code">IsTropicalMaxPlusMatrix</code> and <code class="code">IsTropicalMinPlusMatrix</code>.</p>
<p>Basic operations for matrices over semirings include: multiplication via \*, <code class="func">DimensionOfMatrixOverSemiring</code> (<a href="chap5_mj.html#X7C1CDA817CE076FD"><span class="RefLink">5.1-3</span></a>), <code class="func">One</code> (<a href="../../../doc/ref/chap31_mj.html#X8046262384895B2A"><span class="RefLink">Reference: One</span></a>), the underlying list of lists used to create the matrix can be accessed using <code class="func">AsList</code> (<a href="chap5_mj.html#X8289FCCC8274C89D"><span class="RefLink">5.1-10</span></a>), the rows of <code class="code">mat</code> can be accessed using <code class="code">mat[i]</code> where <code class="code">i</code> is between <code class="code">1</code> and the dimension of the matrix, it also possible to loop over the rows of a matrix; for tropical matrices <code class="func">ThresholdTropicalMatrix</code> (<a href="chap5_mj.html#X7D21408E845E4648"><span class="RefLink">5.1-11</span></a>); for ntp matrices <code class="func">ThresholdNTPMatrix</code> (<a href="chap5_mj.html#X7874559881FE8779"><span class="RefLink">5.1-12</span></a>) and <code class="func">PeriodNTPMatrix</code> (<a href="chap5_mj.html#X7874559881FE8779"><span class="RefLink">5.1-12</span></a>).</p>
<p>For matrices over finite fields see Section <a href="chap5_mj.html#X873822B6830CE367"><span class="RefLink">5.4</span></a>; for Boolean matrices more details can be found in Section <a href="chap5_mj.html#X844A32A184E5EB75"><span class="RefLink">5.3</span></a>.</p>
<p>Every collection of matrices over the same semiring in <strong class="pkg">Semigroups</strong> belongs to one of the categories above. For example, semigroups of boolean matrices belong to <code class="code">IsBooleanMatCollection</code>.</p>
<p>Similarly, every collection of collections of matrices over the same semiring in <strong class="pkg">Semigroups</strong> belongs to one of the categories above.</p>
<p>If <var class="Arg">mat</var> is a matrix over a semiring (in the category <code class="func">IsMatrixOverSemiring</code> (<a href="chap5_mj.html#X8711618C7A8A1B60"><span class="RefLink">5.1-1</span></a>)), then <code class="code">AsList</code> returns the underlying list of lists of semiring elements corresponding to <var class="Arg">mat</var>. In this case, the returned list and all of its entries are immutable.</p>
<p>The operation <code class="code">AsMutableList</code> returns a mutable copy of the underlying list of lists of the matrix over semiring <var class="Arg">mat</var>.</p>
<p>If <var class="Arg">mat</var> is a tropical matrix (i.e. belongs to the category <code class="func">IsTropicalMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>)), then <code class="code">ThresholdTropicalMatrix</code> returns the threshold (i.e. the largest integer) of the underlying semiring.</p>
<p>An <strong class="button">ntp matrix</strong> is a matrix with entries in a semiring <span class="SimpleMath">\(\mathbb{N}_{t,p} = \{0, 1, \ldots, t, t + 1, \ldots, t + p - 1\}\)</span> for some threshold <span class="SimpleMath">\(t\)</span> and period <span class="SimpleMath">\(p\)</span> under addition and multiplication modulo the congruence <span class="SimpleMath">\(t = t + p\)</span>.</p>
<p>If <var class="Arg">mat</var> is a ntp matrix (i.e. belongs to the category <code class="func">IsNTPMatrix</code> (<a href="chap5_mj.html#X782480C686F1A663"><span class="RefLink">5.1-8</span></a>)), then <code class="code">ThresholdNTPMatrix</code> and <code class="code">PeriodNTPMatrix</code> return the threshold and period of the underlying semiring, respectively.</p>
<h4>5.2 <span class="Heading">Operators for matrices over semirings</span></h4>
<dl>
<dt><strong class="Mark"><code class="code"><var class="Arg">mat1</var> * <var class="Arg">mat2</var></code></strong></dt>
<dd><p>returns the product of the matrices <var class="Arg">mat1</var> and <var class="Arg">mat2</var> of equal dimension over the same semiring using the usual matrix multiplication with the operations <code class="code">+</code> and <code class="code">*</code> from the underlying semiring.</p>
</dd>
<dt><strong class="Mark"><code class="code"><var class="Arg">mat1</var> < <var class="Arg">mat2</var></code></strong></dt>
<dd><p>returns <code class="keyw">true</code> if when considered as a list of rows, the matrix <var class="Arg">mat1</var> is short-lex less than the matrix <var class="Arg">mat2</var>, and <code class="keyw">false</code> if this is not the case. This means that a matrix of lower dimension is less than a matrix of higher dimension.</p>
</dd>
<dt><strong class="Mark"><code class="code"><var class="Arg">mat1</var> = <var class="Arg">mat2</var></code></strong></dt>
<dd><p>returns <code class="keyw">true</code> if the matrix <var class="Arg">mat1</var> equals the matrix <var class="Arg">mat2</var> (i.e. the entries are equal and the underlying semirings are equal) and returns <code class="keyw">false</code> if it does not.</p>
<p>In this section we describe the operations, properties, and attributes in <strong class="pkg">Semigroups</strong> specifically for Boolean matrices. These include:</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ BooleanMat</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A boolean matrix.</p>
<p><code class="code">BooleanMat</code> returns the boolean matrix <code class="code">mat</code> defined by its argument. The argument can be any of the following:</p>
<dl>
<dt><strong class="Mark">a matrix with entries <code class="code">0</code> and/or <code class="code">1</code></strong></dt>
<dd><p>the argument <var class="Arg">arg</var> is list of <code class="code">n</code> lists of length <code class="code">n</code> consisting of the values <code class="code">0</code> and <code class="code">1</code>;</p>
</dd>
<dt><strong class="Mark">a matrix with entries <code class="keyw">true</code> and/or <code class="keyw">false</code></strong></dt>
<dd><p>the argument <var class="Arg">arg</var> is list of <code class="code">n</code> lists of length <code class="code">n</code> consisting of the values <code class="keyw">true</code> and <code class="keyw">false</code>;</p>
</dd>
<dt><strong class="Mark">successors</strong></dt>
<dd><p>the argument <var class="Arg">arg</var> is list of <code class="code">n</code> sublists of consisting of positive integers not greater than <code class="code">n</code>. In this case, the entry <code class="code">j</code> in the sublist in position <code class="code">i</code> of <var class="Arg">arg</var> indicates that the entry in position <code class="code">(i, j)</code> of the created boolean matrix is <code class="keyw">true</code>.</p>
</dd>
</dl>
<p><code class="code">BooleanMat</code> returns an error if the argument is not one of the above types.</p>
<p><code class="code">AsBooleanMat</code> returns the pbr, bipartition, permutation, transformation, or partial permutation <var class="Arg">x</var>, as a boolean matrix of dimension <var class="Arg">n</var>.</p>
<p>There are several possible arguments for <code class="code">AsBooleanMat</code>:</p>
<dl>
<dt><strong class="Mark">permutations</strong></dt>
<dd><p>If <var class="Arg">x</var> is a permutation and <var class="Arg">n</var> is a positive integer, then <code class="code">AsBooleanMat(<var class="Arg">x</var>, <var class="Arg">n</var>)</code> returns the boolean matrix <code class="code">mat</code> of dimension <var class="Arg">n</var> such that <code class="code">mat[i][j] = true</code> if and only if <code class="code">j = i ^ x</code>.</p>
<p>If no positive integer <var class="Arg">n</var> is specified, then the largest moved point of <varclass="Arg">x</var> is used as the value for <var class="Arg">n</var>; see <code class="func">LargestMovedPoint</code> (<a href="../../../doc/ref/chap42_mj.html#X84AA603987C94AC0"><span class="RefLink">Reference: LargestMovedPoint for a permutation</span></a>).</p>
</dd>
<dt><strong class="Mark">transformations</strong></dt>
<dd><p>If <var class="Arg">x</var> is a transformation and <var class="Arg">n</var> is a positive integer such that <var class="Arg">x</var> is a transformation of <code class="code">[1 .. <var class="Arg">n</var>]</code>, then <code class="code">AsTransformation</code> returns the boolean matrix <code class="code">mat</code> of dimension <var class="Arg">n</var> such that <code class="code">mat[i][j] = true</code> if and only if <code class="code">j = i ^ x</code>.</p>
<p>If the positive integer <var class="Arg">n</var> is not specified, then the degree of <var class="Arg">f</var> is used as the value for <var class="Arg">n</var>.</p>
</dd>
<dt><strong class="Mark">partial permutations</strong></dt>
<dd><p>If <var class="Arg">x</var> is a partial permutation and <var class="Arg">n</var> is a positive integer such that <code class="code">i ^ <var class="Arg">x</var> <= n</code> for all <code class="code">i</code> in <code class="code">[1 .. <var class="Arg">n</var>]</code>, then <code class="code">AsBooleanMat</code> returns the boolean matrix <code class="code">mat</code> of dimension <var class="Arg">n</var> such that <code class="code">mat[i][j] = true</code> if and only if <code class="code">j = i ^ x</code>.</p>
<p>If the optional argument <var class="Arg">n</var> is not present, then the default value of the maximum of degree and the codegree of <var class="Arg">x</var> is used.</p>
</dd>
<dt><strong class="Mark">bipartitions</strong></dt>
<dd><p>If <var class="Arg">x</var> is a bipartition and <var class="Arg">n</var> is any non-negative integer, then <code class="code">AsBooleanMat</code> returns the boolean matrix <code class="code">mat</code> of dimension <var class="Arg">n</var> such that <code class="code">mat[i][j] = true</code> if and only if <code class="code">i</code> and <code class="code">j</code> belong to the same block of <var class="Arg">x</var>.</p>
<p>If the optional argument <var class="Arg">n</var> is not present, then twice the degree of <var class="Arg">x</var> is used by default.</p>
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.