Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

manipulating a matrix

manipulating a matrix

manipulating a matrix

Hello, I am trying to build a loop that makes a matrix diagnolly dominant (I'm not sure if thats the right term... I mean where the values on the diagnol are from greatest to least... like this

like if I was given this:

2 3 7 8
9 2 3 4
5 9 0 6
3 8 4 3

I would get this:

9 2 3 4
3 8 4 3
2 3 7 8
5 9 0 6

with 9,8,7,6 making this diagnolly dominant.

I was wondering if anyone has any ideas on the simplest way to go about this...

I'm having a hard time thinking on how to approach this, I'm thinking

1) compare the entire first column
2) take the line with the largest first column value and switch
it with first line
3) lock the first line then compare colum 2 in the following 3 lines
put largest value for column 2 line as second line
4) lock the 2nd line check the third column last two lines
if the 3rd line has the larger value switch those as well....

at this point I'm thinking my algorithm is running into trouble...

any suggestions would be greatly appreciated.

Thank You

RE: manipulating a matrix

Look up partial-pivoting on the net.  What you're looking for is normally the first part of LU decomposition.  The diagonally dominant matrix gives the best results.

RE: manipulating a matrix

What are you actualy trying to achieve?
Is it "just" putting the highest value on the diagonal or the first step in a LU decomposition?
If the latter other things are important too, especially if you are interested in sparse-matrices.

I know something about sparse matrices (related to Equation Oriented flowsheeting).
Some algorithms AND code are available from literature for such matrices

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close