[問題] 用C++寫svd
小弟目前要用C++寫一個奇異值分解的程式
所以在網路上找了這個資料
The singular value decomposition of an m x n Matrix A (where m >= n) is a
decomposition
A = U * D * V.t()
where U is m x n with U.t() * U equalling the identity, D is an n x n
DiagonalMatrix and V is an n x n orthogonal matrix (type Matrix in Newmat).
Singular value decompositions are useful for understanding the structure of
ill-conditioned matrices, solving least squares problems, and for finding the
eigenvalues of A.t() * A.
To calculate the singular value decomposition of A (with m >= n) use one of
SVD(A, D, U, V); // U = A is OK
SVD(A, D);
SVD(A, D, U); // U = A is OK
SVD(A, D, U, false); // U (can = A) for workspace only
SVD(A, D, U, V, false); // U (can = A) for workspace only
小弟不懂的是U,D,V都是未知的 為什麼一定要有D
不是因該只有SVD(A)嗎? 還請各位高手賜教 謝謝^^
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.124.201.58
→
05/16 17:40, , 1F
05/16 17:40, 1F
→
05/16 17:40, , 2F
05/16 17:40, 2F
→
05/16 18:20, , 3F
05/16 18:20, 3F
→
05/16 18:44, , 4F
05/16 18:44, 4F