polynomial-class: Class '"polynomial"'

Description Objects from the Class Slots Extends Methods See Also

Description

A class to hold the coefficients and exponents of a polynomial.

Objects from the Class

Objects can be created by calls to the function as.polynomial.

Slots

.Data:

Object of class "numbers": numeric or complex coefficients. Despite this, the functions is.numeric and is.complex will always return FALSE because arithmetic on them does not make sense (inconsistent with the base arithmetic operators).

exponents:

Object of class "integer": exponents must be not NA and non-negative.

Extends

Class "numbers", from data part.

Methods

-

Negate a polynomial or subtract two polynomials.

*

Multiply two polynomials.

/

Divide two polynomials. A warning is issued for non-zero remainder.

[

Subset a polynomial. Matrix and array indexing is allowed. Special care has been taken to ensure that in such cases, the exponents are subsetted correctly.

[[

Subset a polynomial. Matrix and array indexing is allowed. Special care has been taken to ensure that in such cases, the exponents are subsetted correctly.

^

Raise a polynomial to a non-negative integer power. As with ordinary ^, a power of 0 returns 1 (as a polynomial, however), and a power of 1 returns the unmodified polynomial. A zero length power returns a zero length polynomial. A negative or missing valued power returns the same polynomial with all missing coefficients.

+

Unary + or add two polynomials.

as.function

Coerce a polynomial to a univariate function. The name of the variable is determined by xname and the body of the function is determined by as.body.

as.list

Coerce a polynomial to a list. Names are preserved.

coef, exponents

Select the coefficients or exponents part only of a polynomial.

coerce

Coerce any object to a polynomial.

degree

Calculate the degree of a polynomial, the maximum coefficient.

deriv, integral

Calculate the derivative or integral of a polynomial.

plot, points, lines

Plot a polynomial. See plot.polynomial.

predict

Calculate the value of a polynomial at a set of points.

See Also

CommonPolynomials, reduce, as.body.


polynomial documentation built on Feb. 22, 2021, 5:08 p.m.