gmpoly {gmpoly}R Documentation

Define a multivariate polynomial

Description

Define a multivariate polynomial from a string or from its coefficients and powers.

Usage

gmpoly(string, coeffs = NULL, powers = NULL)

Arguments

string

a string such as "x^(1,2,1) + 4 x^(0,2,3)", or you can define the polynomial with coeffs and powers; in this case set string to NULL or to nothing (i.e. missing)

coeffs

the coefficients of the polynomial, in case you don't define it with the string argument; this must be a vector of bigq numbers

powers

the powers of the polynomial, in case you don't define it with the string argument; this must be a matrix of integers, one row for each term (hence nrow(powers) must equal length(coeffs)), and the number of columns is the number of variables

Value

A gmpoly object.

Examples

library(gmpoly)
gmpoly("5/2 x^(2,3) + 3 x^(1,1)")
gmpoly("5/2 x^(2,3) - 3 x^(1,1)")
gmpoly("-x^(1,2,3) + 4/7 x^(3,1,1)")
library(gmp)
gmpoly(
  coeffs = as.bigq(c(5, 7), c(8, 9)), 
  powers = rbind(c(1, 1, 1), c(2, 2, 2))
)

[Package gmpoly version 1.1.0 Index]