Class quadratic_real_coeff_gsl2 (o2scl)¶
-
template<class fp_t = double, class cx_t = std::complex<double>>
class quadratic_real_coeff_gsl2 : public o2scl::quadratic_real_coeff<double, std::complex<double>>¶ Solve a quadratic with real coefficients and complex roots (C++ rewrite of GSL algorithm)
This code was based on GSL v2.6’s function gsl_poly_complex_solve_quadratic().
Public Functions
-
inline virtual ~quadratic_real_coeff_gsl2()¶
-
inline virtual int solve_rc(const fp_t a, const fp_t b, const fp_t c, cx_t &x1, cx_t &x2)¶
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 \).
This function returns the number of real roots (either 0 or 2)
-
inline const char *type()¶
Return a string denoting the type (“quadratic_real_coeff_gsl2”)
-
inline virtual ~quadratic_real_coeff_gsl2()¶