CFL
|
Solver for tridiagonal system of equations. More...
#include <cfl/Auxiliary.hpp>
Public Member Functions | |
Tridiag () | |
Tridiag (const std::valarray< double > &rL, const std::valarray< double > &rD, const std::valarray< double > &rU) | |
void | assign (const std::valarray< double > &rL, const std::valarray< double > &rD, const std::valarray< double > &rU) |
void | solve (std::valarray< double > &rX) const |
This class solves tridiagonal system of equations.
cfl::Tridiag::Tridiag | ( | ) |
Default constructor.
cfl::Tridiag::Tridiag | ( | const std::valarray< double > & | rL, |
const std::valarray< double > & | rD, | ||
const std::valarray< double > & | rU | ||
) |
Constructor for tridiagonal matrix.
rL | The vector below diagonal. |
rD | The vector on diagonal. |
rU | The vector above diagonal. |
void cfl::Tridiag::assign | ( | const std::valarray< double > & | rL, |
const std::valarray< double > & | rD, | ||
const std::valarray< double > & | rU | ||
) |
Replaces this
with tridiagonal matrix which elements are defined by vectors rL, rD and rU.
rL | The vector below diagonal. |
rD | The vector on diagonal. |
rU | The vector above diagonal. |
void cfl::Tridiag::solve | ( | std::valarray< double > & | rX | ) | const |
Replaces rX with the solution x
of the linear equation: y = Ax
, where A
is the given tridiagonal matrix and y
is initial value of rX.
rX | Before the operation rX coincides with y and after the operation it coincides with x . Here y and x are related by the linear equation: y = Ax . |