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. float or double ). |
MemorySpace | A memory space (e.g. cusp::host_memory or cusp::device_memory ) |
- Overview
- 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 x
.
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.
- Example
- The following code snippet demonstrates how to use a
diagonal
preconditioner to solve a linear system.
int main(void)
{
return 0;
}
- Examples:
- diagonal.cu.
Definition at line 85 of file diagonal.h.