#include <polynomsolver.h>
Each function uses the followig format: a*x^(n) + b*x^(n-1) + ... = 0 Return value is the number of real solutions. All results are stored in x. This array must have at least n elements. If the imaginary part of a complex number is between -epsilon and epsilon the number is treated as a real number.
Public Member Functions | |
PolynomSolver () | |
Int32 | SolveLinear (T a, T b, T *x) |
Int32 | Solve2 (T a, T b, T c, T *x, T epsilon=1e-5) |
Int32 | Solve2 (T a, T b, T c, Complex< T > *x) |
Int32 | Solve3 (T a, T b, T c, T d, T *x, T epsilon=1e-5) |
Int32 | Solve3 (T a, T b, T c, T d, Complex< T > *x) |
Int32 | Solve4 (T a, T b, T c, T d, T e, T *x, T epsilon=1e-5) |
Int32 | Solve4 (T a, T b, T c, T d, T e, Complex< T > *x) |
Int32 | SolveN (Int32 n, Complex< T > *coeff, Complex< T > *x, Bool polish=true, Int32 maxiter=80) |
Static Public Member Functions | |
static T | GetComplexAbs (const Complex< T > &c) |
static Bool | ComplexIsReal (const Complex< T > &c, T eps=1e-4) |
Private Member Functions | |
T | Sqr (T d) |
T | Cub (T d) |
T | Sqrt3 (T x) |
void | Laguer (Complex64 a[], Int32 m, Complex64 &x, Int32 &its) |
Private Attributes | |
Complex< T > | rho1 |
Complex< T > | rho2 |
Int32 SolveLinear | ( | T | a, |
T | b, | ||
T * | x | ||
) |
Int32 SolveN | ( | Int32 | n, |
Complex< T > * | coeff, | ||
Complex< T > * | x, | ||
Bool | polish = true , |
||
Int32 | maxiter = 80 |
||
) |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |