Tensorium
Loading...
Searching...
No Matches
tensorium::solver::GaussSeidel< K > Class Template Reference

Placeholder for Gauss–Seidel iterative solver. More...

#include <LinearSolver.hpp>

Collaboration diagram for tensorium::solver::GaussSeidel< K >:

Static Public Member Functions

static Vector< Ksolve (const Matrix< K > &A, const Vector< K > &b, K tol=1e-8, int max_iter=2000)
 Solve the system using Gauss–Seidel method.
 

Public Attributes

aligned_vector< Kdata
 

Detailed Description

template<typename K>
class tensorium::solver::GaussSeidel< K >

Placeholder for Gauss–Seidel iterative solver.

The Gauss–Seidel method improves on Jacobi by using updated values as soon as they are available.

Update rule:

\[ x_i^{(k+1)} = \frac{1}{A_{ii}} \left(b_i - \sum_{j < i} A_{ij} x_j^{(k+1)} - \sum_{j > i} A_{ij} x_j^{(k)} \right) \]

Template Parameters
KScalar type

Member Function Documentation

◆ solve()

template<typename K >
static Vector< K > tensorium::solver::GaussSeidel< K >::solve ( const Matrix< K > & A,
const Vector< K > & b,
K tol = 1e-8,
int max_iter = 2000 )
static

Solve the system using Gauss–Seidel method.

Parameters
AMatrix \( A \in \mathbb{R}^{n \times n} \)
bRight-hand side vector
tolConvergence tolerance
max_iterMax iterations allowed
Returns
Solution vector \( x \)

Member Data Documentation

◆ data


The documentation for this class was generated from the following file: