45extern auto initial_guess(std::vector<double> coeffs) -> std::vector<Vec2>;
78inline auto pbairstow_even(
const std::vector<double>& coeffs, std::vector<Vec2>& vrs,
103extern auto horner(std::vector<double>& coeffs1, std::size_t degree,
const Vec2& vr) ->
Vec2;
171 return {
Vec2{s, -p},
Vec2{-p * vr.y(), p * vr.x() + s}};
189 const auto r = vr.x();
190 const auto q = vr.y();
191 const auto p = vp.x();
192 const auto s = vp.y();
195 const auto det = s * (p * r + s) - p * p * q;
198 const auto mx = s * vA.x() - p * vA.y();
199 const auto my = -p * q * vA.x() + (p * r + s) * vA.y();
200 return Vec2{mx / det, my / det};
220 return mp.mdot(vA) / mp.det();
241inline auto horner_eval(std::vector<double> coeffs1, std::size_t degree,
const double& z)
243 for (
auto idx = 0U; idx != degree; ++idx) {
244 coeffs1[idx + 1] += coeffs1[idx] * z;
246 return coeffs1[degree];
ginger::Matrix2< Vec2 > Mat2
Definition bairstow.hpp:16
ginger::Vector2< double > Vec2
Definition bairstow.hpp:15
Matrix2.
Definition matrix2.hpp:28
Vector2.
Definition vector2.hpp:19
2x2 matrix template for polynomial root-finding
Options for convergence-based algorithms.
Definition aberth.hpp:13
auto initial_guess(std::vector< double > coeffs) -> std::vector< Vec2 >
Initial guess for the parallel Bairstow method.
auto suppress(Vec2 &vA, Vec2 &vA1, const Vec2 &vri, const Vec2 &vrj) -> void
Zero suppression step in Bairstow's method (matrix variant).
auto suppress_old(Vec2 &vA, Vec2 &vA1, const Vec2 &vri, const Vec2 &vrj) -> void
Zero suppression step in Bairstow's method (scalar arithmetic).
auto pbairstow_even_st(const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const ginger::Options &options) -> std::pair< unsigned int, bool >
Single-threading Bairstow's method (even degree only).
auto horner_eval(std::vector< double > coeffs1, std::size_t degree, const double &z) -> double
Definition rootfinding.hpp:241
auto makeadjoint(const Vec2 &vr, const Vec2 &vp) -> Mat2
Create adjoint matrix from two vectors.
Definition rootfinding.hpp:168
auto delta_scalar(const Vec2 &vA, const Vec2 &vr, const Vec2 &vp) -> Vec2
Calculate Newton correction delta (scalar arithmetic, no Matrix2 temporaries).
Definition rootfinding.hpp:188
auto poly_from_quadratic_factors(const std::vector< Vec2 > &vrs) -> std::vector< double >
Reconstruct a monic polynomial from its quadratic factors.
auto suppress2(Vec2 &vA, Vec2 &vA1, const Vec2 &vri, const Vec2 &vrj) -> void
Zero suppression step in Bairstow's method (variant 2).
auto horner(std::vector< double > &coeffs1, std::size_t degree, const Vec2 &vr) -> Vec2
Horner's rule.
auto pbairstow_even(const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const ginger::Options &options) -> std::pair< unsigned int, bool >
Definition rootfinding.hpp:78
auto delta(const Vec2 &vA, const Vec2 &vr, const Vec2 &vp) -> Vec2
Calculate Newton correction delta (matrix-based).
Definition rootfinding.hpp:218