ginger/aberth.hpp file

Functions

auto initial_aberth(const std::vector<double>& coeffs) -> std::vector< std::complex< double >> -> auto
Initial guess for the Aberth-Ehrlich method.
auto aberth(const std::vector<double>& coeffs, std::vector<std::complex<double>>& zs, const Options& options) -> std::pair< unsigned int, bool > -> auto
Single-threading Aberth-Ehrlich method.
auto aberth_mt(const std::vector<double>& coeffs, std::vector<std::complex<double>>& zs, const Options& options) -> std::pair< unsigned int, bool > -> auto
Multi-threading Aberth-Ehrlich method.

Function documentation

auto initial_aberth(const std::vector<double>& coeffs) -> std::vector< std::complex< double >>

Initial guess for the Aberth-Ehrlich method.

Parameters
coeffs in The coeffs parameter is a vector of doubles that represents the coefficients of a polynomial.
Returns The function initial_aberth returns a vector of Complex numbers.

The initial_aberth function calculates the initial values for the Aberth-Ehrlich method for finding the roots of a polynomial.

auto aberth(const std::vector<double>& coeffs, std::vector<std::complex<double>>& zs, const Options& options) -> std::pair< unsigned int, bool >

Single-threading Aberth-Ehrlich method.

Parameters
coeffs in The coeffs parameter is a vector representing the coefficients of a polynomial. Each element of the vector corresponds to a term in the polynomial, starting from the highest degree term and ending with the constant term. For example, if the polynomial is `3x^2 + 2x +
zs in zs is a vector of complex numbers representing the initial guesses for the roots of the polynomial. The function will update these values iteratively to converge to the actual roots.
options in The options parameter is an object of type Options that contains the maximum number of iterations (max_iters) and the tolerance (tolerance). These options control the convergence criteria for the Aberth-Ehrlich method.
Returns The aberth function returns a std::pair<unsigned int, bool>. The first element of the pair represents the number of iterations performed, and the second element represents whether the method converged to a solution within the specified tolerance.

The aberth function is a multi-threaded implementation of the Aberth-Ehrlich method for finding the roots of a polynomial.

Aberth's method is a method for finding the roots of a polynomial that is robust but requires complex arithmetic even if the polynomial is real. This is because it starts with complex initial approximations.

auto aberth_mt(const std::vector<double>& coeffs, std::vector<std::complex<double>>& zs, const Options& options) -> std::pair< unsigned int, bool >

Multi-threading Aberth-Ehrlich method.

Parameters
coeffs in The coeffs parameter is a vector representing the coefficients of a polynomial. Each element of the vector corresponds to a term in the polynomial, starting from the highest degree term and ending with the constant term. For example, if the polynomial is `3x^2 + 2x +
zs in zs is a vector of complex numbers representing the initial guesses for the roots of the polynomial. The function will update these values iteratively to converge to the actual roots.
options in The options parameter is an object of type Options that contains the maximum number of iterations (max_iters) and the tolerance (tolerance). These options control the convergence criteria for the Aberth-Ehrlich method.
Returns The aberth function returns a std::pair<unsigned int, bool>. The first element of the pair represents the number of iterations performed, and the second element represents whether the method converged to a solution within the specified tolerance.

The aberth function is a multi-threaded implementation of the Aberth-Ehrlich method for finding the roots of a polynomial.

Aberth's method is a method for finding the roots of a polynomial that is robust but requires complex arithmetic even if the polynomial is real. This is because it starts with complex initial approximations.