|
|
template<int M, int N> |
static FVector< T, N > | solve (FMatrix< T, M, N > A, const FVector< T, M > &b) |
|
template<int M, int N> |
static FVector< T, N > | svbksb (const FMatrix< T, M, N > &U, const FVector< T, N > &W, const FMatrix< T, N, N > &V, const FVector< T, M > &b) |
|
template<int M, int N> |
static void | svdcmp (FMatrix< T, M, N > &A, FVector< T, N > &W, FMatrix< T, N, N > &V) |
|
template<typename T>
class ltl::SVDecomposition< T >
Perform Singular Value Decomposition and solve linear systems. Adapted from Numerical Recipes.
Example:
FVector<double,4> x(2.);
FMatrix<double,4,4> A;
A = 1., 2., 3., 2.,
5., 11., 7., 13.,
9., 7., 5., 1.,
7., 13., 17., 11.;
FVector<double,4> b(
dot(A, x));
x = 0.;
template<typename T >
template<int M, int N>
Given matrix A[m][n], m>=n, using svd decomposition A = U W V' to get U[m][n], W[n][n] and V[n][n], where U occupies the position of A. NOTE: if m<n, A should be filled up to square with zero rows. A[m][n] has been destroyed by U[m][n] after the decomposition.
References ltl::ltl::fabs(), ltl::max(), ltl::min(), ltl::ltl::pow2(), ltl::ltl::sqrt(), and SVD_SIGN.