Ginger 1.1.9
Loading...
Searching...
No Matches
Functions
aberth_mt.hpp File Reference

Aberth-Ehrlich method for polynomial root-finding (MT) More...

#include "aberth.hpp"
Include dependency graph for aberth_mt.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

auto aberth_mt (const std::vector< double > &coeffs, std::vector< std::complex< double > > &zs, const ginger::Options &options) -> std::pair< unsigned int, bool >
 Multi-threading Aberth-Ehrlich method.
 
auto aberth_autocorr_mt (const std::vector< double > &coeffs, std::vector< std::complex< double > > &zs, const ginger::Options &options) -> std::pair< unsigned int, bool >
 Multi-threading Aberth-Ehrlich method (specifically for auto-correlation functions)
 

Detailed Description

Aberth-Ehrlich method for polynomial root-finding (MT)

Function Documentation

◆ aberth_autocorr_mt()

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

Multi-threading Aberth-Ehrlich method (specifically for auto-correlation functions)

The aberth_autocorr_mt function is a multi-threaded implementation of the Aberth-Ehrlich method for finding the roots of a palindromic (auto-correlation) 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.

Parameters
[in]coeffsThe 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 + 1, the coefficients vector would be {3, 2, 1}.
[in,out]zszs 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.
[in]optionsThe 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_autocorr_mt 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.

◆ aberth_mt()

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

Multi-threading Aberth-Ehrlich method.

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

Multi-threaded variant of the Aberth-Ehrlich method:

\[ x_k^{(i+1)} = x_k^{(i)} - \frac{P(x_k)}{P'(x_k)}\Bigg/ \left(1 - \frac{P(x_k)}{P'(x_k)}\sum_{j \ne k}\frac{1}{x_k - x_j}\right) \]

Each root is updated in parallel using separate threads.

Parameters
[in]coeffsThe 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 + 1, the coefficients vector would be {3, 2, 1}.
[in,out]zszs 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.
[in]optionsThe 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_mt 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.