degreevec -- the exponents of
the leading term of a polynomial
Introductiondegreevec(p) returns a list with the
exponents of the leading term of the polynomial p.
Call(s)degreevec(p <, order>)
degreevec(f <, vars> <, order>)
Parametersp |
- | a polynomial of type
DOM_POLY |
order |
- | the term ordering: either LexOrder,
or DegreeOrder, or DegInvLexOrder, or a user-defined term ordering
of type Dom::MonomOrdering. The default
is the lexicographical ordering LexOrder. |
f |
- | a polynomial expression |
vars |
- | a list of indeterminates of the polynomial: typically, identifiers or indexed identifiers |
Returnsa list of nonnegative integers. FAIL is returned if the input cannot be
converted to a polynomial.
p, f
Related
Functionscoeff, degree, ground, lcoeff, ldegree, lmonomial, lterm, nterms, nthcoeff, nthmonomial, nthterm, poly, poly2list, tcoeff
Detailsf is not element of a polynomial
domain, then degreevec converts the expression internally
to a polynomial of type DOM_POLY via poly(f). If a list of
indeterminates is specified, the polynomial poly(f, vars) is
considered.degreevec returns a list of zeroes for the zero
polynomial.
Example
1The leading term of the following polynomial expression
(with respect to the main variable x) is
x^4:
>> degreevec(x^4 + x^2*y^3 + 2, [x, y])
[4, 0]
With the main variable y, the leading term
is x^2y^3:
>> degreevec(x^4 + x^2*y^3 + 2, [y, x])
[3, 2]
For polynomials of type DOM_POLY, the indeterminates are an
integral part of the data type:
>> degreevec(poly(x^4 + x^2*y^3 + 2, [x, y])), degreevec(poly(x^4 + x^2*y^3 + 2, [y, x]))
[4, 0], [3, 2]
Example
2For a univariate polynomial, the standard term orderings regard the same term as ``leading'':
>> degreevec(poly(x^2*z + x*z^3 + 1, [x]), LexOrder), degreevec(poly(x^2*z + x*z^3 + 1, [x]), DegreeOrder), degreevec(poly(x^2*z + x*z^3 + 1, [x]), DegInvLexOrder)
[2], [2], [2]
In the multivariate case, different polynomial orderings may yield different leading exponent vectors:
>> degreevec(poly(x^2*z + x*z^3 + 1, [x, z])), degreevec(poly(x^2*z + x*z^3 + 1, [x, z]), DegreeOrder)
[2, 1], [1, 3]
>> degreevec(x^3 + x*y^2*z - 5*y^4, [x, y, z], LexOrder), degreevec(x^3 + x*y^2*z - 5*y^4, [x, y, z], DegreeOrder), degreevec(x^3 + x*y^2*z - 5*y^4, [x, y, z], DegInvLexOrder)
[3, 0, 0], [1, 2, 1], [0, 4, 0]
Example
3The exponent vector of the zero polynomial is a list of zeroes:
>> degreevec(0, [x, y, z])
[0, 0, 0]
degreevec was a
kernel function.