快速的方法来检查,如果一个矩阵是奇异? (不可逆,DET = 0)矩阵、方法来、奇异、快速

由网友(哭到世界为我痛)分享简介:什么是最快的算法(链接到C或C ++的例子是凉)检查一个小方阵(小于16×16元)?是单数(不可逆,DET = 0)What is the fastest algorithm (a link to C or C++ example would be cool) to check if a small square m...

什么是最快的算法(链接到C或C ++的例子是凉)检查一个小方阵(小于16×16元)?是单数(不可逆,DET = 0)

What is the fastest algorithm (a link to C or C++ example would be cool) to check if a small square matrix (<16*16 elements) is singular (non-invertible, det = 0) ?

推荐答案

最好的办法是计算条件数通过SVD并检查是否大于1 /ε,其中,小量的机器precision。

Best way is to compute the condition number via SVD and check if it is greater than 1 / epsilon, where epsilon is the machine precision.

如果您允许假阴性(即一个矩阵是有缺陷的,但是你的算法可能无法检测它),你可以使用MAX(a_ii)/分钟(a_ii)公式从维基百科的文章作为条件数的代理,但你必须先计算QR分解(该公式适用于三角矩阵):A = QR其中R正交,然后COND(A)= COND(Q)。也有技术来计算的Q为O(N)的操作的条件数,但也存在更复杂的

If you allow false negatives (ie. a matrix is defective, but your algorithm may not detect it), you can use the max(a_ii) / min(a_ii) formula from the Wikipedia article as a proxy for the condition number, but you have to compute the QR decomposition first (the formula applies to triangular matrices): A = QR with R orthogonal, then cond(A) = cond(Q). There are also techniques to compute the condition number of Q with O(N) operations, but there are more complex.

阅读全文

相关推荐

最新文章