Home | Trees | Indices | Help |
|
---|
|
object --+ | list --+ | Polynomial
Polynomial type
This class implements the Polynomial type, based on the Python lists. The Polynomial object is a list of coeficients. For example:
>>> a = Polynomial([1, 2, 3]) >>> print a x^2 + 2x + 3
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
var =
|
|||
Inherited from |
|
|||
Inherited from |
|
String representation This method returns the string representation of polynomials. For example: x^2 + 2x + 3
|
Operation of addition This method returns a Polynomial object with the result of the addition of the Polynomial 'self' and the Polynomial 'term'. For example: >>> a = Polynomial([1, 2, 3]) >>> b = Polynomial([2, 3, 4]) >>> c = a + b >>> print c 3x^2 + 5x + 7 >>> type(c) <class 'controlsystems.types.Polynomial'>
|
Operation of subtraction This method returns a Polynomial object with the result of the subtraction of the Polynomial 'self' and the Polynomial 'term'. For example: >>> a = Polynomial([2, 3, 4]) >>> b = Polynomial([1, 2, 3]) >>> c = a - b >>> print c x^2 + x + 1 >>> type(c) <class 'controlsystems.types.Polynomial'> This method is based on __add__ method |
Operation of multiplication of polynomials This method returns a Polynomial object with the result of the multiplication of the Polynomial 'self' and the Polynomial 'term'. For example: >>> a = Polynomial([1, 2, 3]) >>> b = Polynomial([2, 3, 4]) >>> c = a * b >>> print c 2x^4 + 7x^3 + 16x^2 + 17x + 12 >>> type(c) <class 'controlsystems.types.Polynomial'>
|
Operation of division of polynomials This method returns a Polynomial object with the result of the multiplication of the Polynomial 'self' and the Polynomial 'term'. Not implemented yet. |
Operation of multiplication between numbers and polynomials This method returns a Polynomial object with the result of the multiplication of the Polynomial 'self' and the number 'val'. For example: >>> a = Polynomial([1, 2, 3]) >>> b = a.mult(5) >>> print b 5x^2 + 10x + 15 >>> type(b) <class 'controlsystems.types.Polynomial'> |
Auxiliary method This method returns a Polynomial object initialized with zeros. For example: >>> a = Polynomial() >>> a.Zero(4) [0, 0, 0, 0] |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Nov 19 01:50:56 2009 | http://epydoc.sourceforge.net |