latest version v1.9 - last update 10 Apr 2010 |
Matrix inversion functor. More...
#include <ltiMatrixInversion.h>
Classes | |
class | parameters |
parameters class for lti::matrixInversion functor More... | |
Public Member Functions | |
matrixInversion () | |
virtual | ~matrixInversion () |
bool | apply (const matrix< T > &theMatrix, matrix< T > &theInverse) const |
bool | apply (matrix< T > &theMatrix) const |
virtual functor * | clone () const |
void | useLUD () |
void | useSVD () |
virtual const char * | getTypeName () const |
const parameters & | getParameters () const |
Static Protected Attributes | |
static const T | my_epsilon |
Matrix inversion functor.
Computes the inverse of a matrix using LU decomposition. Only use this functor if the inverse of a matrix is needed explicity! To solve an equation system Ax=b or a set of equation systems AX=B it is more efficient to use the LU solution method (solve Ax=b resp. AX[i]=B[i]) directly than inverting A and multiplying the result by b resp. B!
If the parameter value method is set to SVD, a singular value decomposition is used to invert the matrix, instead of the LU decomposition method.
The apply() methods return false if the matrix is singular or close to being singular. This is defined by checking that the smalles singular value is greater than std::numeric_limits<T>::epsilon() for SVD and internally in the LU decomposition.
For small (2x2,3x3 or 4x4) symmetric matrices you can also use lti::symmetricMatrixInversion.
lti::matrixInversion< T >::matrixInversion | ( | ) |
default constructor
virtual lti::matrixInversion< T >::~matrixInversion | ( | ) | [inline, virtual] |
destructor
bool lti::matrixInversion< T >::apply | ( | matrix< T > & | theMatrix | ) | const |
onPlace version of apply.
theMatrix | matrix to be inverted. The result will be left here too. |
bool lti::matrixInversion< T >::apply | ( | const matrix< T > & | theMatrix, | |
matrix< T > & | theInverse | |||
) | const |
virtual functor* lti::matrixInversion< T >::clone | ( | ) | const [inline, virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
const parameters& lti::matrixInversion< T >::getParameters | ( | ) | const |
get a constant reference to the actual used parameters.
Reimplemented from lti::functor.
virtual const char* lti::matrixInversion< T >::getTypeName | ( | void | ) | const [inline, virtual] |
returns the name of this type
Reimplemented from lti::linearAlgebraFunctor.
void lti::matrixInversion< T >::useLUD | ( | ) |
change the used parameters in order to used the LU-decomposition method for matrix inversion.
void lti::matrixInversion< T >::useSVD | ( | ) |
change the used parameters in order to used the singular value decomposition method for matrix inversion.
const T lti::matrixInversion< T >::my_epsilon [static, protected] |
smallest value of type T, which can be added to 0 in order to produce a number different than zero.