是否具有检查矩阵是否对角线占优(行优势)的功能 [英] Is there a function for checking whether a matrix is diagonally dominant (row dominance)

查看:174
本文介绍了是否具有检查矩阵是否对角线占优(行优势)的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果矩阵在对角线处的值位于对角占优(按行),则按行绝对意义大于该行中所有其他绝对值的总和.列也是如此,反之亦然.

A matrix is diagonally dominant (by rows) if its value at the diagonal is in absolute sense greater then the sum of all other absolute values in that row. Same goes for columns, only the other way around.

在matlab中有一个函数可以对此进行检查吗? (我可以编写一个简单的循环,但是我想退出这些循环).

Is there a function in matlab for chekcing this ? (I could write a simple loop, but I'm trying to quit those).

推荐答案

为什么循环?

您可以轻松地在给定行中形成绝对值的总和.

You can easily form the sum of absolute values in a given row.

sum(abs(A),2)

您可以将其与每一行中的绝对对角线元素进行比较吗?

Can you compare this to the absolute diagonal elements in each row?

abs(diag(A)) >= sum(abs(A),2)

当然,这是不正确的,因为对角线项不应包含在第一和中.无论如何,我们都可以轻松地解决问题.

Of course, this is not correct, since the diagonal terms should not be included in the first sum. Regardless, we can easily repair the problem.

(2*abs(diag(A))) >= sum(abs(A),2)

最后,我们需要此测试的结果.以上测试每一行.如果所有行的检验均正确,则矩阵对角线占主导地位.

Finally, we need a result from this test. The above tests each row. A matrix is diagonally dominant if that test is true for ALL rows.

all((2*abs(diag(A))) >= sum(abs(A),2))

这篇关于是否具有检查矩阵是否对角线占优(行优势)的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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