Class cubic_real_coeff (o2scl)¶
-
template<class fp_t = double, class cx_t = std::complex<fp_t>>
class o2scl::cubic_real_coeff : public o2scl::cubic_real<double>¶ Solve a cubic polynomial with real coefficients and complex roots [abstract base].
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_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”)
-
inline virtual ~cubic_real_coeff()¶