gko::solver::Idr#
Induced dimension reduction. A short-recurrence Krylov method that
maintains a fixed-dimensional shadow space (the subspace_dim factory
parameter, typically 4–8). Often outperforms Bicgstab on hard
non-symmetric problems while keeping memory bounded.
-
template<typename ValueType = default_precision>
class Idr # Inherits from
public gko::EnableLinOp<Idr<default_precision>>
public gko::solver::EnablePreconditionedIterativeSolver<default_precision, Idr<default_precision>>
public gko::Transposable
IDR(s) is an efficient method for solving large nonsymmetric systems of linear equations. The implementation follows the elegant variant that exploits the biorthogonality of the shadow vectors.
The method is based on the induced dimension reduction theorem. Fixing a full-rank shadow space \( R = \mathrm{span}(r_1, \ldots, r_s) \) — the \( s \) random orthonormal vectors stored in a dense matrix — the theorem guarantees the existence of a sequence of nested subspaces
\[ \mathcal{G}_{j+1} = (I - \omega_j A)\, (\mathcal{G}_j \cap R^{\perp}), \qquad \mathcal{G}_0 = \mathbb{R}^N, \]each strictly contained in its predecessor. Successive residuals are forced into these shrinking spaces and become identically zero after at most \( N + N/s \) iterations in exact arithmetic — substantially fewer matrix-vector products than the \( 2N \) BiCG would require.- References
Van Gijzen, M. B., Sonneveld, P. Algorithm 913: An Elegant IDR(s) Variant that Efficiently Exploits Biorthogonality Properties. ACM Transactions on Mathematical Software, 38 (1), Article 5, 2011. https://doi.org/10.1145/2049662.2049667
- Template Parameters:
ValueType – precision of the elements of the system matrix.
Public Functions
-
virtual std::unique_ptr<LinOp> transpose() const override#
Returns a LinOp representing the transpose of the Transposable object.
- Returns:
a pointer to the new transposed object
-
virtual std::unique_ptr<LinOp> conj_transpose() const override#
Returns a LinOp representing the conjugate transpose of the Transposable object.
- Returns:
a pointer to the new conjugate transposed object
-
inline bool apply_uses_initial_guess() const override#
Return true as iterative solvers use the data in x as an initial guess.
- Returns:
true as iterative solvers use the data in x as an initial guess.
-
inline size_type get_subspace_dim() const#
Gets the subspace dimension of the solver.
- Returns:
the subspace Dimension
-
inline void set_subspace_dim(const size_type other)#
Sets the subspace dimension of the solver.
- Parameters:
other – the new subspace Dimension
-
inline remove_complex<ValueType> get_kappa() const#
Gets the kappa parameter of the solver.
- Returns:
the kappa parameter
-
inline void set_kappa(const remove_complex<ValueType> other)#
Sets the kappa parameter of the solver.
- Parameters:
other – the new kappa parameter
-
inline bool get_deterministic() const#
Gets the deterministic parameter of the solver.
- Returns:
the deterministic parameter
-
inline void set_deterministic(const bool other)#
Sets the deterministic parameter of the solver.
- Parameters:
other – the new deterministic parameter
-
inline bool get_complex_subspace() const#
Gets the complex_subspace parameter of the solver.
- Returns:
the complex_subspace parameter
-
inline void set_complex_subpsace(const bool other)#
Sets the complex_subspace parameter of the solver.
- Deprecated:
Please use set_complex_subspace instead
- Parameters:
other – the new complex_subspace parameter
-
inline void set_complex_subspace(const bool other)#
Sets the complex_subspace parameter of the solver.
- Parameters:
other – the new complex_subspace parameter
Public Static Functions
- static parameters_type parse(
- const config::pnode &config,
- const config::registry &context,
- const config::type_descriptor &td_for_child = config::make_type_descriptor<ValueType>(),
Create the parameters from the property_tree. Because this is directly tied to the specific type, the value/index type settings within config are ignored and type_descriptor is only used for children configs.
- Parameters:
config – the property tree for setting
context – the registry
td_for_child – the type descriptor for children configs. The default uses the value type of this class.
- Returns:
parameters
-
struct parameters_type #
Inherits from
public gko::solver::enable_preconditioned_iterative_solver_factory_parameters<parameters_type, Factory>
Public Members
-
size_type subspace_dim#
Dimension of the subspace S. Determines how many intermediate residuals are computed in each iteration.
-
remove_complex<ValueType> kappa#
Threshold to determine if Av_n and v_n are too close to being perpendicular. This is considered to be the case if \(|(Av_n)^H * v_n / (norm(Av_n) * norm(v_n))| < kappa\)
-
bool deterministic#
If set to true, the vectors spanning the subspace S are chosen deterministically. This is mostly needed for testing purposes.
Note: If ‘deterministic’ is set to true, the subspace vectors are generated in serial on the CPU, which can be very slow.
The default behaviour is to choose the subspace vectors randomly.
-
bool complex_subspace#
If set to true, IDR will use a complex subspace S also for real problems, allowing for faster convergence and better results by acknowledging the influence of complex eigenvectors.
The default is false.