DETMON Pipeline Reference Manual
1.2.7
|
Functions | |
cpl_error_code | irplib_polynomial_solve_1d_all (const cpl_polynomial *self, cpl_vector *roots, cpl_size *preal) |
Compute all n roots of p(x) = 0, where p(x) is of degree n, n > 0. |
cpl_error_code irplib_polynomial_solve_1d_all | ( | const cpl_polynomial * | self, |
cpl_vector * | roots, | ||
cpl_size * | preal | ||
) |
Compute all n roots of p(x) = 0, where p(x) is of degree n, n > 0.
self | The 1D-polynomial |
roots | A pre-allocated vector of length n to hold the roots |
preal | The number of real roots found, or undefined on error |
The *preal real roots are stored first in ascending order, then follows for each pair of complex conjugate roots, the real and imaginary parts of the root in the positive imaginary half-plane, for example for a 3rd degree polynomial with 1 real root, the roots are represented as: x0 = v0 x1 = v1 + i v2 x2 = v1 - i v2, where v0, v1, v2 are the elements of the roots vector.
Possible CPL error code set in this function:
Definition at line 142 of file irplib_polynomial.c.