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

Solve Ax=b by LU decomposition of A. More...

#include <LuSolver.h>

Public Member Functions

 LuSolver ()
 Constructor. More...
 
 ~LuSolver ()
 Destructor. More...
 
void allocate (int n)
 Allocate memory. More...
 
void computeLU (const Matrix< double > &A)
 Compute the LU decomposition for later use. More...
 
void solve (Array< double > &b, Array< double > &x)
 Solve Ax = b for known b to compute x. More...
 
void inverse (Matrix< double > &inv)
 Compute inverse of matrix A. More...
 

Detailed Description

Solve Ax=b by LU decomposition of A.

This class is a simple wrapper for the functions provided by the Gnu Scientific Library (GSL).

Definition at line 30 of file LuSolver.h.

Constructor & Destructor Documentation

◆ LuSolver()

Pscf::LuSolver::LuSolver ( )

Constructor.

Definition at line 14 of file LuSolver.cpp.

◆ ~LuSolver()

Pscf::LuSolver::~LuSolver ( )

Destructor.

Definition at line 34 of file LuSolver.cpp.

Member Function Documentation

◆ allocate()

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

Allocate memory.

Parameters
ndimension of n x n square array.

Definition at line 46 of file LuSolver.cpp.

References UTIL_CHECK.

Referenced by Pscf::Homogeneous::Mixture::computePhi().

◆ computeLU()

void Pscf::LuSolver::computeLU ( const Matrix< double > &  A)

Compute the LU decomposition for later use.

Parameters
Athe square matrix A in problem Ax=b.

Definition at line 63 of file LuSolver.cpp.

References Util::Matrix< Data >::capacity1(), Util::Matrix< Data >::capacity2(), and UTIL_CHECK.

Referenced by Pscf::Homogeneous::Mixture::computePhi().

◆ solve()

void Pscf::LuSolver::solve ( Array< double > &  b,
Array< double > &  x 
)

Solve Ax = b for known b to compute x.

Parameters
bthe RHS vector
xthe solution vector

Definition at line 83 of file LuSolver.cpp.

References Util::Array< Data >::capacity(), Util::Array< Data >::cArray(), and UTIL_CHECK.

Referenced by Pscf::Homogeneous::Mixture::computePhi(), and Pscf::Fd1d::NrIterator::solve().

◆ inverse()

void Pscf::LuSolver::inverse ( Matrix< double > &  inv)

Compute inverse of matrix A.

Parameters
invinverse of matrix A (output)

Definition at line 104 of file LuSolver.cpp.

References Util::Matrix< Data >::cArray(), and UTIL_CHECK.


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