Whether a 'qspray' is a polynomial of some given 'qsprays'
Whether a 'qspray' is a polynomial of some given 'qsprays'
Checks whether a qspray polynomial can be written as a polynomial of some given qspray polynomials. If TRUE, this polynomial is returned.
isPolynomialOf(qspray, qsprays)
Arguments
qspray: a qspray object
qsprays: a list of qspray objects
Returns
A Boolean value indicating whether the polynomial defined by qspray can be written as a polynomial of the polynomials defined by the qspray objects given in the qsprays list. If this is TRUE, this polynomial is returned as an attribute named "polynomial".
Examples
library(qspray)x <- qlone(1); y <- qlone(2); z <- qlone(3)q1 <- x + y
q2 <- x*z^2+4qspray <- q1^2*q2 +2*q1 +3( check <- isPolynomialOf(qspray, list(q1, q2)))POLYNOMIAL <- attr(check,"polynomial")changeVariables(POLYNOMIAL, list(q1, q2))== qspray # should be TRUE