如何在C ++中快速对矩阵进行对角? [英] How do I diagonalize a matrix quickly in C++?

查看:291
本文介绍了如何在C ++中快速对矩阵进行对角?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道要选择哪个库(对于Windows):LAPACK ++,Armadillo,IT ++,Eigen或者其他什么?

I don't know which library to choose (for windows): LAPACK++, Armadillo, IT++, Eigen, or maybe something else?

是检查大(约10,000×10,000)矩阵是否可对角化,如果是,则获得对角线和可逆矩阵,使得D =(P ^( - 1))* A * P。这必须尽可能快地完成。我不知道要使用哪个库。

All I need to do is to check if a big (about 10,000*10,000) matrix is diagonalizable, and if so, to get the diagonal and the invertible matrix such that D=(P^(-1))*A*P. This has to be done as fast as possible. I have no idea which library to use.

另外,我很高兴知道这些库的优点和缺点。

Also, I'll be happy to know in general what are the pros and cons of each of these libraries.

推荐答案

这可能是一个比较模糊的答案,因为我不知道你遇到了什么确切的问题,但它是你实际上不需要所有这些信息的情况,即你只关注具有最多能量的矩阵特征值;如果你有0.001作为特征值(对角线矩阵)或0.000(非对角线),真的很重要吗?对于许多现实世界(甚至理论)的应用,答案是不真的。

This may be a rather vague answer, since I don't know what exact problem you're up against, but it is very often the case that you don't actually need all that information, i.e. you only care about a matrix' eigenvalues with the most energy; and as for the rest - does it really matter if you have 0.001 as an eigenvalue (diagonalizable matrix) or 0.000 (non-diagonalizable)? For many real-world (and even theoretical) applications, the answer is 'not really'.

所以,我的建议是你获得速度放弃您要查找的信息的准确性粒度

So, my suggestion is that you gain speed by giving up on the accuracy or granularity of the information you're looking for.

这篇关于如何在C ++中快速对矩阵进行对角?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆