gko::solver::Idr#
Induced dimension reduction. A short-recurrence Krylov method that
maintains a fixed-dimensional shadow space (the subspace_dim factory
parameter, default 2; 4 or 8 are common larger choices) and exposes the kappa,
deterministic and complex_subspace factory parameters. 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 implemented version is the one presented in the paper “Algorithm 913: An elegant IDR(s) variant that efficiently exploits
biorthogonality properties” by M. B. Van Gijzen and P. Sonneveld.
The method is based on the induced dimension reduction theorem which provides a way to construct subsequent residuals that lie in a sequence of shrinking subspaces. These subspaces are spanned by s vectors which are first generated randomly and then orthonormalized. They are stored in a dense matrix.
- 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.