📜  jacobisvd - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:08.743000             🧑  作者: Mango

代码示例2
#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;
}