convert.multipol: Convert Between multipol and List Representations of...

convert.multipolR Documentation

Convert Between multipol and List Representations of Multivariate Polynomials

Description

Converts a multipol object to a simple list representation, or converts a simple list representation back to a multipol object.

Usage

convert.multipol(poly)

Arguments

poly

A multipol object, or a list containing powers and coefficients that define a multivariate polynomial.

Details

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.

Value

If poly is of class 'multipol', returns a list with two components (powers and coeff). If poly is a list of this form, returns the corresponding multipol object.

Author(s)

Kem Phillips kemphillips@comcast.net

References

\insertRef

Phillips2010symmoments

See Also

convert.mpoly, evaluate_expected.polynomial, integrate.polynomial

Examples

## Not run: 
library(mpoly)
library(multipol)

# Create an mpoly object to work with
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 to a multipol object
t2 <- convert.multipol(t1) 

# Convert back to a list representation
t3 <- convert.multipol(t2) 

## End(Not run)


symmoments documentation built on May 27, 2026, 9:06 a.m.