R: S3 Group Generic Functions for Polynomial and Polylist...

Math.polynom {PolynomF} | R Documentation

## S3 Group Generic Functions for Polynomial and Polylist Objects

### Description

The function `Ops.polynom` allows arithmetic operations on `polynom` objects: addition, subtraction, multiplication, division (with remainder), remainder, raising to a non-negaive integer power. It also allows exact equality and exact inequality tests.

`Math.polynom` allows `round`, `signif`, `floor`, `ceiling` and `trunc` operations on a `polynom` coefficient vector, returning a `polynom` result.

`Summary.polynom` and `Summary.polylist` allow `sum` and `prod` operations on `polynom` arguments, specified either as individual `polynom` objects or in a single `polylist` object.

### Usage

    ## S3 method for class 'polynom'
    Math(x, ...)
    ## S3 method for class 'polylist'
    Math(x, ...)
    ## S3 method for class 'polynom'
    Ops(e1, e2)
    ## S3 method for class 'polynom'
    Summary(..., na.rm = FALSE)
    ## S3 method for class 'polylist'
    Summary(..., na.rm = FALSE)

### Arguments

`e1, e2` | Objects of class `polynom` or numeric arguments which may be coerced to class `polynom`. At least one must be a `polynom` object.
`x` | An object of class `polymon` or `polylist`.
`...` | `polynom` objects or scalar numeric, as appropriate. In the case of `Summary.polylist`, may be a single `polylist` object.
`na.rm` | logical: should missing values be removed first?

### Details

None of these functions is called directly. `Ops.polynom` is the workhorse of the entire package. `Ops.polylist` allows vectorised arithmetic computations on `polylist`s.

### Value

A `polynom` (or `polylist`) object giving the result of the operation.

### Author(s)

Bill Venables, with some code provided by Kurt Hornik

### References

None

### Examples

    x <- polynom(0:1)
    p <- (x + 1)^2 - 3

    round(p/3)
    sum(p, p^2, p^3, p^4)

[Package PolynomF version 1.0-1 Index]