Register to reply

Guass elimination using c++

by Isma
Tags: elimination, guass
Share this thread:
Apr15-06, 12:32 AM
P: 28
i m having serious problem regarding this program...i m not asking u 2 make it for me....just help me with logic cuz i cant get gist of it....plzzz i need help...i ve working on it like 3 hours nd its like my mind has gone blank:(
Phys.Org News Partner Science news on
'Office life' of bacteria may be their weak spot
Lunar explorers will walk at higher speeds than thought
Philips introduces BlueTouch, PulseRelief control for pain relief
Apr15-06, 09:24 AM
P: 534
write out in plain english what it is you need to do. then work out a psudo-code for it. after that it should be easy to get it down in C++.
Apr15-06, 09:41 AM
Sci Advisor
PF Gold
Hurkyl's Avatar
P: 16,091
But not just any old plain english -- it ought to be clear and precise. I like to say that a young kid should be able to follow your directions to get the right answer!

Apr15-06, 01:57 PM
Sci Advisor
-Job-'s Avatar
P: 1,132
Guass elimination using c++

Will you use scaled partial pivoting? You should start by implementing your matrices and basic matrix operations. You can use 2D arrays for your matrices. You'll need basic functions like swapRows(R1, R2) and factorRow(PivotRow, RowToFactor, Multiplier) and printMatrix() for testing.
Then you should create a function that finds the best pivot row, if yu're using Scaled partial pivoting, then you select the row whose first non-zero element is the biggest relative to all the elements in its row.
Finally get down to Gaussian elimination, using the functions you have created.

What technique will you use for solving? Are you going to decompose the matrix into upper and lower triangular matrices?
If you want to solve for X in MX = B where M is a matrix and B is a vector, then you can split M into LU where L is lower triangular and U is upper triangular. Then you'd solve LY=B for Y with forward substitution and finally solve UX=Y for x, with backwards substitution. If you have to do things this way then it's a little more complicated, but you get better performance because your LU matrices are reusable whenever only B changes and M stays the same.

Register to reply

Related Discussions
Guass' law and RC Introductory Physics Homework 0
Guass' law and RC Introductory Physics Homework 4
Dielectrics and guass' law Introductory Physics Homework 1
Guass Rifle General Physics 2
Electostatic(Guass' Law) Classical Physics 12