#include <poly.h>
This follows the original Fortran code except in the function rrteq3(), the roots are returned in x[0], x[1], and x[2] instead of x[1], x[2], and x[3]. (The arrays y and z were already zero-indexed in the CERN routine.) Similar to the original, in the case of complex roots, x[0] is the real root and x[1] and x[2] contain the real and imaginary parts of the complex roots.
Another small change is that the discriminant for the resolvent cubic is evaluated slightly differently in order to improve the properties in the case where the roots are not of order unity. The default CERNLIB behavior can be restored by setting improve_scale to false
.
Definition at line 403 of file poly.h.
Public Member Functions | |
virtual int | solve_rc (const double a3, const double b3, const double c3, const double d3, double &x1, std::complex< double > &x2, std::complex< double > &x3) |
Solves the polynomial ![]() ![]() ![]() ![]() ![]() | |
virtual int | rrteq3 (double r, double s, double t, double x[], double &d) |
The original CERNLIB interface. | |
const char * | type () |
Return a string denoting the type ("cern_cubic_real_coeff"). | |
Data Fields | |
double | eps |
Numerical tolerance (default ![]() | |
double | delta |
Numerical tolerance (default ![]() | |
bool | improve_scale |
Improve algorithm for bad-scaled roots (default true). |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page