NMath Reference Guide

## Bairstow |

Class implementing Bairstows method finds roots for polynomials of degree
greater than 3.

Inheritance Hierarchy

Syntax

The BairstowRootFinder type exposes the following members.

Constructors

Name | Description | |
---|---|---|

BairstowRootFinder | Constructs an instance with the specified tolerance an maximum iteration values. |

Methods

Name | Description | |
---|---|---|

FindAllRoots(Double, Int32, Double) | Finds all the roots of polynomial by repeated application of Biarstow's method. | |

FindAllRoots(DoubleVector, Int32, Double) | Finds all the roots of polynomial by repeated application of Biarstow's method. | |

FindAllRoots(Polynomial, Int32, Double) | Finds all the roots of polynomial by repeated application of Biarstow's method. | |

FindUniqueRoots(IListBairstowRootFinderSolveResult, Double) | Extracts the unique roots from the list of all roots resulting from Applying Bairstow's method to find all roots of a polynomial. Equality is determined by the "relative error" between the two values, x and y, being compared according to the formula: E = ||x - y||, if max(||x||, ||y||) is less than 1 ||x - y|| / max(||x||, ||y||), otherwise | |

FindUniqueRoots(Double, Int32, Double) | Finds the unique roots of a polynomial P(x) = a[0] + a[1]*x + a[2]*x^2 + ... + a[n]*x^n using repeated application of Bairstow's method. | |

FindUniqueRoots(DoubleVector, Int32, Double) | Finds the unique roots of a polynomial P(x) = a[0] + a[1]*x + a[2]*x^2 + ... + a[n]*x^n using repeated application of Bairstow's method. | |

FindUniqueRoots(Polynomial, Int32, Double) | Finds the unique roots of a polynomial using repeated application of Bairstow's method. | |

Solve(Double) |
Solves the polynomial
P(x) = a[0] + a[1]*x + a[2]*x^2 + ... + a[n]*x^n
Note that the constant term is at index 0 and the leading coefficient
is at index C# `a.Length - 1` | |

Solve(DoubleVector) |
Solves the polynomial
P(x) = a[0] + a[1]*x + a[2]*x^2 + ... + a[n]*x^n
Note that the constant term is at index 0 and the leading coefficient
is at index C# `a.Length - 1` | |

Solve(Polynomial) | Solves the give polynomial. |

Fields

Name | Description | |
---|---|---|

MaxIterations | The maximum number of iterations performed. | |

Small |
Number for determining if a value is approximately zero.
The algorithm will consider a number x to be zero if
the absolute value of x is less than C# Small | |

Tolerance | Iteration terminates with a converged status if the step length falls below this value. In moving from iterative step n to n + 1, the step length is defined as StepLength = sqrt((u(n) - u(n+1))^2 + (v(n) - v(n+1))^2) where un and vn are the coefficients in the quadratic x^2 + u(n)*x + v(n) at the nth step. |

Remarks

Given a polynomial
P(x) = a0 + a1*x + a2*x^2 + ... + an*x^n
Bairstows method iteratively adjusts coefficients u and v so that the quadratic
x^2 + u*x + v
has the same roots as P(x). These roots are then found using the quadratic
formula.

See Also