PSCF v1.1
|
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... | |
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.
Pscf::LuSolver::LuSolver | ( | ) |
Constructor.
Definition at line 14 of file LuSolver.cpp.
Pscf::LuSolver::~LuSolver | ( | ) |
Destructor.
Definition at line 34 of file LuSolver.cpp.
void Pscf::LuSolver::allocate | ( | int | n | ) |
Allocate memory.
n | dimension of n x n square array. |
Definition at line 46 of file LuSolver.cpp.
References UTIL_CHECK.
Referenced by Pscf::Homogeneous::Mixture::computePhi().
void Pscf::LuSolver::computeLU | ( | const Matrix< double > & | A | ) |
Compute the LU decomposition for later use.
A | the 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 Ax = b for known b to compute x.
b | the RHS vector |
x | the 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().
void Pscf::LuSolver::inverse | ( | Matrix< double > & | inv | ) |
Compute inverse of matrix A.
inv | inverse of matrix A (output) |
Definition at line 104 of file LuSolver.cpp.
References Util::Matrix< Data >::cArray(), and UTIL_CHECK.