|
| auto | should_parallelize (std::size_t num_roots) -> bool |
| | Whether num_roots should use the multi-threaded execution policy.
|
| auto | residual_scale (const std::vector< double > &coeffs) -> double |
| | Normalisation factor making the convergence test scale-invariant.
|
| void | log_with_spdlog (const std::string &message) |
| | Log a message using spdlog.
|
| auto | solve_pbairstow_even (const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const Options &options, solve_mode mode=solve_mode::automatic) -> std::pair< unsigned int, bool > |
| | Facade for the parallel Bairstow method (even degree).
|
| auto | solve_pbairstow_autocorr (const std::vector< double > &coeffs, std::vector< Vec2 > &vrs, const Options &options, solve_mode mode=solve_mode::automatic) -> std::pair< unsigned int, bool > |
| | Facade for the parallel Bairstow method (auto-correlation).
|
| auto | solve_aberth (const std::vector< double > &coeffs, std::vector< std::complex< double > > &zs, const Options &options, solve_mode mode=solve_mode::automatic) -> std::pair< unsigned int, bool > |
| | Facade for the Aberth-Ehrlich method.
|
| auto | solve_aberth_autocorr (const std::vector< double > &coeffs, std::vector< std::complex< double > > &zs, const Options &options, solve_mode mode=solve_mode::automatic) -> std::pair< unsigned int, bool > |
| | Facade for the Aberth-Ehrlich method (auto-correlation).
|
| auto | get_thread_pool () -> thread_pool & |
| | Convenience accessor returning a singleton thread pool.
|
Options for convergence-based algorithms.
Options.
Stores maximum iteration count, tolerance for global convergence, and per-root tolerance for convergence checks used by Bairstow and Aberth root-finding methods.
The code snippet defines a class called Options that represents the options for a specific algorithm or function. It has two public member variables: max_iters and tolerance.
| auto ginger::residual_scale |
( |
const std::vector< double > & | coeffs | ) |
->double |
|
inline |
Normalisation factor making the convergence test scale-invariant.
At a root, |P(z)| has a floating-point floor proportional to the coefficient magnitudes. A fixed absolute tolerance is therefore unreachable for badly scaled polynomials, and the solver burns every iteration up to max_iters even though the roots are already accurate. Dividing the coefficients by this factor (roots are invariant under the scaling P -> P/s) makes Options::tolerance a relative measure.
The factor is floored at 1.0 so the historical absolute test is never made stricter for well-scaled polynomials.
- Parameters
-
| [in] | coeffs | Polynomial coefficients (highest degree first) |
- Returns
- Scale factor, at least 1.0