Class cubic_real_coeff (o2scl)

O2scl : Class List

template<class fp_t = double, class cx_t = std::complex<fp_t>>
class cubic_real_coeff : public o2scl::cubic_real<double>

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

Subclassed by o2scl::cubic_complex< double, std::complex< double > >, o2scl::cubic_real_coeff_cern< double, std::complex< double > >, o2scl::cubic_real_coeff_cern< long double, std::complex< long double > >, o2scl::cubic_real_coeff_cern< cpp_dec_float_25, std::complex< cpp_dec_float_25 > >, o2scl::cubic_real_coeff_cern< cpp_dec_float_35, std::complex< cpp_dec_float_35 > >, o2scl::cubic_real_coeff_cern< cpp_dec_float_50, std::complex< cpp_dec_float_50 > >, o2scl::cubic_real_coeff_cern< cpp_dec_float_100, std::complex< cpp_dec_float_100 > >, o2scl::cubic_real_coeff_gsl2< double >, o2scl::cubic_real_coeff_gsl2< cpp_dec_float_25 >, o2scl::cubic_real_coeff_gsl2< long double >, o2scl::cubic_real_coeff_gsl2< double, std::complex< double > >, o2scl::poly_real_coeff< double, std::complex< double > >, o2scl::cubic_complex< fp_t, cx_t >, o2scl::cubic_real_coeff_cern< fp_t, cx_t >, o2scl::cubic_real_coeff_gsl2< fp_t, cx_t >, o2scl::poly_real_coeff< fp_t, cx_t, coeff_vec_t, root_vec_t >

Public Functions

inline virtual ~cubic_real_coeff()
inline virtual int solve_r(const fp_t a3, const fp_t b3, const fp_t c3, const fp_t d3, fp_t &x1, fp_t &x2, fp_t &x3)

Solves the polynomial \( a_3 x^3 + b_3 x^2 + c_3 x + d_3= 0 \) giving the three solutions \( x=x_1 \) , \( x=x_2 \) , and \( x=x_3 \) .

virtual int solve_rc(const fp_t a3, const fp_t b3, const fp_t c3, const fp_t d3, fp_t &x1, cx_t &x2, cx_t &x3) = 0

Solves the polynomial \( a_3 x^3 + b_3 x^2 + c_3 x + d_3= 0 \) giving the real solution \( x=x_1 \) and two complex solutions \( x=x_2 \) and \( x=x_3 \) .

inline size_t test_cubic_real_coeffs(fp_t alpha, fp_t &s1, fp_t &s2, fp_t &m1, fp_t &m2, size_t &wrong_ret, size_t n = 16)

Test \( n^4 \) cubics with real coefficients.

inline const char *type()

Return a string denoting the type (“cubic_real_coeff”)