5. pygsl.poly
Polynomials
Wrapper over the functions as described in Chaper 6 of the
GNU Scientific Libraryreference manual.
There are routines for finding real and complex roots of quadratic and cubic
equations using analytic methods. An iterative polynomial solver is also
available for finding the roots of general polynomials with real coefficients
(of any order).
-
evaluate the equation
using Horner's method for stability at x. ``len'' is the number of coefficients
(equal to the length of the python object)
-
This class computes a divided-difference representation of the
interpolating polynomial for the points (xa, ya).
-
Get the devided-difference representation
-
evaluate the representation at x
-
convert the internal representation to a Taylor expansion
-
computes the real roots of the equation
all variables are real varibales using a ``C double type'' for internal representation.
returns the number of roots and their value.
complex_solve_quadratic( |
a,b,c) |
-
computes the complex roots of the equation
.
all variables are complex varibales.
Returns the number of roots and their value.
-
computes the real roots of the equation
.
All variables are real varibales using a ``C double type'' for internal representation.
Returns the number of roots and their value.
complex_solve_cubic( |
a,b,c) |
-
computes the complex roots of the equation
.
all variables are complex variables.
returns the number of roots and their value.
-
intialise the class giving the dimension of the problem
-
This method computes the roots of the general polynomial
using balanced-QR reduction
of the companion matrix. The parameter n specifies the length of the
coefficient array. The coefficient of the highest order term must be
non-zero. The n-1 roots are returned in a complex array.
The method raises GSL_EFAILED if the QR reduction does not converge.
Release 0.9, documentation updated on October, 2008.