Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Gaussian elimination
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Pseudocode == <!--{{Unreferenced section|date=March 2018}}--> As explained above, Gaussian elimination transforms a given {{math|''m'' Γ ''n''}} matrix {{mvar|A}} into a matrix in [[row-echelon form]]. In the following [[pseudocode]], <code>A[i, j]</code> denotes the entry of the matrix {{mvar|A}} in row {{mvar|i}} and column {{mvar|j}} with the indices starting from 1. The transformation is performed ''in place'', meaning that the original matrix is lost for being eventually replaced by its row-echelon form. h := 1 /* ''Initialization of the pivot row'' */ k := 1 /* ''Initialization of the pivot column'' */ '''while''' h β€ m '''and''' k β€ n /* ''Find the k-th pivot:'' */ i_max := [[argmax]] (i = h ... m, abs(A[i, k])) '''if''' A[i_max, k] = 0 /* ''No pivot in this column, pass to next column'' */ k := k + 1 '''else''' '''swap rows'''(h, i_max) /* ''Do for all rows below pivot:'' */ '''for''' i = h + 1 ... m: f := A[i, k] / A[h, k] /* ''Fill with zeros the lower part of pivot column:'' */ A[i, k] := 0 /* ''Do for all remaining elements in current row:'' */ '''for''' j = k + 1 ... n: A[i, j] := A[i, j] - A[h, j] * f /* ''Increase pivot row and column'' */ h := h + 1 k := k + 1 This algorithm differs slightly from the one discussed earlier, by choosing a pivot with largest [[absolute value]]. Such a ''partial pivoting'' may be required if, at the pivot place, the entry of the matrix is zero. In any case, choosing the largest possible absolute value of the pivot improves the [[numerical stability]] of the algorithm, when floating point is used for representing numbers.<ref>{{Cite journal |last1=Kurgalin |first1=Sergei |last2=Borzunov |first2=Sergei |date=2021 |title=Algebra and Geometry with Python |url=https://doi.org/10.1007/978-3-030-61541-3 |journal=SpringerLink |location=Cham |language=en |doi=10.1007/978-3-030-61541-3|isbn=978-3-030-61540-6 }}</ref> Upon completion of this procedure the matrix will be in row echelon form and the corresponding system may be solved by back substitution.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Gaussian elimination
(section)
Add topic