6.13.2.1 MPolynomial Objects

class MPolynomial
MPolynomial( parent, x)

Instances of class MPolynomial have the following methods (in addition to inherited methods and special methods):

element

Instances of class MPolynomial also have the following special methods:

__add__,$  $ __call__,$  $ __cmp__,$  $ __div__,$  $ __mul__,$  $ __neg__,$  $ __pow__,$  $ __repr__,$  $ __rpow__,$  $ __sub__

Further documentation:

__call__( )

Evaluate this multi-variate polynomial at $ x$ , where $ x$ is either the tuple of values to substitute in, or one can use functional notation $ f(a_0,a_1,a_2, \ldots)$ to evaluate $ f$ with the ith variable replaced by $ a_i$ .

sage: x, y = MPolynomialRing(RationalField(),2).gens()
sage: f = x**2 + y**2
sage: f(1,2)
5
sage: f((1,2))
5

sage: x = MPolynomialRing(RationalField(),3).gens()
sage: f = x[0] + x[1] - 2*x[1]*x[2]
sage: f
x_1 - 2*x_1*x_2 + x_0
sage: f(1,2,0)
3
sage: f(1,2,5)
-17

AUTHOR: David Kohel, 2005-09-27

See About this document... for information on suggesting changes.