Eigenvalues of Transition Matrix in Jacobi Method I'm trying to make a code for the Jacobi Method, to find x in this expression:
$Ax=B$
I’m trying to use this other to iterate.
$X^{(k+1)}=D^{-1} B - D^{-1}(L+U)X^{(k)}$
D is the diagonal matrix of A.
U is the upper triangular matrix of A.
L is the lower triangular matrix of A.
The transition matrix: $T=-D^{-1}(L+U)$
 If the spectral radius of T is greater that 1, this method will not converge. 
I understand that D must be invertible. But if D is not invertible, I can't find T, nor can I find the eigenvalues, which gives me the condition of the spectral radius to use or not this method.
My question is, is it okay to say that if the determinant of D is zero, then the method can't be used? Or is there other way to solve using the Jacobi method?
 A: What you essentially need is that there are no zeros on the diagonal of $A$. This might not be the case out of the box, but you can permute rows or columns to fix this issue. Let's try to illustrate this with an example: Consider $$A = \begin{pmatrix}0 & 0.5 \\ 0.5 & 0 \end{pmatrix}. $$
Out of the box, Jacobi doesn't work. Let's assume that the matrix $A$ is non-degenerate / invertible / has full rank (otherwise you cannot (uniquely) solve the linear system $Ax=b$). Then, In every column (and row) of the matrix there has to be a non-zero entry. By setting up the correct permutation matrix, we can move the non-zeros to the diagonal. In our case:
$$ P = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} $$ and
$$\tilde A := PA= \begin{pmatrix}0.5 & 0 \\ 0 & 0.5 \end{pmatrix}. $$
Of course, the same has to be done for the RHS $b$:
$$\tilde b := P b.$$
The solution $\tilde x$ of $\tilde A \tilde x = \tilde b$ is the same as $x$ of $Ax=b$. Now you can apply the Jacobi method to $\tilde A, \tilde b$.
