Quartic roots
Utilities for C++ programming
Loading...
Searching...
No Matches
PolynomialRoots Namespace Reference

Classes

class  Cubic
 
class  Quadratic
 
class  Quartic
 

Typedefs

using real_type = double
 real type numbers
 
using integer = int
 integer type numbers
 
using complex_type = std::complex<real_type>
 complex type numbers
 
using ostream_type = std::basic_ostream<char>
 outoput stream type
 
using istream_type = std::basic_istream<char>
 input stream type
 

Functions

int roots (real_type const *op, integer Degree, real_type *zeror, real_type *zeroi)
 

Detailed Description

Namespace containing all the functions and classes for the computation of polynomial roots

Implementation of Flocke algorithm for roots of 3rd and 4th degree polynomials.

There are 3 classed for 2nd, 3rd and 4th degree polynomial. An experimental translation to C++ of a C implementation of Jenkins–Traub algorithm is available.

References

  • N.Flocke Algorithm 954: An Accurate and Efficient Cubic and Quartic Equation Solver for Physical Applications ACM TOMS, vol 41, n.4, 2015
  • M.A. Jenkins and J.F.Traub A Three-Stage Algorithm for Real Polynomials Using Quadratic Iteration SIAM Journal on Numerical Analysis Vol. 7, No.4 (Dec., 1970), pp.545-566

Typedef Documentation

◆ complex_type

typedef std::complex< real_type > PolynomialRoots::complex_type = std::complex<real_type>

complex type numbers

◆ integer

integer type numbers

◆ istream_type

typedef std::basic_istream< char > PolynomialRoots::istream_type = std::basic_istream<char>

input stream type

◆ ostream_type

typedef std::basic_ostream< char > PolynomialRoots::ostream_type = std::basic_ostream<char>

outoput stream type

◆ real_type

real type numbers

Function Documentation

◆ roots()

int PolynomialRoots::roots ( real_type const * op,
integer Degree,
real_type * zeror,
real_type * zeroi )

Find roots of a generic polynomial using Jenkins-Traub method

Parameters
[in]opthe coefficients of the polynomial
[in]Degreedegree of the polynomial
[out]zerorreal part of the roots
[out]zeroiimaginary part of the roots
Returns
error code, 0 OK