PolynomSolver< T > Class Template Reference

#include <polynomsolver.h>

Detailed Description

template<typename T>
class maxon::PolynomSolver< T >

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

Sqr (T d)
 
Cub (T d)
 
Sqrt3 (T x)
 
void Laguer (Complex64 a[], Int32 m, Complex64 &x, Int32 &its)
 

Private Attributes

Complex< T > rho1
 
Complex< T > rho2
 

Constructor & Destructor Documentation

◆ PolynomSolver()

Member Function Documentation

◆ SolveLinear()

Int32 SolveLinear ( a,
b,
T *  x 
)

◆ Solve2() [1/2]

Int32 Solve2 ( a,
b,
c,
T *  x,
epsilon = 1e-5 
)

◆ Solve2() [2/2]

Int32 Solve2 ( a,
b,
c,
Complex< T > *  x 
)

◆ Solve3() [1/2]

Int32 Solve3 ( a,
b,
c,
d,
T *  x,
epsilon = 1e-5 
)

◆ Solve3() [2/2]

Int32 Solve3 ( a,
b,
c,
d,
Complex< T > *  x 
)

◆ Solve4() [1/2]

Int32 Solve4 ( a,
b,
c,
d,
e,
T *  x,
epsilon = 1e-5 
)

◆ Solve4() [2/2]

Int32 Solve4 ( a,
b,
c,
d,
e,
Complex< T > *  x 
)

◆ SolveN()

Int32 SolveN ( Int32  n,
Complex< T > *  coeff,
Complex< T > *  x,
Bool  polish = true,
Int32  maxiter = 80 
)

◆ GetComplexAbs()

T GetComplexAbs ( const Complex< T > &  c)
static

◆ ComplexIsReal()

Bool ComplexIsReal ( const Complex< T > &  c,
eps = 1e-4 
)
static

◆ Sqr()

T Sqr ( d)
private

◆ Cub()

T Cub ( d)
private

◆ Sqrt3()

T Sqrt3 ( x)
private

◆ Laguer()

void Laguer ( Complex64  a[],
Int32  m,
Complex64 x,
Int32 its 
)
private

Member Data Documentation

◆ rho1

Complex<T> rho1
private

◆ rho2

Complex<T> rho2
private