# Checking for diagonal dominance

Discussion in 'C' started by girish3110, Nov 9, 2006.

1. ### girish3110New Member

Joined:
Nov 8, 2006
Messages:
7
0
Trophy Points:
0
Hello!! How do I check for diagonal dominance for a 3*4 matrix using c++??? And also, how can I swap the columns so that the matrix becomes diagonally dominant??

2. ### girish3110New Member

Joined:
Nov 8, 2006
Messages:
7
0
Trophy Points:
0
I will make it simple... Here is a set of equation:
x + y + 54z = 110
27x + 6y - z = 85
6x + 15y + 2z = 72

For the first column,the values 1, 27 and 6 are stored in the array a which is of size 3.
For the second column, the values 1, 6 and 15 are stored in the array b which is of size 3 as well.
For the third column, the values 54, -1 and 2 are stored in an array c of size 3.
For the fourth column,the values 110, 85 and 72 are stored in an array d of size 3.

Can anyone give me a piece of code to rearrange the columns in the following way:

27x + 6y - z = 85
6x + 15y + 2z = 72
x + y + 54z = 110

The aim: The diagonals should be dominant ( 27 , 15 and 54 are greater than the other elements in their column).

Joined:
Jul 12, 2004
Messages:
15,292
365
Trophy Points:
83
Isnt that option just shifting of the array elements depending on MAX value.