|
Ginger 1.1.9
|
Options for convergence-based algorithms. More...
Classes | |
| class | Matrix2 |
| Matrix2. More... | |
| class | Options |
| class | thread_pool |
| class | Vector2 |
| Vector2. More... | |
| class | Vector2Ref |
| Vector2Ref. More... | |
Enumerations | |
| enum class | solve_mode { automatic , sequential , multi_threaded , atomic } |
| Execution policy selection for the solver facades. More... | |
Functions | |
| auto | should_parallelize (std::size_t num_roots) -> bool |
Whether num_roots should use the multi-threaded execution policy. | |
| 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. | |
Variables | |
| constexpr std::size_t | PARALLEL_THRESHOLD = 4 |
| Number of roots above which the multi-threaded policies are used by default. | |
Options for convergence-based algorithms.
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.
|
strong |
|
inline |
Convenience accessor returning a singleton thread pool.
The pool uses hardware concurrency as the number of worker threads. Use this in call sites that do not need to manage pool lifetime.
Log a message using spdlog.
This function provides a simple wrapper around spdlog for logging messages. It creates a file logger that writes to "ginger.log" and logs at the info level.
| message | The message to log |
Whether num_roots should use the multi-threaded execution policy.
|
inline |
Facade for the Aberth-Ehrlich method.
| [in] | coeffs | Polynomial coefficients (highest degree first) |
| [in,out] | zs | Root iterates |
| [in] | options | Convergence options |
| [in] | mode | Execution policy selector |
|
inline |
Facade for the Aberth-Ehrlich method (auto-correlation).
| [in] | coeffs | Polynomial coefficients (highest degree first) |
| [in,out] | zs | Root iterates |
| [in] | options | Convergence options |
| [in] | mode | Execution policy selector |
|
inline |
Facade for the parallel Bairstow method (auto-correlation).
| [in] | coeffs | Polynomial coefficients (highest degree first) |
| [in,out] | vrs | Quadratic factor iterates |
| [in] | options | Convergence options |
| [in] | mode | Execution policy selector |
|
inline |
Facade for the parallel Bairstow method (even degree).
Selects the execution policy: automatic (default) dispatches to the multi-threaded variant when should_parallelize(vrs.size()) holds, otherwise to the single-threaded variant.
| [in] | coeffs | Polynomial coefficients (highest degree first) |
| [in,out] | vrs | Quadratic factor iterates |
| [in] | options | Convergence options |
| [in] | mode | Execution policy selector |
|
inlineconstexpr |
Number of roots above which the multi-threaded policies are used by default.