Previous Page Next Page Contents

poly2list -- convert a polynomial to a list of terms

Introduction

poly2list(p) returns a term list containing the coefficients and exponent vectors of the polynomial p.

Call(s)

poly2list(p)
poly2list(f <, vars>)

Parameters

p - a polynomial of type DOM_POLY
f - a polynomial expression
vars - a list of indeterminates of the polynomial: typically, identifiers or indexed identifiers

Returns

a list containing the coefficients and exponent vectors of the polynomial. FAIL is returned if a given expression cannot be converted to a polynomial.

Related Functions

coeff, coerce, degree, degreevec, lcoeff, poly, tcoeff

Details

Example 1

The following expressions define univariate polynomials. Thus the term lists contain exponents and not exponent vectors:

>> poly2list(2*x^100 + 3*x^10 + 4)
                        [[2, 100], [3, 10], [4, 0]]
>> poly2list(2*x*(x + 1)^2)
                         [[2, 3], [4, 2], [2, 1]]

Specification of a list of indeterminates allows to distinguish symbolic parameters from the indeterminates:

>> poly2list(a*x^2 + b*x + c, [x])
                         [[a, 2], [b, 1], [c, 0]]

Example 2

In this example the polynomial is bivariate, thus exponent vectors are returned:

>> poly2list((x*(y + 1))^2, [x, y])
                  [[1, [2, 2]], [2, [2, 1]], [1, [2, 0]]]

Example 3

In this example a polynomial of domain type DOM_POLY is given. This form must be used if the polynomial has coefficients that does not consist of expressions:

>> poly2list(poly(-4*x + 5*y - 5, [x, y], IntMod(7)))
                 [[3, [1, 0]], [-2, [0, 1]], [2, [0, 0]]]

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000