changeVariables function

Change of variables in a 'qspray' polynomial

Change of variables in a 'qspray' polynomial

Replaces the variables of a qspray polynomial with some qspray polynomials. E.g. you have a polynomial P(x,y)P(x, y)

and you want the polynomial P(x2,x+y+1)P(x^2, x+y+1). This is an alias of composeQspray. methods

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

Arguments

  • x: a qspray polynomial

  • listOfQsprays: a list containing at least n qspray

    objects, or objects coercible to qspray objects, where n

    is the number of variables of the polynomial given in the x

    argument; if this list is named, then its names will be used in the show options of the result

Returns

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

Examples

library(qspray) f <- function(x, y) x*y/2 + 4*y x <- qlone(1) y <- qlone(2) P <- f(x, y) X <- x^2 Y <- x + y + 1 changeVariables(P, list(X, Y)) == f(X, Y) # should be TRUE
  • Maintainer: Stéphane Laurent
  • License: GPL-3
  • Last published: 2024-07-27