|
std::conditional_t< Type==FULL_SVD, SquareMatrix< T, M, Flags >, Matrix< T, M,(M >N?N:M), Flags > > | U |
|
std::conditional_t< Type==FULL_SVD, Matrix< T, M, N, Flags >, SquareMatrix< T,(M >N?N:M), Flags > > | S |
|
std::conditional_t< Type==FULL_SVD, SquareMatrix< T, N, Flags >, Matrix< T,(M >N?N:M), N, Flags > > | Vh |
|
template<typename T, size_t M, size_t N, unsigned int Flags = 0, SVDType Type = FULL_SVD>
struct Linear::SVD< T, M, N, Flags, Type >
Struct for SVD decomposition.
This struct finds MxM matrix U, MxN matrix S and NxN matrix V such that \(A=USV^*\) where U and V are both unitary, and S is a rectangular diagonal matrix containing the real non-negative singular values of A in decreasing order. If THIN_SVD is passed, then U is MxK, S is KxK, and Vh is KxN where K=min(M,N).
- Parameters
-
T | Type to store matrix entries as. |
M | Number of rows for U and S. Dynamic is allowed for M. |
N | Number of columns for S and Vh. Dynamic is allowed for N. |
Flags | Flags to pass to the matrices (default = row major). |
Type | Either FULL_SVD or THIN_SVD (default = FULL_SVD). |
template<typename T , size_t M, size_t N, unsigned int Flags = 0, SVDType Type = FULL_SVD>
template<size_t P, size_t Q, unsigned int Flags2>
void Linear::SVD< T, M, N, Flags, Type >::Compute |
( |
const Matrix< T, P, Q, Flags2 > & |
A | ) |
|
|
inline |
Computes the SVD decomposition.
If P != M or Q != N, then an exception is thrown. If the matrix is not diagonalizable, an exception will be thrown.
- Parameters
-