| convert.mpoly | R Documentation |
Converts an mpoly object to a simple list representation, or converts
a simple list representation back to an mpoly object.
convert.mpoly(poly)
poly |
An |
The list representation consists of 2 components:
powers: A matrix where each row represents the exponents/powers
of X for a single term in the multivariate polynomial.
coeff: A numeric vector where each element is the coefficient
for the corresponding row/term in powers.
If poly is of class 'mpoly', returns a list with two
components (powers and coeff). If poly is a list of this
form, returns the corresponding mpoly object.
Kem Phillips kemphillips@comcast.net
Phillips2010symmoments
convert.multipol,
evaluate_expected.polynomial,
integrate.polynomial
## Not run:
library(mpoly)
# Create an mpoly object
t0 <- mpoly::mpoly(list(
c(coef = 3, x1 = 2),
c(coef = 2, x1 = 1, x2 = 3),
c(coef = -4, z = 2),
c(coef = 1, x1 = 1, x2 = 2, z = 1)
))
# Convert from mpoly to list representation
t1 <- convert.mpoly(t0)
# Convert from list representation back to an mpoly object
t2 <- convert.mpoly(t1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.