multipol-package | R Documentation |
Various tools to manipulate and combine multivariate polynomials
Multidimensional arrays are interpreted in a natural way as multivariate polynomials.
Taking a matrix a
as an example, because this has two dimensions
it may be viewed as a bivariate polynomial with a[i,j]
being the
coefficient of x^iy^j
. Note the off-by-one issue; see
?Extract
.
Multivariate polynomials of arbitrary arity are a straightforward generalization using appropriately dimensioned arrays.
Arithmetic operations “+
”,“-
”,
“*
”, “^
” operate as though their arguments
are multivariate polynomials.
Even quite small multipols are computationally intense; many coefficients have to be calculated and each is the sum of many terms.
The package is almost completely superceded by the spray and mvp packages, which use a sparse array system for efficiency.
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>)
Maintainer: Robin K. S. Hankin <hankin.robin@gmail.com>
ones(2)*linear(c(1,-1)) # x^2-y^2
ones(2)*(ones(2,2)-uni(2)) # x^3+y^3
a <- as.multipol(matrix(1:12,3,4))
a
a[1,1] <- 11
f <- as.function(a*a)
f(c(1,pi))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.