📅  最后修改于: 2022-03-11 14:55:08.743000             🧑  作者: Mango
#include
#include
#include
using namespace Eigen;
using std::cout;
int main()
{
MatrixXd C;
C.setRandom(27,18);
JacobiSVD svd( C, ComputeThinU | ComputeThinV);
MatrixXd Cp = svd.matrixU() * svd.singularValues().asDiagonal() * svd.matrixV().transpose();
MatrixXd diff = Cp - C;
cout << "diff:\n" << diff.array().abs().sum() << "\n";
return 0;
}