template<typename ValueType, typename MemorySpace>
class cusp::precond::diagonal< ValueType, MemorySpace >
Diagonal preconditioner (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;
}
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
Deprecated default monitor.
Implements standard convergence criteria and reporting for iterative solvers.
Diagonal preconditioner (aka Jacobi preconditioner)
void bicgstab(const LinearOperator &A, VectorType1 &x, const VectorType2 &b, Monitor &monitor, Preconditioner &M)
Biconjugate Gradient Stabilized method.
Definition at line 85 of file diagonal.h.