PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::BasicLUFactorisation< T, N > Class Template Reference

Utility functor for solving the equation linear system \(Ax=b\) using LU factorisation with partial pivoting of \(A\) for a square matrix. More...

#include <ptems/matrix.hpp>

Public Member Functions

constexpr BasicLUFactorisation (const BasicMatrix< T, N, N > &matrix)
 LU factorise, with partial pivoting, the specified matrix. More...
 
constexpr BasicLUFactorisation (BasicMatrix< T, N, N > &&matrix)
 LU factorise, with partial pivoting, the specified matrix. More...
 
template<typename... Args>
constexpr BasicLUFactorisation (Args... args)
 LU factorise, with partial pivoting, the specified matrix. More...
 
constexpr BasicVector< T, N > operator() (BasicVector< T, N > rhs) const
 Solve the linear system \(Ax=b\) for the matrix \(A\) this functor was constructed with, and specified right hand side \(b\). More...
 

Detailed Description

template<typename T, std::size_t N>
class ptems::BasicLUFactorisation< T, N >

Utility functor for solving the equation linear system \(Ax=b\) using LU factorisation with partial pivoting of \(A\) for a square matrix.

Note
This is a basic implementation of LU factorisation which should be sufficient for small-ish matrices. For larger matrices a specialised linear algebra library is recommended.
Template Parameters
TThe type of the matrix entries
NThe size of the matrix (both dimensions)

Constructor & Destructor Documentation

◆ BasicLUFactorisation() [1/3]

template<typename T , std::size_t N>
constexpr ptems::BasicLUFactorisation< T, N >::BasicLUFactorisation ( const BasicMatrix< T, N, N > &  matrix)
inlineexplicitconstexpr

LU factorise, with partial pivoting, the specified matrix.

Exceptions
std::invalid_argumentIf the LU factorisation fails (usually due to a singular matrix)
Parameters
matrixMatrix to perform LU factorisation on

◆ BasicLUFactorisation() [2/3]

template<typename T , std::size_t N>
constexpr ptems::BasicLUFactorisation< T, N >::BasicLUFactorisation ( BasicMatrix< T, N, N > &&  matrix)
inlineexplicitconstexpr

LU factorise, with partial pivoting, the specified matrix.

Exceptions
std::invalid_argumentIf the LU factorisation fails (usually due to a singular matrix)
Parameters
matrixMatrix to perform LU factorisation on

◆ BasicLUFactorisation() [3/3]

template<typename T , std::size_t N>
template<typename... Args>
constexpr ptems::BasicLUFactorisation< T, N >::BasicLUFactorisation ( Args...  args)
inlineexplicitconstexpr

LU factorise, with partial pivoting, the specified matrix.

Exceptions
std::invalid_argumentIf the LU factorisation fails (usually due to a singular matrix)
Parameters
argsArguments to forward to a BasicMatrix<T,N,N> constructor to create the matrix to LU factorise.

Member Function Documentation

◆ operator()()

template<typename T , std::size_t N>
constexpr BasicVector<T, N> ptems::BasicLUFactorisation< T, N >::operator() ( BasicVector< T, N >  rhs) const
inlineconstexpr

Solve the linear system \(Ax=b\) for the matrix \(A\) this functor was constructed with, and specified right hand side \(b\).

Parameters
rhsThe right hand side vector \(b\)
Returns
The solution vector \(x=\)

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