mvp (version 1.0-8)

kahle: A sparse multivariate polynomial

Description

A sparse multivariate polynomial inspired by Kahle (2013)

Usage

kahle(n = 26, r = 1, p = 1, coeffs = 1, symbols = letters)

Arguments

n

Number of different symbols to use

r

Number of symbols in a single term

p

Power of each symbol in each terms

coeffs

Coefficients of the terms

symbols

Alphabet of symbols

References

David Kahle 2013. “mpoly: multivariate polynomials in R”. R Journal, volume 5/1.

See Also

special

Examples

Run this code
# NOT RUN {
kahle()  # a+b+...+z
kahle(r=2,p=1:2)  # Kahle's original example

## example where mvp runs faster than spray (mvp does not need a 200x200 matrix):
k <- kahle(200,r=3,p=1:3,symbols=paste("x",sprintf("%02d",1:200),sep=""))
system.time(ignore <- k^2)
#system.time(ignore <- mvp_to_spray(k)^2)   # needs spray package loaded
# }

Run the code above in your browser using DataLab