Add classical_iteration() sans comments, refactor jacobi() to use it.
[octave.git] / iterative / gauss_seidel.m
1 function [x, iterations, residual_norms] = ...
2 gauss_seidel(A, b, x0, tolerance, max_iterations)
3
4 if (nargin < 4)
5 tolerance = 1e-10;
6 end
7
8 if (nargin < 5)
9 max_iterations = intmax();
10 end
11
12 omega = 1;
13
14 if (nargout > 2)
15 [x, iterations, residual_norms] = ...
16 successive_over_relaxation(A, b, omega, x0, tolerance, max_iterations);
17 else
18 [x, iterations] = ...
19 successive_over_relaxation(A, b, omega, x0, tolerance, max_iterations);
20 end
21 end