-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updating gaussian elimination to be more general #219
updating gaussian elimination to be more general #219
Conversation
I want to apologize for not fully grasping your original implementation. I had not realized that the complexity was so different. |
I'm alright with having multiple implementations that switch off depending on the matrix. It should be easy enough to implement and we can highlight the difference in the text. |
I don't even think you need to implement it, you just need to make both functions available and let people decide which method they want. Someone who only wants to solve a system wouldn't be interested in looking at the reduced echelon form anyway. |
Yeah, I just meant that we re-write the code like you suggested and mention the differences in the text. |
God I really wish I had not put text and code in the same PR. Do you want me to do it or you want to PR my branch? |
I will PR your branch (tomorrow, though) |
…ination and back-substitution. Rough edit because I am sure there will be discussion.
Alright, sorry this took so long. I was busy this weekend with other commitments. Here is an attempt to solve the issues and PR's for Gaussian Elimination. I split the chapter to have both Gauss-Jordan elimination and back-substitution, which seemed to be the fairest thing to do. This allows the programmer to choose which method best suits their use-case. I am sure there will be discussion, so this is a "rough" edit. |
This is a good change. I'll get rid of the chapter edits in my PR. |
Sorry, closed it by mistake |
No prob bob. I'll review for typos and update this PR soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those were the only nitpicks I found
@@ -1,43 +1,47 @@ | |||
using DataStructures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed anymore.
|
||
1. All non-zero rows are above rows of all zeros | ||
2. The leading coefficient or _pivot_ (the first non-zero element in every row when reading from left to right) is right of the pivot of the row above it. | ||
|
||
Now, Row Eschelon Form is nice, but wouldn't it be even better if our system of equations looked simply like this | ||
All the following examples are in the Row Echelon Form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The capitalization of [R|r]ow [E|e]echelon is all over the place. After some thoughts, I suggest dropping the capital letter everywhere (since row echelon is not a name, it's like saying diagonal), except maybe when it's first introduced. Same deal for RRE.
Cool, I'll make the changes as soon as I get home tonight! EDIT: Made them now. |
Hey guys, following the discussion in #193 and #201 , we looked at making the Gaussian Elimination code more general. This change does not change the computational complexity of the gaussian_elimination function, but it does for the back-substitution.
In the previous julia version, we were literally plugging the values in for the upper diagonal matrix. In this version, we are actually doing the full Gauss-Jordan elimination and creating a reduced row eschelon matrix. The definition of "back-substitution" can mean either case.
As we mentioned before, the previous code we had submitted was not "wrong"; however, this is technically more general. I am curious to see what you guys think about the back-substitution step. In the worst-case, we can add a condition to switch between the methods if the matrix is not singular (which means that it admits a regular set of solutions). As a note: the solution vector of this method is the last column of the output matrix.
Please let me know what you think about this implementation. We can always change it.