Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Sorry, I am new here. I searching full code Gauss Jordan Elimination for NxM matrix.But I couldnt find it. Can you help me? Example matrix 5*9 :

0 -1 -1 0  0 0 0  0 -400 
0  0  0 0  1 0 0  0  50  
0  0  0 0 -1 0 0  0 -50  
0 -1  0 0  0 0 0 -1 -150
0  0 -1 0  0 0 0  1 -250


(C/C++)

What I have tried:

Sorry, I am new here. I searching full code Gauss Jordan Elimination for NxM matrix.But I couldnt find it. Can you help me? Example matrix 5*9 :

0 -1 -1 0  0 0 0  0 -400 
0  0  0 0  1 0 0  0  50  
0  0  0 0 -1 0 0  0 -50  
0 -1  0 0  0 0 0 -1 -150
0  0 -1 0  0 0 0  1 -250


(C/C++)
Posted
Updated 30-Oct-18 15:11pm
Comments
[no name] 29-Oct-18 13:04pm    
Try this: Google[^]

We aren't a "code to order" service: we are more that willing to help people who have problems but when the problem is "I don't want to do it myself" then we aren;t likely to assist much.

As suggested by 0x01AA: Google: Gauss Jordan Elimination[^]
 
Share this answer
 
The oldie goldie Numerical recipes in C[^] book has a section (or two) on this very topic.
The book provides the relevant code.
 
Share this answer
 
I have to disagree with Griff here. Cheating on homework is wrong, but sharing code is the whole point of codeproject. Google is a good start, but if you are looking for source code, there are places to better focus your search. There are sourceforge.net, and github.com of course. Check your Linux distribution and see if what you need is available as a software package. (If you don't run Linux, it's never too late to start.) rosettacode.org has 1000 problems solved in dozens of programming languages. Don't forget wikipedia. Correct source code tends to get deleted from wikipedia pages, so you can check the article history to see if it was in an old edition.
Since this is a numerical problem, there are more specific resources. netlib.org has a collection of code used by scientists that has been grown over 30 years. Of special historic importance is SLATEC, the library developed by the US nuclear weapons labs and placed into the public domain. Also, from the civilian side, look into the Bureau of Standards Core Mathematical Library: ACMD Software Products | NIST[^] .
There are projects right here at codeproject.com in Visual Basic ( High precision native Gaussian Elimination[^]) and in C# ( Linear Equation Solver - Gaussian Elimination (C#)[^]) What you are looking for is available on the web from rosettacode: [Gaussian Elimination - Rosetta Code]. Half of engineering is knowing what's in the catalog.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900