PSCF v1.1
Public Member Functions | List of all members
Pscf::TridiagonalSolver Class Reference

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

Detailed Description

Solver for Ax=b with tridiagonal matrix A.

Definition at line 27 of file TridiagonalSolver.h.

Constructor & Destructor Documentation

◆ TridiagonalSolver()

Pscf::TridiagonalSolver::TridiagonalSolver ( )

Constructor.

Definition at line 19 of file TridiagonalSolver.cpp.

◆ ~TridiagonalSolver()

Pscf::TridiagonalSolver::~TridiagonalSolver ( )

Destructor.

Definition at line 25 of file TridiagonalSolver.cpp.

Member Function Documentation

◆ allocate()

void Pscf::TridiagonalSolver::allocate ( int  n)

Allocate memory.

Parameters
ndimension 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().

◆ computeLU() [1/2]

void Pscf::TridiagonalSolver::computeLU ( const DArray< double > &  d,
const DArray< double > &  u 
)

Compute LU decomposition of a symmetric tridiagonal matrix.

Parameters
ddiagonal elements of n x n matrix matrix (0,..,n-1)
uupper off-diagonal elements (0,..,n-2)

Definition at line 43 of file TridiagonalSolver.cpp.

Referenced by Pscf::Fd1d::Block::setupSolver().

◆ computeLU() [2/2]

void Pscf::TridiagonalSolver::computeLU ( const DArray< double > &  d,
const DArray< double > &  u,
const DArray< double > &  l 
)

Compute LU decomposition of a general tridiagonal matrix.

Parameters
ddiagonal elements of n x n matrix matrix (0,..,n-1)
uupper off-diagonal elements (0,..,n-2)
llower off-diagonal elements (0,..,n-2)

Definition at line 59 of file TridiagonalSolver.cpp.

◆ multiply()

void Pscf::TridiagonalSolver::multiply ( const DArray< double > &  b,
DArray< double > &  x 
)

Evaluate product Ab = x for known b to compute x.

Parameters
bknown vector to be multiplied (input)
xresult of multiplication Ab = x (output)

Definition at line 103 of file TridiagonalSolver.cpp.

◆ solve()

void Pscf::TridiagonalSolver::solve ( const DArray< double > &  b,
DArray< double > &  x 
)

Solve Ax = b for known b to compute x.

Parameters
bknown vector on RHS (input)
xunknown solution vector of Ax = b (output)

Definition at line 121 of file TridiagonalSolver.cpp.

Referenced by Pscf::Fd1d::Block::step().


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