Gauss seidel

`void solver(int n, int itr, double tol, double[] a, double[] b, double[] x) { double[] r = new double[n]; double[] x_old = new double[n]; double[] x_new = new double[n]; for (int j = 0; j < itr; j++) { for (int i = 0; i < n; i++) { x_old[i] = x[i]; } for (int i = 0; i < n; i++) { x_new[i] = (b[i] - dot(a, x_old, i)) / a[i, i]; } for (int i = 0; i < n; i++) { x[i] = x_new[i]; } for (int i = 0; i < n; i++) { r[i] = b[i] - dot(a, x, i); }`