43extern auto initial_guess(std::vector<double> coeffs) -> std::vector<Vec2>;
91 const Options& options) -> std::pair<unsigned int, bool>;
94 const Options& options) -> std::pair<unsigned int, bool>;
96inline auto pbairstow_even(
const std::vector<double>& coeffs, std::vector<Vec2>& vrs,
97 const Options& options) -> std::pair<unsigned int, bool> {
121extern auto horner(std::vector<double>& coeffs1, std::size_t degree,
const Vec2& vr) ->
Vec2;
189 return {
Vec2{s, -p},
Vec2{-p * vr.
y(), p * vr.x() + s}};
207 const auto r = vr.
x();
208 const auto q = vr.y();
209 const auto p = vp.x();
210 const auto s = vp.y();
213 const auto det = s * (p * r + s) - p * p * q;
216 const auto mx = s * vA.x() - p * vA.y();
217 const auto my = -p * q * vA.x() + (p * r + s) * vA.y();
218 return Vec2{mx / det, my / det};
238 return mp.mdot(vA) / mp.det();
259inline auto horner_eval(std::vector<double> coeffs1, std::size_t degree,
const double& z)
261 for (
auto idx = 0U; idx != degree; ++idx) {
262 coeffs1[idx + 1] += coeffs1[idx] * z;
264 return coeffs1[degree];
Options for convergence-based algorithms.
Definition config.hpp:15
Matrix2.
Definition matrix2.hpp:28
constexpr auto x() const -> const T1 &
Get the first column vector.
Definition matrix2.hpp:47
Vector2.
Definition vector2.hpp:19
constexpr auto y() const noexcept -> const T2 &
Definition vector2.hpp:81
constexpr auto x() const noexcept -> const T1 &
Definition vector2.hpp:74
2x2 matrix template for polynomial root-finding
auto pbairstow_even(const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const Options &options) -> std::pair< unsigned int, bool >
Definition rootfinding.hpp:96
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_mt(const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const Options &options) -> std::pair< unsigned int, bool >
auto horner_eval(std::vector< double > coeffs1, std::size_t degree, const double &z) -> double
Definition rootfinding.hpp:259
auto makeadjoint(const Vec2 &vr, const Vec2 &vp) -> Mat2
Create adjoint matrix from two vectors.
Definition rootfinding.hpp:186
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:206
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_st(const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const Options &options) -> std::pair< unsigned int, bool >
Multi-threading Bairstow's method (even degree only)
ginger::Vector2< double > Vec2
Definition rootfinding.hpp:14
auto delta(const Vec2 &vA, const Vec2 &vr, const Vec2 &vp) -> Vec2
Calculate Newton correction delta (matrix-based)
Definition rootfinding.hpp:236