Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 91213ddcfbe7f54821d42c2d9e091326 > files > 1514

gap-system-packages-4.4.12-5mdv2010.0.i586.rpm

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (HAPprime) - Chapter 4: General Functions</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
</head>
<body>


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">Top of Book</a>&nbsp;  &nbsp;<a href="chap3.html">Previous Chapter</a>&nbsp;  &nbsp;<a href="chapInd.html">Next Chapter</a>&nbsp;  </div>

<p><a id="X7B65E0C37AAB6066" name="X7B65E0C37AAB6066"></a></p>
<div class="ChapSects"><a href="chap4.html#X7B65E0C37AAB6066">4 <span class="Heading">General Functions</span></a>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap4.html#X812CCAB278643A59">4.1 <span class="Heading">Matrices</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X845EA1B28618D9A7">4.1-1 SumIntersectionMatDestructive</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X8359E68C7F38BA5F">4.1-2 SolutionMat</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X872D9F5D7ED6F4AA">4.1-3 IsSameSubspace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X789478557955E1C3">4.1-4 PrintDimensionsMat</a></span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap4.html#X826D8334845549EC">4.2 <span class="Heading">Polynomials</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X7E8B84388516792D">4.2-1 TermsOfPolynomial</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X7A603BCA83895309">4.2-2 UnivariateMonomialsOfMonomial</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X87719F697BFDACC9">4.2-3 IndeterminateAndCoefficientOfUnivariateMonomial</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X87DE84AC7B62DC5C">4.2-4 ReduceIdeal</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X87945C228476D46D">4.2-5 ReducePolynomialRingPresentation</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap4.html#X7A489A5D79DA9E5C">4.2-6 <span class="Heading">Examples</span></a>
</span>
</div>
</div>

<h3>4 <span class="Heading">General Functions</span></h3>

<p>Some of the functions provided by <strong class="pkg">HAPprime</strong> are not specifically aimed at homological algebra or extending the <strong class="pkg">HAP</strong> package. The functions in this chapter, which are used internally by <strong class="pkg">HAPprime</strong> extend some of the standard <strong class="pkg">GAP</strong> functions and datatypes.</p>

<p><a id="X812CCAB278643A59" name="X812CCAB278643A59"></a></p>

<h4>4.1 <span class="Heading">Matrices</span></h4>

<p>See <a href="../../../../../gap4r4/doc/htm/ref/CHAP024.htm"><b>Reference: Matrices</b></a> in the <strong class="pkg">GAP</strong> reference manual for the standard <strong class="pkg">GAP</strong> matrix functions.</p>

<p><a id="X845EA1B28618D9A7" name="X845EA1B28618D9A7"></a></p>

<h5>4.1-1 SumIntersectionMatDestructive</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; SumIntersectionMatDestructive</code>( <var class="Arg">U, V</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">&gt; SumIntersectionMatDestructiveSE</code>( <var class="Arg">Ubasis, Uheads, Vbasis, Vheads</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns a list of length 2 with, at the first position, the sum of the vector spaces generated by the rows of <var class="Arg">U</var> and <var class="Arg">V</var>, and, at the second positionion, the intersection of the spaces.</p>

<p>Like the <strong class="pkg">GAP</strong> core function <code class="func">SumIntersectionMat</code> (<a href="../../../../../gap4r4/doc/htm/ref/CHAP024.htm#SECT010"><b>Reference: SumIntersectionMat</b></a>), this performs Zassenhaus' algorithm to compute bases for the sum and the intersection. However, this version operates directly on the input matrices (thus corrupting them), and is rewritten to require only approximately 1.5 times the space of the orginal input matrices, compared with the 3 times memory requirement of the original version (in addition to the original input matrices in this case).</p>

<p>The function <code class="keyw">SumIntersectionMatDestructiveSE</code> takes as arguments not a pair of generating matrices, but a pair of semi-echelon basis matrices and the corresponding head locations, such as is returned by a call to <code class="func">SemiEchelonMatDestructive</code> (<a href="../../../../../gap4r4/doc/htm/ref/CHAP024.htm#SECT009"><b>Reference: SemiEchelonMatDestructive</b></a>) (these arguments must all be mutable, so <code class="func">SemiEchelonMat</code> (<a href="../../../../../gap4r4/doc/htm/ref/CHAP024.htm#SECT009"><b>Reference: SemiEchelonMat</b></a>) cannot be used). This function is used internally by <code class="keyw">SumIntersectionMatDestructive</code>, and is provided for the occasions when the user might already have the semi-echelon versions available, in which case a small amount of time will be saved.</p>

<p><a id="X8359E68C7F38BA5F" name="X8359E68C7F38BA5F"></a></p>

<h5>4.1-2 SolutionMat</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; SolutionMat</code>( <var class="Arg">M, V</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">&gt; SolutionMatDestructive</code>( <var class="Arg">M, V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Calculates, for each row vector v_i in the matrix <var class="Arg">V</var>, a solution to x_i x M = v_i, and returns these solutions in a matrix X, whose rows are the vectors x_i. If there is not a solution for a v_i, then <code class="keyw">fail</code> is returned for that row.</p>

<p>These functions are identical to the kernel functions <code class="func">SolutionMat</code> (<a href="../../../../../gap4r4/doc/htm/ref/CHAP024.htm#SECT006"><b>Reference: SolutionMat</b></a>) and <code class="func">SolutionMatDestructive</code> (<a href="../../../../../gap4r4/doc/htm/ref/CHAP024.htm#SECT006"><b>Reference: SolutionMatDestructive</b></a>), but are provided for cases where multiple solutions using the same matrix <var class="Arg">M</var> are required. In these cases, using this function is far faster, since the matrix is only decomposed once.</p>

<p>The <code class="code">Destructive</code> version currupts both the input matrices, while the non-<code class="code">Destructive</code> version operates on copies of these.</p>

<p><a id="X872D9F5D7ED6F4AA" name="X872D9F5D7ED6F4AA"></a></p>

<h5>4.1-3 IsSameSubspace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; IsSameSubspace</code>( <var class="Arg">U, V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns <code class="keyw">true</code> if the subspaces spanned by the rows of <var class="Arg">U</var> and <var class="Arg">V</var> are the same, <code class="keyw">false</code> otherwise.</p>

<p>This function treats the rows of the two matrices as vectors from the same vector space (with the same basis), and tests whether the subspace spanned by the two sets of vectors is the same.</p>

<p><a id="X789478557955E1C3" name="X789478557955E1C3"></a></p>

<h5>4.1-4 PrintDimensionsMat</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; PrintDimensionsMat</code>( <var class="Arg">M</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns a string containing the dimensions of the matrix <var class="Arg">M</var> in the form <code class="code">"mxn"</code>, where <code class="keyw">m</code> is the number of rows and <code class="keyw">n</code> the number of columns. If the matrix is empty, the returned string is <code class="code">"empty"</code>.</p>

<p><a id="X826D8334845549EC" name="X826D8334845549EC"></a></p>

<h4>4.2 <span class="Heading">Polynomials</span></h4>

<p>See <a href="../../../../../gap4r4/doc/htm/ref/CHAP064.htm"><b>Reference: Polynomials and Rational Functions</b></a> in the <strong class="pkg">GAP</strong> reference manual for the functions provided by <strong class="pkg">GAP</strong> for representing an manipulating polynomials.</p>

<p><a id="X7E8B84388516792D" name="X7E8B84388516792D"></a></p>

<h5>4.2-1 TermsOfPolynomial</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; TermsOfPolynomial</code>( <var class="Arg">poly</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><b>Returns: </b>List of pairs</p>

<p>Returns a list of the terms in the polynomial. This list is a list of pairs of the form <code class="code">[mon, coeff]</code> where <code class="code">mon</code> is a monomial and <code class="code">coeff</code> is the coefficient of that monomial in the polynomial. The monomials are sorted according to the total degree/lexicograhic order (the same as the in <code class="func">MonomialGrLexOrdering</code> (<a href="../../../../../gap4r4/doc/htm/ref/CHAP064.htm#SECT016"><b>Reference: MonomialGrlexOrdering</b></a>)).</p>

<p><a id="X7A603BCA83895309" name="X7A603BCA83895309"></a></p>

<h5>4.2-2 UnivariateMonomialsOfMonomial</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; UnivariateMonomialsOfMonomial</code>( <var class="Arg">mon</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><b>Returns: </b>List of univariate monomials</p>

<p>Returns a list of the univariate monomials of the largest order whose product equals <var class="Arg">mon</var>. The univariate monomials are sorted according to their indeterminate number.</p>

<p><a id="X87719F697BFDACC9" name="X87719F697BFDACC9"></a></p>

<h5>4.2-3 IndeterminateAndCoefficientOfUnivariateMonomial</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; IndeterminateAndCoefficientOfUnivariateMonomial</code>( <var class="Arg">mon</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><b>Returns: </b>List</p>

<p>Returns a list with in the first position the indeterminate of the univariate monomial <var class="Arg">mon</var> and in the second position the coefficient of that indeterminate in the monomial. If <var class="Arg">mon</var> is not a monomial, then <code class="keyw">fail</code> is returned.</p>

<p><a id="X87DE84AC7B62DC5C" name="X87DE84AC7B62DC5C"></a></p>

<h5>4.2-4 ReduceIdeal</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; ReduceIdeal</code>( <var class="Arg">I, O</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><b>Returns: </b>List of polynomials</p>

<p>Returns a reduced version of the ideal <var class="Arg">I</var>, i.e. one in which no monomial in a polynomial in <var class="Arg">I</var> is divisible by the leading term of another polynomial in <var class="Arg">I</var>. The monomial ordering to be used is specified by <var class="Arg">O</var> (see <a href="../../../../../gap4r4/doc/htm/ref/CHAP064.htm#SECT016"><b>Reference: Monomial Orderings</b></a>).</p>

<p><a id="X87945C228476D46D" name="X87945C228476D46D"></a></p>

<h5>4.2-5 ReducePolynomialRingPresentation</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; ReducePolynomialRingPresentation</code>( <var class="Arg">ring, ideal</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><b>Returns: </b>List</p>

<p>Reduces a polynomial ring presentation to an isomorphic presentation involving the minimal number of indeterminates. Returns a list with, in the first place, the new polynomial ring, and in the second place the new relations.</p>

<p><a id="X7A489A5D79DA9E5C" name="X7A489A5D79DA9E5C"></a></p>

<h5>4.2-6 <span class="Heading">Examples</span></h5>


<table class="example">
<tr><td><pre>
gap&gt; ring := PolynomialRing(Integers, 2);;
gap&gt; i := IndeterminatesOfPolynomialRing(ring);;
gap&gt; poly := i[1] + i[1]*i[2]^2 + 3*i[2]^3;
x_1*x_2^2+3*x_2^3+x_1
gap&gt; terms := TermsOfPolynomial(poly);
[ [ x_1, 1 ], [ x_2^3, 3 ], [ x_1*x_2^2, 1 ] ]
gap&gt; UnivariateMonomialsOfMonomial(terms[3][1]);
[ x_1, x_2^2 ]
gap&gt; IndeterminateAndCoefficientOfUnivariateMonomial(last[2]);
[ x_2, 2 ]
      </pre></td></tr></table>


<table class="example">
<tr><td><pre>
gap&gt; ring := PolynomialRing(GF(2), 2);;
gap&gt; i := IndeterminatesOfPolynomialRing(ring);;
gap&gt; I := [i[1]^2 + i[2], i[1]^3 + i[2]^3];
[ x_1^2+x_2, x_1^3+x_2^3 ]
gap&gt; ReduceIdeal(I, MonomialLexOrdering());
[ x_1^2+x_2, x_2^3+x_1*x_2 ]
      </pre></td></tr></table>


<table class="example">
<tr><td><pre>
gap&gt; ring := PolynomialRing(GF(2), 3);;
gap&gt; i := IndeterminatesOfPolynomialRing(ring);;
gap&gt; ideal := [ i[3]^2 + i[1] + i[2] ];
[ x_3^2+x_1+x_2 ]
gap&gt; ReducePolynomialRingPresentation(ring, ideal);
[ GF(2)[x_1,x_3], [  ] ]
      </pre></td></tr></table>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">Top of Book</a>&nbsp;  &nbsp;<a href="chap3.html">Previous Chapter</a>&nbsp;  &nbsp;<a href="chapInd.html">Next Chapter</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>