Is there a simple way to rearrange a matrix into a diagonally dominant form?

I have a matrix and I need to make sure that it is diagonally dominant, I need to do this by ONLY pivoting rows.
I can find codes to test for dominance in that they will check to make sure that the value in the diagonal is greater than the sum of the row, but I cant find anything on how make matlab recognize that it needs to pivot if the diagonal is not greater than the sum of the row

Answers (2)

If I've understood your question
a=[1 2 3;4 5 6;7 8 9]
diag_som=trace(a)
mat_som=sum(a,2)
test=any(mat_som>diag_som) % If test=1 then a is diagonally dominant
diag_som=trace(a) mat_som=sum(a,2)-diag(a) test=any(mat_som>=diag_som)

Categories

Asked:

on 24 Jan 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!