Solution (source code)

= Solution

Assume the diagonal entries of $A$ are nonzero. The <Relaxed Jacobi method> simultaneously updates every component using the preceding iterate:
$$
x_i^{(\nu+1)}=(1-\omega)x_i^{(\nu)}+\frac{\omega}{a_{ii}}
\left(b_i-\sum_{j\ne i}a_{ij}x_j^{(\nu)}\right).
$$
In matrix form, with $D=\operatorname{diag}(A)$, this is $x^{(\nu+1)}=x^{(\nu)}+\omega D^{-1}(b-Ax^{(\nu)})$. The ordinary <Jacobi method> has $\omega=1$.