CVR-Lib last update 20 Sep 2009

cvr::luDecomposition< T > Class Template Reference
[Linear Algebra]

LU decomposition functor. More...

#include <cvrLuDecomposition.h>

Inheritance diagram for cvr::luDecomposition< T >:

Inheritance graph
[legend]
Collaboration diagram for cvr::luDecomposition< T >:

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class luDecomposition. More...

Public Member Functions

 luDecomposition ()
 luDecomposition (const parameters &par)
 luDecomposition (const luDecomposition &other)
virtual ~luDecomposition ()
bool apply (matrix< T > &a, vector< integer > &permutation, int &pivot) const
bool apply (const matrix< T > &a, matrix< T > &lu, vector< integer > &permutation, int &pivot) const
luDecomposition< T > & copy (const luDecomposition< T > &other)
const std::string & name () const
virtual luDecomposition< T > * clone () const
virtual luDecomposition< T > * newInstance () const
const parametersgetParameters () const
matrix< T > extractL (const matrix< T > &lu) const
matrix< T > extractU (const matrix< T > &lu) const
void extractL (const matrix< T > &lu, matrix< T > &l) const
void extractU (const matrix< T > &lu, matrix< T > &u) const
void buildPermutationMatrix (const vector< integer > &pv, matrix< T > &pm) const


Detailed Description

template<typename T>
class cvr::luDecomposition< T >

LU decomposition functor.

Computes the LU decomposition of a square matrix.

This class uses LAPACK if it is available. Note that if LAPACK is not used or not available, A must be of full rank!


Constructor & Destructor Documentation

template<typename T>
cvr::luDecomposition< T >::luDecomposition (  ) 

Default constructor.

template<typename T>
cvr::luDecomposition< T >::luDecomposition ( const parameters par  ) 

Construct a functor using the given parameters.

template<typename T>
cvr::luDecomposition< T >::luDecomposition ( const luDecomposition< T > &  other  ) 

Copy constructor.

Parameters:
other the object to be copied

template<typename T>
virtual cvr::luDecomposition< T >::~luDecomposition (  )  [virtual]

Destructor.


Member Function Documentation

template<typename T>
bool cvr::luDecomposition< T >::apply ( const matrix< T > &  a,
matrix< T > &  lu,
vector< integer > &  permutation,
int &  pivot 
) const

onCopy version of apply.

Given a matrix a[0..n-1][0..n-1], this routine returns a matrix decomposition[0..n-1][0..n-1] which contains the LU decomposition of a rowwise permutation of theMatrix. permutation[0..n-1] is an output vector that records the row permutation effected by the partial pivoting. 'pivot' is +/-1 depending on whether the number of row interchanges was even or odd, respectively.

Returns:
true, if the decomposition could be computed, false otherwise (typically, the matrix was singular).

template<typename T>
bool cvr::luDecomposition< T >::apply ( matrix< T > &  a,
vector< integer > &  permutation,
int &  pivot 
) const

onPlace version of apply.

Given a matrix a[0..n-1][0..n-1], this routine replaces it by the LU decomposition of a rowwise permutation of itself. permutation[0..n-1] is an output vector that records the row permutation effected by the partial pivoting. 'pivot' is +/-1 depending on whether the number of row interchanges was even or odd, respectively.

Returns:
true, if the decomposition could be computed, false otherwise (typically, the matrix was singular).

template<typename T>
void cvr::luDecomposition< T >::buildPermutationMatrix ( const vector< integer > &  pv,
matrix< T > &  pm 
) const

Builds the permutation matrix for the given permutation vector.

Parameters:
pv The row permutation vector on input
pm The row permutation matrix on output

template<typename T>
virtual luDecomposition<T>* cvr::luDecomposition< T >::clone (  )  const [virtual]

Returns a pointer to a clone of the functor.

Implements cvr::functor.

template<typename T>
luDecomposition<T>& cvr::luDecomposition< T >::copy ( const luDecomposition< T > &  other  ) 

Copy data of "other" functor.

template<typename T>
void cvr::luDecomposition< T >::extractL ( const matrix< T > &  lu,
matrix< T > &  l 
) const

Returns a new Matrix which contains the "L" part of the given LU decomposition.

This is much faster than the on copy version.

template<typename T>
matrix<T> cvr::luDecomposition< T >::extractL ( const matrix< T > &  lu  )  const

Returns a new Matrix which contains the "L" part of the given LU decomposition.

template<typename T>
void cvr::luDecomposition< T >::extractU ( const matrix< T > &  lu,
matrix< T > &  u 
) const

Returns a new Matrix which contains the "U" part of the given LU decomposition.

This is much faster than the on copy version.

template<typename T>
matrix<T> cvr::luDecomposition< T >::extractU ( const matrix< T > &  lu  )  const

Returns a new Matrix which contains the "U" part of the given LU decomposition.

template<typename T>
const parameters& cvr::luDecomposition< T >::getParameters (  )  const

Returns used parameters.

Reimplemented from cvr::linearAlgebraFunctor.

template<typename T>
const std::string& cvr::luDecomposition< T >::name (  )  const [virtual]

Returns the name of this class.

Implements cvr::functor.

template<typename T>
virtual luDecomposition<T>* cvr::luDecomposition< T >::newInstance (  )  const [virtual]

Returns a pointer to a new instance of the functor.

Implements cvr::functor.


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

Generated on Sun Sep 20 22:08:59 2009 for CVR-Lib by Doxygen 1.5.8