SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Private Attributes
DecompLU< T > Class Template Reference

Defines the LU decomposition algorithm of a square matrix. More...

#include <DecompLU.hh>

Public Member Functions

 DecompLU ()
 Default constructor, initilizes an empty matrix of dimension 0x0. More...
 
 DecompLU (std::vector< std::vector< T >> mat)
 Std constructor, sets the underlying std matrix. More...
 
 DecompLU (const DecompLU &decLU)
 Copy constructor. More...
 
DecompLU & operator= (const DecompLU &decLU)
 Equality operator. More...
 
 ~DecompLU ()
 Destructor. More...
 
void DecomposeCrout (std::vector< std::vector< T >> mat)
 Decomposes a square matrix into a parity matrix P, a lower triangular matrix L and an upper triangular matrix U. More...
 
T Determinant ()
 Returns the determinant of the decomposed matrix. More...
 
std::vector< std::vector< T > > NewMatrix (size_t m, size_t n)
 Returns a matrix of m rows and n columns. More...
 
const T & Factor ()
 Gets and returns the parity of the permutations. More...
 
const bool & Complete ()
 Gets and returns whether the LU decomposition was successful or not. More...
 
const std::vector< std::vector
< T > > & 
P ()
 Gets and returns the permutation matrix. More...
 
const std::vector< T > & Pivots ()
 Gets and returns the permutation vector, contains the ids of the rows. More...
 
const std::vector< std::vector
< T > > & 
L ()
 Gets and returns the lower triangular matrix. More...
 
const std::vector< std::vector
< T > > & 
U ()
 Gets and returns the upper triangular matrix. More...
 

Private Attributes

T _fact
 Parity of the permutation (1 or -1) More...
 
bool _complete
 True if the decomposition was successful. More...
 
std::vector< std::vector< T > > _P
 Permutation matrix. More...
 
std::vector< T > _pivots
 Premutation vector (IDs of the rows) More...
 
std::vector< std::vector< T > > _L
 L Matrix. More...
 
std::vector< std::vector< T > > _U
 U Matrix. More...
 

Detailed Description

template<typename T>
class DecompLU< T >

Defines the LU decomposition algorithm of a square matrix.

The matrices L and U are such that $PA = LU$ or $A = P^{-1}LU$ with

Constructor & Destructor Documentation

template<typename T >
DecompLU< T >::DecompLU ( )

Default constructor, initilizes an empty matrix of dimension 0x0.

template<typename T >
DecompLU< T >::DecompLU ( std::vector< std::vector< T >>  mat)

Std constructor, sets the underlying std matrix.

template<typename T >
DecompLU< T >::DecompLU ( const DecompLU< T > &  decLU)

Copy constructor.

template<typename T >
DecompLU< T >::~DecompLU ( )

Destructor.

Member Function Documentation

template<typename T>
const bool& DecompLU< T >::Complete ( )
inline

Gets and returns whether the LU decomposition was successful or not.

template<typename T >
void DecompLU< T >::DecomposeCrout ( std::vector< std::vector< T >>  mat)

Decomposes a square matrix into a parity matrix P, a lower triangular matrix L and an upper triangular matrix U.

Parameters
matInput square matrix
Returns
True if successful
template<typename T >
T DecompLU< T >::Determinant ( )

Returns the determinant of the decomposed matrix.

Returns
Determinant of (P*L*U)
template<typename T>
const T& DecompLU< T >::Factor ( )
inline

Gets and returns the parity of the permutations.

template<typename T>
const std::vector<std::vector<T> >& DecompLU< T >::L ( )
inline

Gets and returns the lower triangular matrix.

template<typename T >
std::vector< std::vector< T > > DecompLU< T >::NewMatrix ( size_t  m,
size_t  n 
)

Returns a matrix of m rows and n columns.

Parameters
mNumber of rows
nNumber of columns
Returns
True if successful
template<typename T >
DecompLU< T > & DecompLU< T >::operator= ( const DecompLU< T > &  decLU)

Equality operator.

template<typename T>
const std::vector<std::vector<T> >& DecompLU< T >::P ( )
inline

Gets and returns the permutation matrix.

template<typename T>
const std::vector<T>& DecompLU< T >::Pivots ( )
inline

Gets and returns the permutation vector, contains the ids of the rows.

template<typename T>
const std::vector<std::vector<T> >& DecompLU< T >::U ( )
inline

Gets and returns the upper triangular matrix.

Field Documentation

template<typename T>
bool DecompLU< T >::_complete
private

True if the decomposition was successful.

template<typename T>
T DecompLU< T >::_fact
private

Parity of the permutation (1 or -1)

template<typename T>
std::vector<std::vector<T> > DecompLU< T >::_L
private

L Matrix.

template<typename T>
std::vector<std::vector<T> > DecompLU< T >::_P
private

Permutation matrix.

template<typename T>
std::vector<T> DecompLU< T >::_pivots
private

Premutation vector (IDs of the rows)

template<typename T>
std::vector<std::vector<T> > DecompLU< T >::_U
private

U Matrix.


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