ESyS-Particle
4.0.1
|
A class for a cubic equation. Used for eigenvalue calculation on 3D matrices. More...
#include <cube_eq.h>
Public Member Functions | |
CubicEquation (double, double, double) | |
set< double > | getRealRoots (double) |
A class for a cubic equation. Used for eigenvalue calculation on 3D matrices.
CubicEquation::CubicEquation | ( | double | a, |
double | b, | ||
double | c | ||
) |
construct cubic equation of the form x^3+ax^2+bx+c
a | coefficient for x^2 |
b | coefficient for x |
c | constant coefficient |
set< double > CubicEquation::getRealRoots | ( | double | tol | ) |
Get the roots. Get one root (r_1) by a bisection method and the other 2 (if real) by solving the quadratic equation resulting from dividing the eqation by (x-r_1). Returns the roots as a STL-set so they are ordered.
tol | the precision of the calculation |
valid | returns the validity of the result, i.e. if valid==false there was no positive root found |
Referenced by Matrix3::eigen().