Class cubic_complex (o2scl)

O2scl : Class List

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

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

Subclassed by o2scl::cubic_complex_std< double, std::complex< double > >, o2scl::cubic_complex_std< fp_t, cx_t >, o2scl::poly_complex< fp_t, cx_t, coeff_vec_t, root_vec_t >

Public Functions

inline virtual ~cubic_complex()
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 a3x3+b3x2+c3x+d3=0 giving the three solutions x=x1 , x=x2 , and x=x3 .

inline 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)

Solves the polynomial a3x3+b3x2+c3x+d3=0 giving the real solution x=x1 and two complex solutions x=x2 and x=x3 .

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

Solves the complex polynomial a3x3+b3x2+c3x+d3=0 giving the three complex solutions x=x1 , x=x2 , and x=x3 .

inline size_t test_complex_coeffs(fp_t &s1, fp_t &s2, fp_t &m1, fp_t &m2, size_t n = 9)

Test 2n4 cubics with complex coefficients.

inline const char *type()

Return a string denoting the type (“cubic_complex”)