|
template<typename T , int N> |
FMatrix< T, N, N > | Imagine::cholesky (const FMatrix< T, N, N > &A, bool low=true) |
| Cholesky decomposition. More...
|
|
template<typename T , int N> |
T | Imagine::detFMatrix (const FMatrix< T, N, N > &A) |
| Determinant. More...
|
|
template<typename T > |
Matrix< T > | Imagine::Diagonal (const Vector< T > &d) |
| Diagonal. More...
|
|
template<typename T > |
void | Imagine::eigenvalues (const Matrix< T > &A, Vector< T > &wr, Vector< T > &wi) |
| Eigenvalues calculation Given square matrix, only eigenvalues are obtained. More...
|
|
template<typename T , int N> |
FMatrix< T, N, N > | Imagine::inverseFMatrix (const FMatrix< T, N, N > &A) |
| Inverse. More...
|
|
template<typename T , int M, int N> |
FVector< T, N > | Imagine::linSolve (const FMatrix< T, M, N > &A, const FVector< T, M > &b) |
| Linear system. More...
|
|
template<typename T > |
Matrix< T > | Imagine::outerProduct (const Vector< T > &v1, const Vector< T > &v2) |
| Outer product matrix. More...
|
|
template<typename T , int M, int N> |
FMatrix< T, N, M > | Imagine::pseudoInverse (const FMatrix< T, M, N > &A, T tolrel=0) |
| Pseudo inverse. More...
|
|
template<typename T , int M, int N> |
bool | Imagine::QR (const FMatrix< T, M, N > &A, FMatrix< T, M, N > &Q, FMatrix< T, N, N > &R) |
| QR decomposition. More...
|
|
template<typename T , int M, int N> |
bool | Imagine::QRAll (const FMatrix< T, M, N > &A, FMatrix< T, M, M > &Q, FMatrix< T, M, N > &R) |
| QR decomposition. More...
|
|
template<typename T , int M, int N> |
void | Imagine::svd (const FMatrix< T, M, N > &A, FMatrix< T, M, M > &U, FVector< T, M > &S, FMatrix< T, N, N > &Vt, bool all=false) |
| SVD. More...
|
|
template<typename T , int M, int N>
void Imagine::svd |
( |
const FMatrix< T, M, N > & |
A, |
|
|
FMatrix< T, M, M > & |
U, |
|
|
FVector< T, M > & |
S, |
|
|
FMatrix< T, N, N > & |
Vt, |
|
|
bool |
all = false |
|
) |
| |
Singular value decomposition. A is MxN. S is of size M with decreasing singular values (only min(M,N) first coefficients are filled). A=U*diag(S)*Vt where U (resp. Vt) is MxM (resp NxN) orthonormal, diag(S) is MxN with S as diagonal. If M<N (resp. M>N) then Vt (resp. U) is incompletely filled, except if all is true.
- Parameters
-
A | matrix |
U,S,Vt | SVD output |
all | completely fill U and V, even columns multiplied by zero |
FVector<T,3> S;
FMatrix<T,3,3> U, Vt;
cout << "SVD check 1: "
FMatrix<T,4,4> Vt2;
FMatrix<T,3,4> S2(T(0));
for(int i=0; i < 3; i++)
S2(i,i) = S[i];
cout << "SVD check 2: "
<< norm(A-U*S2*Vt2) << endl;
cout << "SVD check 3: "
See equivalent function for
Matrix.
- Examples:
- LinAlg/test/test.cpp.