PSCF v1.1
|
Solver for Ax=b with tridiagonal matrix A. More...
#include <TridiagonalSolver.h>
Public Member Functions | |
TridiagonalSolver () | |
Constructor. More... | |
~TridiagonalSolver () | |
Destructor. More... | |
void | allocate (int n) |
Allocate memory. More... | |
void | computeLU (const DArray< double > &d, const DArray< double > &u) |
Compute LU decomposition of a symmetric tridiagonal matrix. More... | |
void | computeLU (const DArray< double > &d, const DArray< double > &u, const DArray< double > &l) |
Compute LU decomposition of a general tridiagonal matrix. More... | |
void | multiply (const DArray< double > &b, DArray< double > &x) |
Evaluate product Ab = x for known b to compute x. More... | |
void | solve (const DArray< double > &b, DArray< double > &x) |
Solve Ax = b for known b to compute x. More... | |
Solver for Ax=b with tridiagonal matrix A.
Definition at line 27 of file TridiagonalSolver.h.
Pscf::TridiagonalSolver::TridiagonalSolver | ( | ) |
Constructor.
Definition at line 19 of file TridiagonalSolver.cpp.
Pscf::TridiagonalSolver::~TridiagonalSolver | ( | ) |
Destructor.
Definition at line 25 of file TridiagonalSolver.cpp.
void Pscf::TridiagonalSolver::allocate | ( | int | n | ) |
Allocate memory.
n | dimension of n x n square array. |
Definition at line 31 of file TridiagonalSolver.cpp.
References Util::DArray< Data >::allocate().
Referenced by Pscf::Fd1d::Block::setDiscretization().
Compute LU decomposition of a symmetric tridiagonal matrix.
d | diagonal elements of n x n matrix matrix (0,..,n-1) |
u | upper off-diagonal elements (0,..,n-2) |
Definition at line 43 of file TridiagonalSolver.cpp.
Referenced by Pscf::Fd1d::Block::setupSolver().
void Pscf::TridiagonalSolver::computeLU | ( | const DArray< double > & | d, |
const DArray< double > & | u, | ||
const DArray< double > & | l | ||
) |
Compute LU decomposition of a general tridiagonal matrix.
d | diagonal elements of n x n matrix matrix (0,..,n-1) |
u | upper off-diagonal elements (0,..,n-2) |
l | lower off-diagonal elements (0,..,n-2) |
Definition at line 59 of file TridiagonalSolver.cpp.
Evaluate product Ab = x for known b to compute x.
b | known vector to be multiplied (input) |
x | result of multiplication Ab = x (output) |
Definition at line 103 of file TridiagonalSolver.cpp.
Solve Ax = b for known b to compute x.
b | known vector on RHS (input) |
x | unknown solution vector of Ax = b (output) |
Definition at line 121 of file TridiagonalSolver.cpp.
Referenced by Pscf::Fd1d::Block::step().