PARP Research Group University of Murcia, Spain


Matrix Algebra
[Math extensions]

Several matrix algebra related functions. More...

Functions

void singularValueDecomposition (const QVMatrix &M, QVMatrix &U, QVMatrix &V, QVMatrix &S)
 Obtains the singular value decomposition (SVD) for a matrix.
void LUDecomposition (const QVMatrix &M, QVMatrix &L, QVMatrix &U, QVMatrix &P)
 Obtains the LU decomposition for a matrix.
void CholeskyDecomposition (const QVMatrix &M, QVMatrix &L)
 Obtains the Cholesky decomposition for a matrix.
void QRDecomposition (const QVMatrix &M, QVMatrix &Q, QVMatrix &R)
 Obtains the QR decomposition for a matrix.
QVMatrix pseudoInverse (const QVMatrix &M)
 Obtains the pseudoinverse for a matrix.
void eigenDecomposition (const QVMatrix &M, QVVector &eigVals, QVMatrix &eigVecs)
 Obtains the eigendecomposition for a symetric matrix.
double determinant (const QVMatrix &M)
 Obtains the determinant of a squared matrix.
void solveLinear (const QVMatrix &A, QVVector &x, const QVVector &b)
 Solves a system of linear equations using a Householder transformation.
void solveLinear (const QVMatrix &A, QVMatrix &X, const QVMatrix &B)
 Solves several system of linear equations, using a LU decomposition.
void solveOverDetermined (const QVMatrix &A, QVMatrix &X, const QVMatrix &B)
 Solves several system of linear equations, using a SV decomposition.
void solveHomogeneousLinear (const QVMatrix &A, QVector< double > &x)
 Solves an homogeneous linear system.

Detailed Description

Several matrix algebra related functions.


Function Documentation

void CholeskyDecomposition ( const QVMatrix M,
QVMatrix L 
)

Obtains the Cholesky decomposition for a matrix.

Todo:
detailed description should follow
Parameters:
M matrix containing matrix to decompose (must be positive-definite)
L matrix to store resulting matrix L from decomposition

Definition at line 279 of file qvmatrixalgebra.cpp.

double determinant ( const QVMatrix M  ) 

Obtains the determinant of a squared matrix.

Todo:
detailed description should follow
Parameters:
M matrix to obtain the determinant
Returns:
the value of the determinant

Por ahora con la SVD, quizá sería mejor de otro modo...

Definition at line 357 of file qvmatrixalgebra.cpp.

void eigenDecomposition ( const QVMatrix M,
QVVector eigVals,
QVMatrix eigVecs 
)

Obtains the eigendecomposition for a symetric matrix.

Todo:
detailed description should follow
Parameters:
M symetric matrix to obtain eigendecomposition
eigVals matrix to store resulting eigenvalues vector
eigVecs matrix to store resulting eigenvectors matrix, as row vectors

Todo:
borrar el código comentado, cuando se compruebe que el nuevo funciona bien.

Definition at line 386 of file qvmatrixalgebra.cpp.

void LUDecomposition ( const QVMatrix M,
QVMatrix L,
QVMatrix U,
QVMatrix P 
)

Obtains the LU decomposition for a matrix.

Returms two triangular, upper and lower, matrixes and a permutation matrix (identity if M is invertible). And M = P*L*U

Todo:
detailed description should follow
Parameters:
M matrix containing matrix to decompose
L matrix to store resulting matrix L from decomposition
U matrix to store resulting matrix U from decomposition
P matrix to store resulting matrix P from decomposition

Definition at line 225 of file qvmatrixalgebra.cpp.

QVMatrix pseudoInverse ( const QVMatrix M  ) 

Obtains the pseudoinverse for a matrix.

Todo:
detailed description should follow
Parameters:
M matrix containing matrix to obtain pseudoinverse

Definition at line 339 of file qvmatrixalgebra.cpp.

void QRDecomposition ( const QVMatrix M,
QVMatrix Q,
QVMatrix R 
)

Obtains the QR decomposition for a matrix.

Todo:
detailed description should follow
Parameters:
M matrix containing matrix to decompose
Q matrix to store resulting matrix Q from decomposition
R matrix to store resulting matrix R from decomposition

Definition at line 305 of file qvmatrixalgebra.cpp.

void singularValueDecomposition ( const QVMatrix M,
QVMatrix U,
QVMatrix V,
QVMatrix S 
)

Obtains the singular value decomposition (SVD) for a matrix.

Resulting matrices U, V and S will satisfy the following relationship with the input matrix:

$ M = U S V^T $

Parameters:
M matrix containing matrix to decompose
U matrix to store resulting matrix U from decomposition
V matrix to store resulting matrix V from decomposition
S matrix to store resulting matrix S from decomposition

Todo:
borrar el código comentado, cuando se compruebe que el nuevo funciona bien.

Definition at line 173 of file qvmatrixalgebra.cpp.

void solveHomogeneousLinear ( const QVMatrix A,
QVector< double > &  x 
)

Solves an homogeneous linear system.

Todo:
detailed description should follow
Parameters:
A coeficient matrix in the matrix equation form of the problem.
x vector to store the solution.

Definition at line 129 of file qvmatrixalgebra.cpp.

void solveLinear ( const QVMatrix A,
QVMatrix X,
const QVMatrix B 
)

Solves several system of linear equations, using a LU decomposition.

Todo:
detailed description should follow
Parameters:
A coeficient matrix in the matrix equation form of the problem.
x matrix to store the solutions, each column is a solution.
B right-hand side matrix in the matrix equation form of the problem, each column is a right-hand side.

Definition at line 49 of file qvmatrixalgebra.cpp.

void solveLinear ( const QVMatrix A,
QVVector x,
const QVVector b 
)

Solves a system of linear equations using a Householder transformation.

Todo:
detailed description should follow
Parameters:
A coeficient matrix in the matrix equation form of the problem.
x vector to store the solution.
B right-hand side vector in the matrix equation form of the problem.

Definition at line 33 of file qvmatrixalgebra.cpp.

void solveOverDetermined ( const QVMatrix A,
QVMatrix X,
const QVMatrix B 
)

Solves several system of linear equations, using a SV decomposition.

Solves determined and over-determined systems, in the over-determined case the system is solved in the least squares sense.

Todo:
detailed description should follow
Parameters:
A coeficient matrix in the matrix equation form of the problem.
x matrix to store the solutions, each column is a solution.
B right-hand side matrix in the matrix equation form of the problem, each column is a right-hand side.

Definition at line 86 of file qvmatrixalgebra.cpp.




QVision framework. PARP research group, copyright 2007, 2008.