changeVariables {ratioOfQsprays}R Documentation

Change of variables in a 'ratioOfQsprays' fraction of polynomials

Description

Replaces the variables of a ratioOfQsprays fraction of polynomials with some qspray polynomials. E.g. you have a fraction of polynomials R(x, y) and you want the fraction of polynomials R(x^2, x+y+1).

Usage

## S4 method for signature 'ratioOfQsprays,list'
changeVariables(x, listOfQsprays)

Arguments

x

a ratioOfQsprays fraction of polynomials

listOfQsprays

a list containing at least n qspray objects, or objects coercible to qspray objects, where n is the number of variables of the ratioOfQsprays fraction of polynomials given in the x argument; if this list is named, then its names will be used in the show options of the result

Value

The ratioOfQsprays fraction of polynomials obtained by replacing the variables of the fraction of polynomials given in the x argument with the qspray polynomials given in the listOfQsprays argument.

Examples

library(ratioOfQsprays)
f <- function(x, y) {
  (x^2 + 5*y - 1) / (x + 1)
}
x <- qlone(1)
y <- qlone(2)
R <- f(x, y)
X <- x^2
Y <- x + y + 1
S <- changeVariables(R, list(X, Y))
S == f(X, Y) # should be TRUE

[Package ratioOfQsprays version 1.1.0 Index]