### 15.7.8 Solving a linear system using the Gauss-Seidel method

The gauss_seidel_linsolve command finds the solution of a linear system of equations using the Gauss-Seidel method.

- gauss_seidel_linsolve command takes two mandatory arguments and three optional arguments (including an optional first argument):
  - Optionally, ω, used for a general form of the Gauss-Seidel method (the successive overrelaxation method) (by default, ω=1).
  - A, the matrix of coefficients of a system.
  - b, the right hand side of the system as a list.
  - Optionally, ε, a positive number indicating the error tolerance (by default ε=epsilon, see Section 2.5.7, item 2.5.7).
  - Optionally, m, an integer indicating the maximum number of iterations (by default m=maxiter, see Section 2.5.7, item 2.5.7).
  gauss_seidel_linsolve(A,b⟨ε,m⟩) returns the solution of the system.

#### Examples

A:=[[100,2],[2,100]]:; gauss_seidel_linsolve(A,[0,1],1 e-12);

| ⎡ ⎣ | −0.000200080032013,0.0100040016006 | ⎤ ⎦

gauss_seidel_linsolve(1.5,A,[0,1],1 e-12);

| ⎡ ⎣ | −0.000200080032218,0.0100040016006 | ⎤ ⎦