|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
Options of idr_s (issue 874). More...
#include <idr_s.hpp>
Public Attributes | |
| std::size_t | s = 4 |
| Dimension of the shadow space P. | |
| double | kappa = 0 |
| The omega of each cycle minimizes ||r - omega t||; with kappa > 0 it is enlarged when the angle between r and t is wide: when |cos(r, t)| < kappa, omega is scaled by kappa / |cos(r, t)| ("maintaining the convergence", Sleijpen & van Gijzen 2010, whose default is 0.7). | |
| bool | smoothing = false |
| Minimal-residual smoothing (Alg. | |
| bool | residual_replacement = true |
| Residual replacement ("reliable updating", Sleijpen & van der Vorst 1996; van der Vorst & Ye 2000): at the start of a cycle, once the updated residual has fallen 100x below its largest norm since the last replacement, it is replaced by b - A x. | |
| std::uint64_t | seed = 42 |
| Seed of the shadow space's random draw. | |
Options of idr_s (issue 874).
| double mtl::itl::idrs_options::kappa = 0 |
The omega of each cycle minimizes ||r - omega t||; with kappa > 0 it is enlarged when the angle between r and t is wide: when |cos(r, t)| < kappa, omega is scaled by kappa / |cos(r, t)| ("maintaining the convergence", Sleijpen & van Gijzen 2010, whose default is 0.7).
The default here is 0, the minimal-residual omega, from measurements on 2D convection-diffusion, Poisson and shifted skew systems (issue 874): 0.7 was never clearly better on the first two and up to 25% slower on Poisson at s <= 2; on sigma I + S it took 25% fewer iterations at sigma = 0.5, s >= 4, but at sigma = 0.1 the enlarged omega made the residual grow without bound (1e62 at s = 1), where kappa = 0 stays bounded.
| bool mtl::itl::idrs_options::residual_replacement = true |
Residual replacement ("reliable updating", Sleijpen & van der Vorst 1996; van der Vorst & Ye 2000): at the start of a cycle, once the updated residual has fallen 100x below its largest norm since the last replacement, it is replaced by b - A x.
The gap between the two then stays at rounding level: without it, IDR(16) on a nonnormal convection-diffusion system stopped at an updated 9.1e-11 whose true value was 2.5e-9 (issue 874). One product with A per replacement, about one per two decades of convergence.
| std::size_t mtl::itl::idrs_options::s = 4 |
Dimension of the shadow space P.
Larger s takes fewer products with A and more vector work and memory per product: 3s + 4 vectors of length n (3s + 6 with smoothing). Clamped to n.
| std::uint64_t mtl::itl::idrs_options::seed = 42 |
Seed of the shadow space's random draw.
A run is reproducible: the draw uses std::mt19937_64 and integer arithmetic only, which every platform computes alike.
| bool mtl::itl::idrs_options::smoothing = false |
Minimal-residual smoothing (Alg.
913): x and r are replaced by a smoothed pair whose residual norm decreases monotonically. Costs two vectors and two reductions per product with A.