Class quadratic_real_coeff (o2scl)

O2scl : Class List

template<class fp_t = double, class cx_t = std::complex<fp_t>>
class quadratic_real_coeff : public o2scl::quadratic_real<double>

Solve a quadratic polynomial with real coefficients and complex roots [abstract base].

This class is designed to be identical to the GSL code in gsl_poly_complex_solve_quadratic(), but generalized to generic floating point types.

Subclassed by o2scl::poly_real_coeff< double, std::complex< double > >, o2scl::quadratic_complex< double, std::complex< double > >, o2scl::quadratic_real_coeff_gsl2< double, std::complex< double > >, o2scl::poly_real_coeff< fp_t, cx_t, coeff_vec_t, root_vec_t >, o2scl::quadratic_complex< fp_t, cx_t >, o2scl::quadratic_real_coeff_gsl, o2scl::quadratic_real_coeff_gsl2< fp_t, cx_t >

Public Functions

inline virtual ~quadratic_real_coeff()
inline virtual int solve_r(const fp_t a2, const fp_t b2, const fp_t c2, fp_t &x1, fp_t &x2)

Solves the polynomial \( a_2 x^2 + b_2 x + c_2 = 0 \) giving the two solutions \( x=x_1 \) and \( x=x_2 \) .

virtual int solve_rc(const fp_t a2, const fp_t b2, const fp_t c2, cx_t &x1, cx_t &x2) = 0

Solves the polynomial \( a_2 x^2 + b_2 x + c_2 = 0 \) giving the two complex solutions \( x=x_1 \) and \( x=x_2 \).

inline size_t test_coeffs_zero_disc(fp_t alpha, fp_t &s1, fp_t &s2, fp_t &m1, fp_t &m2, size_t n = 40)

Test \( n^3 \) quadratics with coefficients near a zero discriminant.

inline size_t test_complex_roots(fp_t &s1, fp_t &s2, fp_t &m1, fp_t &m2, size_t n = 80)

Test \( n^2 \) quadratics with complex roots.

inline size_t test_real_roots(fp_t &s1, fp_t &s2, fp_t &m1, fp_t &m2, size_t &wrong_ret, size_t n = 80)

Test \( n^2 \) quadratics with real roots.

inline const char *type()

Return a string denoting the type (“quadratic_real_coeff”)