substituteVariables {symbolicQspray}R Documentation

Assign values to the variables of a 'symbolicQspray'

Description

Substitutes some values to the variables of a symbolicQspray polynomial.

Usage

substituteVariables(Qspray, values)

Arguments

Qspray

a symbolicQspray object

values

vector of values to be substituted to the variables; these values must be coercible to bigq numbers

Value

A ratioOfQsprays object.

See Also

Use changeVariables to apply a transformation of the variables. Use substituteParameters to substitute some values to the parameters.

Examples

library(symbolicQspray)
f <- function(a1, a2, X, Y) {
  (a1 + 2)*X^2*Y + (a2/(a1^2+a2))*X*Y
}
a1 <- qlone(1); a2 <- qlone(2)
Qspray <- f(a1, a2, Qlone(1), Qlone(2))
values <- c(3, "2/3")
( rOQ <- substituteVariables(Qspray, values) )
values <- gmp::as.bigq(values)
rOQ == f(a1, a2, values[1], values[2]) ## should be TRUE

[Package symbolicQspray version 1.1.0 Index]