Basic linear solver (LU factorisation) for a small dense matrix of the system. More...
#include <ptems/linearalgebra.hpp>
Public Member Functions | |
LinearSystemSolver (std::size_t size) | |
Create solver for a linear system of form \(Ax-b\), where the matrix is stored as a dense matrix. More... | |
std::size_t | size () const |
Gets the size of the linear system. More... | |
T & | operator() (std::size_t i, std::size_t j) |
Gets mutable reference to the specified entry of the matrix \(A\). More... | |
std::vector< T > & | Solve (std::vector< T > &rhs) |
Solves the linear system \(Ax-b\). More... | |
Basic linear solver (LU factorisation) for a small dense matrix of the system.
Solves the linear system \(Ax-b\) for \(A\in T^{n\times n}\), \(b,xA\in T^n\)
T | The type of the entries of the linear system |
|
inline |
Create solver for a linear system of form \(Ax-b\), where the matrix is stored as a dense matrix.
size | Dimension of the linear system |
|
inline |
Gets mutable reference to the specified entry of the matrix \(A\).
std::out_of_range | If the row or column index is greater or equal to size() |
std::logic_error | If Solve() has been called already |
i | The row index of the entry to get |
j | The column index of the entry to get |
|
inline |
Gets the size of the linear system.
|
inline |
Solves the linear system \(Ax-b\).
std::invalid_argument | If rhs.size() != size() |
rhs | The mutable vector containing \(b\) which is updated with \(x\) on return |