SVD分解
void MatrixSVD()
{
Eigen::MatrixXd A(2, 2);
A << 1.625, 0.6495,
0.6495, 0.875;
Eigen::JacobiSVD<Eigen::MatrixXd> svd(A, Eigen::ComputeThinU | Eigen::ComputeThinV);
Eigen::MatrixXd U = svd.matrixU();
Eigen::MatrixXd S = svd.singularValues();
Eigen::MatrixXd V = svd.matrixV();
std::cout << "U matrix:" << std::endl
<< U << std::endl;
std::cout << "S matrix:" << std::endl
<< S << std::endl;
std::cout << "V matrix:" << std::endl
<< V << std::endl;
Eigen::MatrixXd result = U * U.transpose();
std::cout << "result matrix:" << std::endl
<< result << std::endl;
}