# polynomial

polynomial, an Octave code which adds, multiplies, differentiates, evaluates and prints multivariate polynomials in a space of M dimensions.

Any polynomial in M variables can be written as a linear combination of monomials in M variables. The "total degree" of the polynomial is the maximum of the degrees of the monomials that it comprises. For instance, a polynomial in M = 2 variables of total degree 3 might have the form:

```        p(x,y) = c(0,0) x^0 y^0
+ c(1,0) x^1 y^0 + c(0,1) x^0 y^1
+ c(2,0) x^2 y^0 + c(1,1) x^1 y^1 + c(0,2) x^0 y^2
+ c(3,0) x^3 y^0 + c(2,1) x^2 y^1 + c(1,2) x^1 y^2 + c(0,3) x^0 y^3
```
The monomials in M variables can be regarded as a natural basis for the polynomials in M variables.

When listing the monomials that form a polynomial, it is useful to have an ordering that organizes them. One natural ordering can be illustrated for the 3-dimensional case:

```        1
x, y, z
x^2, xy, xz, y^2, yz, z^2
x^3, x^2y, x^2z, xy^2, xyz, xz^2, y^3, y^2z, yz^2, z^3
x^4, x^3y, ...
```
Here, a monomial precedes another if it has a lower degree. If the monomials have the same degree, then a monomial precedes another if its exponent vector lexically precedes that of the other. In other words, we compare the two exponent vectors, reading from left to right, looking for the first location where the exponents differ. The monomial with the higher exponent at this point precedes the other.

### Languages:

polynomial is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

### Related Data and Programs:

combo, an Octave code which includes routines for ranking, unranking, enumerating and randomly selecting balanced sequences, cycles, graphs, Gray codes, subsets, partitions, permutations, restricted growth functions, Pruefer codes and trees.

monomial, an Octave code which enumerates, lists, ranks, unranks and randomizes multivariate monomials in a space of M dimensions, with total degree less than N, equal to N, or lying within a given range.

octave_polynomial, an Octave code which analyzes a variety of polynomial families, returning the polynomial values, coefficients, derivatives, integrals, roots, or other information.

polynomial_multiply, an Octave code which multiplies two polynomials p(x) and q(x).

r8poly, an Octave code which contains a number of utilities for polynomials with R8 coefficients, that is, using double precision or 64 bit real arithmetic.

set_theory, an Octave code which demonstrates MATLAB commands that implement various set theoretic operations.

subset, an Octave code which enumerates, generates, ranks and unranks combinatorial objects including combinations, compositions, Gray codes, index sets, partitions, permutations, subsets, and Young tables.

-