Solution (source code)

= Solution

With $D=\operatorname{diag}(a_{11},\ldots,a_{nn})$ invertible, the <weighted Jacobi method> is
$$
\boxed{x^{(k+1)}=x^{(k)}+\omega D^{-1}(b-Ax^{(k)})=(I-\omega D^{-1}A)x^{(k)}+\omega D^{-1}b.}
$$
Each new component uses only the previous iterate's components; $\omega=1$ is ordinary Jacobi iteration. Errors evolve by $e^{(k+1)}=(I-\omega D^{-1}A)e^{(k)}$.