Follow this link to skip to the main content

claraty::Matrix_LU< T > Class Template Reference
[Algorithms]

#include <matrix_lu.h>

Collaboration diagram for claraty::Matrix_LU< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Matrix_LU (const Matrix< T > &A)
int is_nonsingular ()
int is_close_to_singular ()
Matrix< T > get_L ()
Matrix< T > get_U ()
Vector< int > get_pivot ()
det ()
Matrix< T > solve (const Matrix< T > &B)
Vector< T > solve (const Vector< T > &b)
bool inverse (Matrix< T > &result)

Private Member Functions

void _LU_decomp ()
Matrix< T > _permute_copy (const Matrix< T > &A, const Vector< int > &piv, int j0, int j1)
Vector< T > _permute_copy (const Vector< T > &A, const Vector< int > &piv)

Private Attributes

Matrix< T > _LU_matrix
int _n_rows
int _n_cols
int _pivsign
Vector< int > _piv

Detailed Description

template<class T>
class claraty::Matrix_LU< T >

LU Decomposition.

For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector _piv of length m so that A(_piv,:) = L*U. If m < n, then L is m-by-m and U is m-by-n. The LU decompostion with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.

Definition at line 60 of file matrix_lu.h.


Constructor & Destructor Documentation

template<class T>
claraty::Matrix_LU< T >::Matrix_LU ( const Matrix< T > &  A  )  [inline]

LU Decomposition

Parameters:
A Rectangular matrix
Returns:
LU Decomposition object to access L, U and piv.

Definition at line 69 of file matrix_lu.h.

References claraty::Matrix_LU< T >::_LU_decomp().

00070     : _LU_matrix(A),
00071       _n_rows(A.get_num_of_rows()),
00072       _n_cols(A.get_num_of_cols()), 
00073       _piv(A.get_num_of_rows())
00074       {
00075         _LU_decomp();
00076       }

Here is the call graph for this function:


Member Function Documentation

template<class T>
int claraty::Matrix_LU< T >::is_nonsingular (  ) 

template<class T>
int claraty::Matrix_LU< T >::is_close_to_singular (  ) 

template<class T>
Matrix<T> claraty::Matrix_LU< T >::get_L (  ) 

template<class T>
Matrix<T> claraty::Matrix_LU< T >::get_U (  ) 

template<class T>
Vector<int> claraty::Matrix_LU< T >::get_pivot (  ) 

template<class T>
T claraty::Matrix_LU< T >::det (  ) 

Referenced by claraty::det().

template<class T>
Matrix<T> claraty::Matrix_LU< T >::solve ( const Matrix< T > &  B  ) 

template<class T>
Vector<T> claraty::Matrix_LU< T >::solve ( const Vector< T > &  b  ) 

template<class T>
bool claraty::Matrix_LU< T >::inverse ( Matrix< T > &  result  ) 

Referenced by claraty::inverse().

template<class T>
void claraty::Matrix_LU< T >::_LU_decomp (  )  [private]

template<class T>
Matrix<T> claraty::Matrix_LU< T >::_permute_copy ( const Matrix< T > &  A,
const Vector< int > &  piv,
int  j0,
int  j1 
) [private]

template<class T>
Vector<T> claraty::Matrix_LU< T >::_permute_copy ( const Vector< T > &  A,
const Vector< int > &  piv 
) [private]


Member Data Documentation

template<class T>
Matrix<T> claraty::Matrix_LU< T >::_LU_matrix [private]

Definition at line 104 of file matrix_lu.h.

template<class T>
int claraty::Matrix_LU< T >::_n_rows [private]

Definition at line 105 of file matrix_lu.h.

template<class T>
int claraty::Matrix_LU< T >::_n_cols [private]

Definition at line 105 of file matrix_lu.h.

template<class T>
int claraty::Matrix_LU< T >::_pivsign [private]

Definition at line 105 of file matrix_lu.h.

template<class T>
Vector<int> claraty::Matrix_LU< T >::_piv [private]

Definition at line 106 of file matrix_lu.h.


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