zero: The zero polynomial

zeroR Documentation

The zero polynomial

Description

Test for a multivariate polynomial being zero

Usage

is.zero(x)

Arguments

x

Object of class mvp

Details

Function is.zero() returns TRUE if x is indeed the zero polynomial. It is defined as length(vars(x))==0 for reasons of efficiency, but conceptually it returns x==constant(0).

(Use constant(0) to create the zero polynomial).

Note

I would have expected the zero polynomial to be problematic (cf the freegroup and permutations packages, where similar issues require extensive special case treatment). But it seems to work fine, which is a testament to the robust coding in the STL.

A general mvp object is something like

{{"x" -> 3, "y" -> 5} -> 6, {"x" -> 1, "z" -> 8} -> -7}}

which would be 6x^3y^5-7xz^8. The zero polynomial is just {}. Neat, eh?

Author(s)

Robin K. S. Hankin

See Also

constant

Examples


constant(0)

t1 <- as.mvp("x+y")
t2 <- as.mvp("x-y")

stopifnot(is.zero(t1*t2-as.mvp("x^2-y^2")))


mvp documentation built on March 31, 2023, 5:43 p.m.