CFL
Public Member Functions | List of all members
cfl::Tridiag Class Reference

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
 

Detailed Description

This class solves tridiagonal system of equations.

Constructor & Destructor Documentation

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.

Parameters
rLThe vector below diagonal.
rDThe vector on diagonal.
rUThe vector above diagonal.

Member Function Documentation

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.

Parameters
rLThe vector below diagonal.
rDThe vector on diagonal.
rUThe 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.

Parameters
rXBefore 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 .

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