<?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>someTerms -- select some terms of a polynomial</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="___Sort.html">next</a> | <a href="_solve.html">previous</a> | <a href="___Sort.html">forward</a> | <a href="_solve.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>someTerms -- select some terms of a polynomial</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>someTerms(f,i,n)</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>f</tt>, <span>a <a href="___Ring__Element.html">ring element</a></span>, in a polynomial ring</span></li> <li><span><tt>i</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, the starting index</span></li> <li><span><tt>n</tt>, <span>an <a href="___Z__Z.html">integer</a></span>, the number of terms to select</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Ring__Element.html">ring element</a></span>, the <tt>n</tt> terms of the polynomial <tt>f</tt> starting with the <tt>i</tt>-th one</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div>The index i is 0-based, and a negative number refers to location from the end of the polynomial.<table class="examples"><tr><td><pre>i1 : R = ZZ[a..d];</pre> </td></tr> <tr><td><pre>i2 : f = (a+2*b-3)^2 2 2 o2 = a + 4a*b + 4b - 6a - 12b + 9 o2 : R</pre> </td></tr> <tr><td><pre>i3 : someTerms(f,0,1) -- the lead term 2 o3 = a o3 : R</pre> </td></tr> <tr><td><pre>i4 : someTerms(f,-1,1) -- the last term o4 = 9 o4 : R</pre> </td></tr> <tr><td><pre>i5 : someTerms(f,-2,2) -- the last 2 terms o5 = - 12b + 9 o5 : R</pre> </td></tr> </table> Here is an example whre the coefficient ring is also a polynomial ring.<table class="examples"><tr><td><pre>i6 : S = R[x,y,z];</pre> </td></tr> <tr><td><pre>i7 : f = (x*(a-b)+y^2+a-1)^2 4 2 2 2 2 2 2 o7 = y + (2a - 2b)x*y + (a - 2a*b + b )x + (2a - 2)y + (2a - 2a*b - 2a ------------------------------------------------------------------------ 2 + 2b)x + a - 2a + 1 o7 : S</pre> </td></tr> <tr><td><pre>i8 : someTerms(f,-1,1) -- the last term 2 o8 = a - 2a + 1 o8 : S</pre> </td></tr> <tr><td><pre>i9 : someTerms(f,-2,2) -- the last 2 terms 2 2 o9 = (2a - 2a*b - 2a + 2b)x + a - 2a + 1 o9 : S</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_monomials.html" title="matrix of monomials in a ring element or matrix">monomials</a> -- matrix of monomials in a ring element or matrix</span></li> <li><span><a href="_coefficients.html" title="monomials and their coefficients">coefficients</a> -- monomials and their coefficients</span></li> <li><span><a href="_terms.html" title="provide a list of terms of a polynomial">terms</a> -- provide a list of terms of a polynomial</span></li> <li><span><a href="_lead__Term.html" title="get the greatest term">leadTerm</a> -- get the greatest term</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>someTerms</tt> :</h2> <ul><li>someTerms(RingElement,ZZ,ZZ)</li> </ul> </div> </div> </body> </html>