Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 5324

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>weightRange -- the pair of lowest and highest weights of the monomials</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="___Weyl__Algebra.html">next</a> | <a href="_wedge__Product_lp__Z__Z_cm__Z__Z_cm__Module_rp.html">previous</a> | <a href="___Weyl__Algebra.html">forward</a> | <a href="_wedge__Product_lp__Z__Z_cm__Z__Z_cm__Module_rp.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<hr/>
<div><h1>weightRange -- the pair of lowest and highest weights of the monomials</h1>
<div class="single"><h2>Description</h2>
<div><div><h2>Synopsis</h2>
<ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>(lo,hi) = weightRange(w,f)</tt></div>
</dd></dl>
</div>
</li>
<li>Inputs:<ul><li><span><tt>w</tt>, <span>a <a href="___List.html">list</a></span>, of integers, the weight of each variable</span></li>
<li><span><tt>f</tt>, <span>a <a href="___Ring__Element.html">ring element</a></span>, in a polynomial ring</span></li>
</ul>
</li>
<li>Outputs:<ul><li><span><tt>lo</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, the least weight of the monomials of <tt>f</tt></span></li>
<li><span><tt>hi</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, the greatest weight of the monomials of <tt>f</tt></span></li>
</ul>
</li>
</ul>
The weight of a monomial is the dot product of w and the exponent vector.  If the weight vector has length smaller than the number of variables, the other variables are assumed to have weight zero.  If there are too many weights given, the extras are silently ignored.<table class="examples"><tr><td><pre>i1 : R = QQ[a..g]

o1 = R

o1 : PolynomialRing</pre>
</td></tr>
<tr><td><pre>i2 : f = a^3+b^2*c+3*f^10*d-1+e-e

         10    3    2
o2 = 3d*f   + a  + b c - 1

o2 : R</pre>
</td></tr>
<tr><td><pre>i3 : weightRange({1,1,0,0,0,0,0},f)

o3 = (0, 3)

o3 : Sequence</pre>
</td></tr>
</table>
Use  <a href="_terms.html" title="provide a list of terms of a polynomial">terms</a> and <a href="_weight__Range.html" title="the pair of lowest and highest weights of the monomials">weightRange</a> together to select the terms which have a given weight.<table class="examples"><tr><td><pre>i4 : f = a^2*b+3*a^2*c+b*c+1

      2      2
o4 = a b + 3a c + b*c + 1

o4 : R</pre>
</td></tr>
<tr><td><pre>i5 : sum select(terms f, t -> (weightRange({1,0},t))#0 == 2)

      2      2
o5 = a b + 3a c

o5 : R</pre>
</td></tr>
</table>
If the coefficient ring is a polynomial ring, one can use the weights of these variables too.  The order of weights is the same as the order of variables (see <a href="_index.html" title="numeric index of a ring variable">index</a>)<table class="examples"><tr><td><pre>i6 : S = R[x,y];</pre>
</td></tr>
<tr><td><pre>i7 : weightRange({0,0,3,7},a*x^2+b*x*y)

o7 = (3, 7)

o7 : Sequence</pre>
</td></tr>
</table>
</div>
<div><h2>Synopsis</h2>
<ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>(lo,hi) = weightRange f</tt></div>
</dd></dl>
</div>
</li>
<li>Inputs:<ul><li><span><tt>f</tt>, <span>a <a href="___Ring__Element.html">ring element</a></span></span></li>
</ul>
</li>
<li>Outputs:<ul><li><span><tt>lo</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, the minimum value for (the first component of) the degrees of the monomials occurring in <tt>f</tt></span></li>
<li><span><tt>hi</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, the corresponding maximum value</span></li>
</ul>
</li>
</ul>
<table class="examples"><tr><td><pre>i8 : R = QQ[x,y];</pre>
</td></tr>
<tr><td><pre>i9 : weightRange (x^3+y^2)^5

o9 = (10, 15)

o9 : Sequence</pre>
</td></tr>
</table>
</div>
</div>
</div>
<div class="single"><h2>See also</h2>
<ul><li><span><a href="_degree.html" title="">degree</a></span></li>
<li><span><a href="_homogenize.html" title="homogenize with respect to a variable">homogenize</a> -- homogenize with respect to a variable</span></li>
<li><span><a href="_part.html" title="select terms of a polynomial by degree or weight">part</a> -- select terms of a polynomial by degree or weight</span></li>
<li><span><a href="_index.html" title="numeric index of a ring variable">index</a> -- numeric index of a ring variable</span></li>
</ul>
</div>
<div class="waystouse"><h2>Ways to use <tt>weightRange</tt> :</h2>
<ul><li>weightRange(List,RingElement)</li>
<li>weightRange(RingElement)</li>
</ul>
</div>
</div>
</body>
</html>