Ops.gmpoly {gmpoly}R Documentation

Arithmetic operators for multivariate polynomials

Description

Arithmetic operators for multivariate polynomials

Usage

## S3 method for class 'gmpoly'
Ops(e1, e2 = NULL)

Arguments

e1, e2

for an unary operator, only e1 must be given, a gmpoly object; for a binary operator, at least one of e1 and e2 must be a gmpoly object, and the other must a gmpoly object as well or a scalar; the power operator (^) is an exception: one can only raise a gmpoly object to a positive integer power

Value

A gmpoly object.

Examples

library(gmpoly)
pol <- gmpoly("4 x^(2, 1, 1) + 1/2 x^(0,1,0)")
+pol
-pol
2 * pol
pol / 2
pol + 5
pol - 5
pol^2
pol1 <- gmpoly("2 x^(1,1) - 5/3 x^(0,1)")
pol2 <- gmpoly("-2 x^(1,1) + 3 x^(2,1)")
pol1 + pol2
pol1 * pol2
pol1 == pol2
pol1 != pol2

[Package gmpoly version 1.1.0 Index]