SOR(A, b, N) solve iteratively a system of linear equations whereby A is the coefficient matrix, and b is the right-hand side column vector. N is the maximum number of iterations.
The method implemented is that of Successive Over Relaxation. The starting vector is the null vector, but can be adjusted to one's needs.
The iterative form is based on the S.O.R. transition/iteration matrix
Tw = inv(D-w*L)*((1-w)*D+w*U) and the constant vector cw = w*inv(D-w*L*b.
The optimal parameter w is calculated using the spectral raduis of the Jacobi transition matrix Tj = inv(D)*(L+U).
The output is the solution vector x.