This module defines the class Polynomial, representing a polynomial in n variables.
Classes defined in module polynomial
A polynomial in ndim dimensions.
Parameters:
Example:
>>> p = Polynomial([(0,0),(1,0),(1,1),(0,2)],(2,3,-1,-1))
>>> print(p.atoms())
['1', 'x', 'x*y', 'y**2']
>>> print(p.human())
2.0 + 3.0*x -1.0*x*y -1.0*y**2
>>> print(p.evalAtoms([[1,2],[3,0],[2,1]]))
[[ 1. 1. 2. 4.]
[ 1. 3. 0. 0.]
[ 1. 2. 2. 1.]]
>>> print(p.eval([[1,2],[3,0],[2,1]]))
[ -1. 11. 5.]
Return the degree of the polynomial in each of the dimensions.
The degree is the maximal exponent for each of the dimensions.
Return the total degree of the polynomial.
The degree is the sum of the degrees for all dimensions.
Evaluate the monomials at the given points
x is an (npoints,ndim) array of points where the polynomial is to be evaluated. The result is an (npoints,nterms) array of values.
Evaluate the monomials at the given points
x is an (npoints,ndim) array of points where the polynomial is to be evaluated. The result is an (npoints,nterms) array of values.
Evaluate the polynomial at the given points
x is an (npoints,ndim) array of points where the polynomial is to be evaluated. The result is an (npoints,) array of values.
Return a human representation of the monomials
Return a human representation
Functions defined in module polynomial
Build a matrix of functions of coords.
Returns a matrix with nvalues rows and natoms colums.
Compute the monomials for the given exponents
Returns a string representation of a monomial created by raising the symbols to the corresponding exponent.
Example:
>>> monomial((2,1))
'x**2*y'