Various mathematical utilities to compute SVD and the condition number of a matrix.
More...
|
|
static std::size_t | SingularValueDecomposition (const MatrixType &InputMatrix, MatrixType &UMatrix, MatrixType &SMatrix, MatrixType &VMatrix, Parameters ThisParameters) |
| This function gives the SVD of a given mxn matrix (m>=n), returns U,S; where A=U*S*V. More...
|
|
static std::size_t | SingularValueDecomposition (const MatrixType &InputMatrix, MatrixType &UMatrix, MatrixType &SMatrix, MatrixType &VMatrix, const std::string &TypeSVD="Jacobi", const TDataType Tolerance=std::numeric_limits< double >::epsilon(), const IndexType MaxIter=200) |
| This function gives the SVD of a given mxn matrix (m>=n), returns U,S; where A=U*S*V. More...
|
|
static std::size_t | JacobiSingularValueDecomposition (const MatrixType &InputMatrix, MatrixType &UMatrix, MatrixType &SMatrix, MatrixType &VMatrix, const TDataType Tolerance=std::numeric_limits< double >::epsilon(), const IndexType MaxIter=200) |
| This function gives the Jacobi SVD of a given mxn matrix (m>=n), returns U,S; where A=U*S*V. More...
|
|
static void | SingularValueDecomposition2x2 (const MatrixType &InputMatrix, MatrixType &UMatrix, MatrixType &SMatrix, MatrixType &VMatrix) |
| This function gives the Jacobi SVD of a given 2x2 matrix, returns U,S; where A=U*S*V. More...
|
|
static void | SingularValueDecomposition2x2Symmetric (const MatrixType &InputMatrix, MatrixType &UMatrix, MatrixType &SMatrix, MatrixType &VMatrix) |
|
static void | Jacobi (MatrixType &J1, MatrixType &J2, const MatrixType &InputMatrix, const SizeType &Size1, const SizeType &Size2, const SizeType &Index1, const SizeType &Index2) |
| This method computes the Jacobi rotation operation. More...
|
|
static void | Jacobi (MatrixType &J1, const MatrixType &InputMatrix, const SizeType &Size1, const SizeType &Index1, const SizeType &Index2) |
| This method computes the Jacobi rotation operation. More...
|
|
static TDataType | SVDConditionNumber (const MatrixType &InputMatrix, const std::string TypeSVD="Jacobi", const TDataType Tolerance=std::numeric_limits< double >::epsilon(), const IndexType MaxIter=200) |
| This method computes the condition number using the SVD. More...
|
|
template<class TDataType>
class Kratos::SVDUtils< TDataType >
Various mathematical utilities to compute SVD and the condition number of a matrix.
Defines several utility functions
- Author
- Vicente Mataix Ferrandiz
template<class TDataType >
This function gives the Jacobi SVD of a given mxn matrix (m>=n), returns U,S; where A=U*S*V.
U and V are unitary, and S is a diagonal matrix. Where s_i >= 0, and s_i >= s_i+1 (which means that the biggest number is the first one and the smallest the last one)
- Todo:
- This version is quite innefficient, look for a real and mathematical implementation (not the algorithm found in Wikipedia!!)
- Parameters
-
InputMatrix | The matrix where perform the SVD |
UMatrix | The unitary U matrix |
SMatrix | The diagonal S matrix |
VMatrix | The unitary V matrix |
Tolerance | The tolerance considered |
MaxIter | Maximum number of iterations |
- Returns
- iter: The number of iterations
template<class TDataType >
This function gives the SVD of a given mxn matrix (m>=n), returns U,S; where A=U*S*V.
U and V are unitary, and S is a diagonal matrix. Where s_i >= 0, and s_i >= s_i+1 (which means that the biggest number is the first one and the smallest the last one)
- Todo:
- This version is quite innefficient, look for a real and mathematical implementation (not the algorithm found in Wikipedia!!)
- Parameters
-
InputMatrix | The matrix where perform the SVD |
UMatrix | The unitary U matrix |
SMatrix | The diagonal S matrix |
VMatrix | The unitary V matrix |
TypeSVD | The type of SVD algorithm (Jacobi by default) |
Tolerance | The tolerance considered |
MaxIter | Maximum number of iterations |
- Returns
- iter: The number of iterations
template<class TDataType >
This function gives the SVD of a given mxn matrix (m>=n), returns U,S; where A=U*S*V.
U and V are unitary, and S is a diagonal matrix. Where s_i >= 0, and s_i >= s_i+1 (which means that the biggest number is the first one and the smallest the last one)
- Todo:
- This version is quite innefficient, look for a real and mathematical implementation (not the algorithm found in Wikipedia!!)
- Parameters
-
InputMatrix | The matrix where perform the SVD |
UMatrix | The unitary U matrix |
SMatrix | The diagonal S matrix |
VMatrix | The unitary V matrix |
ThisParameters | The configuration parameters |
- Returns
- iter: The number of iterations