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

Direct Gaussian elimination solver with SIMD acceleration. More...

#include <LinearSolver.hpp>

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

Public Types

using SimdT = simd::SimdTraits<K, DefaultISA>
 
using regT = typename SimdT::reg
 

Public Member Functions

size_t rows () const
 
 __attribute__ ((always_inline, hot, flatten)) static inline Vector< K > solve(const Matrix< K > &A_in
 Solve the linear system \( Ax = b \).
 
 assert (n==A_in.cols &&n==b_in.size())
 
Vector< Kx (n)
 
aligned_vector< Krowi (n)
 
aligned_vector< Krowj (n)
 
 for (size_t i=0;i< n;++i)
 
 for (size_t ii=n;ii-- > 0;)
 

Static Public Member Functions

static void raw_row_echelon (Matrix< K > &A, Vector< K > *b=nullptr, K eps=1e-12)
 

Public Attributes

size_t block_size
 
aligned_vector< Kdata
 
const Vector< K > & b_in
 
const size_t n = A_in.rows
 
if(n >=1024) return Jacobi< K > Matrix< KM = A_in
 
Vector< KB = b_in
 
const size_t W = SimdT::width
 
return x
 

Detailed Description

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

Direct Gaussian elimination solver with SIMD acceleration.

This solver uses LU-style elimination with partial pivoting. For large systems ( \( n \geq 1024 \)), it redirects to Jacobi.

Template Parameters
KScalar type (must be floating-point)

Member Typedef Documentation

◆ regT

template<typename K >
using tensorium::solver::Gauss< K >::regT = typename SimdT::reg

◆ SimdT

Member Function Documentation

◆ __attribute__()

template<typename K >
tensorium::solver::Gauss< K >::__attribute__ ( (always_inline, hot, flatten) ) const &

Solve the linear system \( Ax = b \).

Performs Gaussian elimination followed by back-substitution. Uses unrolled and SIMD-optimized loops for performance.

Parameters
A_inInput matrix \( A \in \mathbb{R}^{n \times n} \)
b_inRight-hand side vector \( b \in \mathbb{R}^n \)
Returns
Solution vector \( x \in \mathbb{R}^n \)
Exceptions
std::runtime_errorif matrix is singular or ill-conditioned

◆ assert()

template<typename K >
tensorium::solver::Gauss< K >::assert ( n = =A_in.cols &&n==b_in.size())

Referenced by tensorium::solver::Gauss< K >::raw_row_echelon().

Here is the caller graph for this function:

◆ for() [1/2]

template<typename K >
tensorium::solver::Gauss< K >::for ( )
inline

References MathsUtils::_abs(), MathsUtils::_swap(), tensorium::solver::Gauss< K >::B, f(), tensorium::solver::Gauss< K >::M, tensorium::solver::Gauss< K >::n, tensorium::solver::Gauss< K >::rowi(), tensorium::solver::Gauss< K >::rowj(), UNROLL, and tensorium::solver::Gauss< K >::W.

Here is the call graph for this function:

◆ for() [2/2]

template<typename K >
tensorium::solver::Gauss< K >::for ( size_t ii = nii--,
0;  )
inline

References tensorium::solver::Gauss< K >::B, tensorium::solver::Gauss< K >::M, tensorium::solver::Gauss< K >::n, tensorium::solver::Gauss< K >::rowi(), tensorium::solver::Gauss< K >::W, and tensorium::solver::Gauss< K >::x.

Here is the call graph for this function:

◆ raw_row_echelon()

template<typename K >
static void tensorium::solver::Gauss< K >::raw_row_echelon ( Matrix< K > & A,
Vector< K > * b = nullptr,
K eps = 1e-12 )
inlinestatic

References MathsUtils::_abs(), MathsUtils::_swap(), tensorium::solver::Gauss< K >::assert(), tensorium::Matrix< K, RowMajor >::cols, f(), tensorium::solver::Gauss< K >::n, tensorium::Matrix< K, RowMajor >::rows, and tensorium::Matrix< K, RowMajor >::swap_rows().

Referenced by tensorium::row_echelon().

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

◆ rowi()

template<typename K >
aligned_vector< K > tensorium::solver::Gauss< K >::rowi ( n )

Referenced by tensorium::solver::Gauss< K >::for(), and tensorium::solver::Gauss< K >::for().

Here is the caller graph for this function:

◆ rowj()

template<typename K >
aligned_vector< K > tensorium::solver::Gauss< K >::rowj ( n )

Referenced by tensorium::solver::Gauss< K >::for().

Here is the caller graph for this function:

◆ rows()

template<typename K >
size_t tensorium::solver::Gauss< K >::rows ( ) const

◆ x()

template<typename K >
Vector< K > tensorium::solver::Gauss< K >::x ( n )

Member Data Documentation

◆ B

◆ b_in

template<typename K >
const Vector<K>& tensorium::solver::Gauss< K >::b_in
Initial value:
{
static_assert(std::is_floating_point<K>::value, "")

◆ block_size

template<typename K >
size_t tensorium::solver::Gauss< K >::block_size

◆ data

◆ M

◆ n

◆ W

◆ x


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