template<typename ValueType, typename MemorySpace>
class cusp::precond::diagonal< ValueType, MemorySpace >
Diagonal preconditoner (aka Jacobi preconditioner)
- Template Parameters
|ValueType||Type used for matrix values (e.g. |
|MemorySpace||A memory space (e.g. |
- Given a matrix
A to precondition, the diagonal preconditioner simply extracts the main diagonal
D of a
A and implements
y = D^-1 x when applied to a vector
Diagonal preconditioning is very inexpensive to use, but has limited effectiveness. However, if the matrix
A has poorly scaled rows then diagonal preconditioning can substantially reduce the number of solver iterations required to reach convergence.
- The following code snippet demonstrates how to use a
diagonal preconditioner to solve a linear system.
Definition at line 85 of file diagonal.h.