NULAPACK
NUmerical Linear Algebra PACKage
Loading...
Searching...
No Matches
Functions
python.gauss_seidel Namespace Reference

Functions

 gauss_seidel (a, b, max_iter=1000, tol=1e-8, omega=1.0)
 

Function Documentation

◆ gauss_seidel()

python.gauss_seidel.gauss_seidel (   a,
  b,
  max_iter = 1000,
  tol = 1e-8,
  omega = 1.0 
)
Solve the linear system ax = b using the Gauss-Seidel method.

Parameters
----------
a : ndarray
    Coefficient matrix (n x n)
b : ndarray
    Right-hand side vector (n,)
max_iter : int, optional
    Maximum number of iterations
tol : float, optional
    Convergence tolerance
omega : float, optional
    Relaxation factor

Returns
-------
x : ndarray
    Solution vector
status : int
    0 if converged, non-zero otherwise

Definition at line 33 of file gauss_seidel.py.