zero | R Documentation |
Test for a multivariate polynomial being zero
is.zero(x)
x |
Object of class |
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).
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?
Robin K. S. Hankin
constant
constant(0)
t1 <- as.mvp("x+y")
t2 <- as.mvp("x-y")
stopifnot(is.zero(t1*t2-as.mvp("x^2-y^2")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.