as.function.qspray {qspray}R Documentation

Multivariate polynomial as function

Description

Coerces a qspray polynomial into a function.

Usage

## S3 method for class 'qspray'
as.function(x, ...)

Arguments

x

object of class qspray

...

ignored

Value

A function having the same variables as the polynomial. It returns a string.

Examples

library(qspray)
P <- (qlone(1) + "1/2"*qlone(2))^2 + 5
f <- as.function(P)
f(2, "3/7")
f("x", "y")
# the evaluation is performed by (R)yacas and complex numbers are
# allowed; the imaginary unit is denoted by `I`
f("2 + 2*I", "1/4")

[Package qspray version 0.1.1 Index]