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

Iterative Jacobi solver with SIMD and OpenMP support. More...

#include <LinearSolver.hpp>

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

Static Public Member Functions

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

Public Attributes

aligned_vector< Kdata
 

Detailed Description

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

Iterative Jacobi solver with SIMD and OpenMP support.

Iteratively solves \( Ax = b \) using the Jacobi method. Works best on diagonally dominant matrices.

Update rule:

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

Template Parameters
KScalar type (must be floating-point)

Member Function Documentation

◆ solve()

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

Solve the system using the Jacobi method.

Parameters
AMatrix \( A \in \mathbb{R}^{n \times n} \)
bRight-hand side vector
tolConvergence tolerance (default = 1e-10)
max_iterMaximum number of iterations (default = 2000)
Returns
Solution vector \( x \)
Exceptions
std::runtime_errorif diagonal is zero or near-zero

References MathsUtils::_abs(), tensorium::Matrix< K, RowMajor >::cols, tensorium::Matrix< K, RowMajor >::rows, sigma, and tensorium::Vector< K >::size().

Referenced by tensorium::jacobi_solve().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ data


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