<h3>4 <span class="Heading">Functions for Noncommutative Monomials</span></h3>
<p>A monomial, such as <span class="SimpleMath">ab^2a</span> is represented in <strong class="pkg">GBNP</strong> as the list <span class="SimpleMath">[1,2,2,1]</span>. Polynomials have a more complicated structure, for example <span class="SimpleMath">6ab^2a - 7ab + 8ba</span> is represented in <strong class="pkg">GBNP</strong> by <span class="SimpleMath">[ [ [1,2,2,1], [1,2], [2,1] ], [6,-7,8] ]</span>, which is a list of monomials followed by the corresponding list of coefficients. Polynomials are dealt with in the following chapter.</p>
<p>As shown in Section <a href="chap2.html#X783C6EC87988B533"><span class="RefLink">2.1</span></a>, <strong class="pkg">GBNP</strong> has functions <code class="code">PrintNP</code> and <code class="code">PrintNPList</code> to print a polynomial and a list of polynomials. Here we provide equivalent functions for monomials.</p>
<p>For convenience of use in examples, three algebras over the rationals, <code class="code">AlbebraIBNP</code> and <code class="code">AlgebrakIBNP</code> with <span class="SimpleMath">k ∈ [2,3,4]</span>, are predefined in this package.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NM2GM</code>( <var class="Arg">monomial</var>, <var class="Arg">algebra</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NM2GMList</code>( <var class="Arg">list</var>, <var class="Arg">algebra</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Recall, from <strong class="pkg">GBNP</strong>, that the functions <code class="code">NP2GP</code> and <code class="code">NP2GPList</code> convert a polynomial (or list of polynomials) in NP-format to an element of the algebra. This package provides additional functions <code class="code">NM2GM</code> and <code class="code">NM2GMList</code> which do the equivalent conversion for monomials.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GM2NM</code>( <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GM2NMList</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Recall, from <strong class="pkg">GBNP</strong>, that the functions <code class="code">GP2NP</code> and <code class="code">GP2NPList</code> convert a polynomial (or list of polynomials) to the equivalent NP-format. This package provides additional functions <code class="code">GM2NM</code> and <code class="code">GM2NMList</code> which do the equivalent conversion for monomials.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SuffixPrefixPosNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var>, <var class="Arg">posint</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The operation <code class="code">SuffixPrefixPosNM( left, right, start, limit)</code> looks for overlaps of type <em>suffix of left = prefix of right</em>. The size of the smallest such overlap is returned. The overlaps which are considered are controlled by the third and fourth arguments. We commence by looking at the overlap of size <em>start</em> and go no further than the overlap of size <em>limit</em>. When no overlap exists, <span class="SimpleMath">0</span> is returned. To test all possibilities, <em>start</em> should be <span class="SimpleMath">1</span> and <em>limit</em> should be <span class="SimpleMath">min(|left|,|right|)-1</span>. It is the user's responsibility to make sure that these bounds are correct - no checks are made.
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SubwordPosNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsSubwordNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The operation <code class="code">SubwordPosNM( small, large, start );</code> answers the question for monomials <em>Is small a subword of large?</em>. The value returned is the start position in <em>large</em> of the first subword found. When no subword is found, <span class="SimpleMath">0</span> is returned. The search commences at position <em>start</em> in <em>large</em> so, to test all possibilities, the third argument should be <span class="SimpleMath">1</span>.</p>
<p>To just ask whether or not <em>small</em> is a subword of <em>large</em>, use <code class="code">IsSubwordNM( small, large);</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DivNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The operation <code class="code">DivNM(large, small);</code> for two monomials returns all the ways that <em>small</em> divides <em>large</em> in the form of a list of pairs of monomials <em>[left,right]</em> so that <em>large = left*small*right</em>. In the example we search for subwords <span class="SimpleMath">ab</span> of <span class="SimpleMath">m = abcababc</span>, returning <span class="SimpleMath">[ [abcab,c], [abc,abc], [1,cababc] ]</span>.</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.0.19Bemerkung:
(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.