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

Parallel Bairstow root-finding methods for real polynomials (MT) More...

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

Go to the source code of this file.

Functions

auto pbairstow_even_mt (const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const ginger::Options &options) -> std::pair< unsigned int, bool >
 Multi-threading Bairstow's method (even degree only)
 

Detailed Description

Parallel Bairstow root-finding methods for real polynomials (MT)

Function Documentation

◆ pbairstow_even_mt()

auto pbairstow_even_mt ( const std::vector< double > &  coeffs,
std::vector< Vec2 > &  vrs,
const ginger::Options options 
) -> std::pair< unsigned int, bool >
extern

Multi-threading Bairstow's method (even degree only)

The pbairstow_even_mt function implements Bairstow's method for finding the roots of a real polynomial with an even degree using multi-threading.

Each thread handles one quadratic factor \( x^2 - r_i x - q_i \), applying:

\[ \begin{bmatrix} \Delta r_i \\ \Delta q_i \end{bmatrix} = -J_i^{-1} \begin{bmatrix} P_i \\ Q_i \end{bmatrix} \]

where \( P_i, Q_i \) are the remainders from synthetic division.

Parameters
[in]coeffsThe coeffs parameter is a vector representing the coefficients of the polynomial. Each element of the vector corresponds to the coefficient of 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]vrsvrs is a vector of iterates, which represents the initial guesses for the roots of the polynomial. Bairstow's method will update these iterates iteratively until the desired tolerance is reached or the maximum number of iterations is reached.
[in]optionsThe options parameter is an object of type Options which contains the maximum number of iterations (max_iters) and the tolerance (tolerance). These options are used to control the convergence criteria for Bairstow's method.
Returns
The function pbairstow_even_mt 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.