<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Bareiss_algorithm</id>
	<title>Bareiss algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Bareiss_algorithm"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Bareiss_algorithm&amp;action=history"/>
	<updated>2026-05-04T20:42:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Bareiss_algorithm&amp;diff=6902938&amp;oldid=prev</id>
		<title>imported&gt;D.Lazard: /* History */ Assertion about Montante is dubious and unsourced. Assertion about Edmonds is also dubious. It is possible that Edmonds descibed the algorithm independently of Bareiss, in the same year, but asserting this requires a reliable source.</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Bareiss_algorithm&amp;diff=6902938&amp;oldid=prev"/>
		<updated>2025-03-19T03:24:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;History: &lt;/span&gt; Assertion about Montante is dubious and unsourced. Assertion about Edmonds is also dubious. It is possible that Edmonds descibed the algorithm independently of Bareiss, in the same year, but asserting this requires a reliable source.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Algorithm for determinants of integers}}&lt;br /&gt;
In mathematics, the &amp;#039;&amp;#039;&amp;#039;Bareiss algorithm&amp;#039;&amp;#039;&amp;#039;, named after [[Erwin Bareiss]], is an [[algorithm]] to calculate the [[determinant]] or the [[echelon form]] of a [[Matrix (mathematics)|matrix]] with [[integer]] entries using only integer arithmetic; any [[division (mathematics)|division]]s that are performed are guaranteed to be exact (there is no [[remainder]]). The method can also be used to compute the determinant of matrices with (approximated) [[real number|real]] entries, avoiding the introduction of any round-off errors beyond those already present in the input.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Determinant]] definition has only multiplication, addition and subtraction operations. Obviously the determinant is integer if all matrix entries are integer. However actual computation of the determinant using the definition or [[Leibniz_formula_for_determinants|Leibniz formula]] is impractical, as it requires O(&amp;#039;&amp;#039;n!&amp;#039;&amp;#039;) operations.&lt;br /&gt;
&lt;br /&gt;
[[Gaussian_elimination#Computing_determinants|Gaussian elimination]] has O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;) complexity, but introduces division, which results in round-off errors when implemented using floating point numbers.&lt;br /&gt;
&lt;br /&gt;
[[Round-off_error|Round-off errors]] can be avoided if all the numbers are kept as integer fractions instead of floating point. But then the size of each element grows in size exponentially with the number of rows.&amp;lt;ref&amp;gt;{{citation|last1=Middeke|first1=J.|last2=Jeffrey|first2=D.J.|last3=Koutschan|first3=C.|title=Common Factors in Fraction-Free Matrix Decompositions|journal= Mathematics in Computer Science|year=2020|volume=15|issue=4|pages=589–608|doi=10.1007/s11786-020-00495-9|arxiv=2005.12380|doi-access=free}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bareiss brings up a question of performing an integer-preserving elimination while keeping the magnitudes of the intermediate coefficients reasonably small. Two algorithms are suggested:&amp;lt;ref name=&amp;quot;bareiss&amp;quot;&amp;gt;{{citation|first=Erwin H.|last=Bareiss|title= Sylvester&amp;#039;s Identity and multistep integer-preserving Gaussian elimination|pages=565&amp;amp;ndash;578|url=https://www.ams.org/journals/mcom/1968-22-103/S0025-5718-1968-0226829-0/S0025-5718-1968-0226829-0.pdf|journal=[[Mathematics of Computation]]|year=1968|volume=22|issue=103|doi=10.2307/2004533|jstor=2004533}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{citation|first=Erwin H.|last=Bareiss|title=MULTISTEP INTEGER-PRESERVING GAUSSIAN ELIMINATION|url=https://digital.library.unt.edu/ark:/67531/metadc1035277/m2/1/high_res_d/4474185.pdf|year=1966}}. &amp;#039;&amp;#039;(Contains a clearer picture of the operations sequence)&amp;#039;&amp;#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
# Division-free algorithm — performs matrix reduction to triangular form without any division operation.&lt;br /&gt;
# Fraction-free algorithm — uses division to keep the intermediate entries smaller, but due to the [[Sylvester&amp;#039;s determinant identity | Sylvester&amp;#039;s Identity]] the transformation is still integer-preserving (the division has zero remainder).&lt;br /&gt;
&lt;br /&gt;
For completeness Bareiss also suggests fraction-producing multiplication-free elimination methods.&amp;lt;ref name=&amp;quot;bareiss&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The algorithm==&lt;br /&gt;
The program structure of this algorithm is a simple triple-loop, as in the standard Gaussian elimination. However in this case the matrix is modified so that each {{mvar|M}}&amp;lt;sub&amp;gt;{{mvar|k,k}}&amp;lt;/sub&amp;gt; entry contains the leading principal [[Minor_(linear_algebra)|minor]] [{{mvar|M}}]&amp;lt;sub&amp;gt;{{mvar|k,k}}&amp;lt;/sub&amp;gt;. Algorithm correctness is easily shown by induction on {{mvar|k}}.&amp;lt;ref&amp;gt;{{citation|last=Yap|first=Chee Keng|title=Fundamental Problems of Algorithmic Algebra|publisher=Oxford University Press|year=2000}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{framebox|blue}}&lt;br /&gt;
* Input: {{mvar|M}} — an {{mvar|n}}-square matrix&amp;lt;br/&amp;gt;assuming its leading principal minors [{{mvar|M}}]&amp;lt;sub&amp;gt;{{mvar|k,k}}&amp;lt;/sub&amp;gt; are all non-zero.&lt;br /&gt;
* Let &amp;#039;&amp;#039;M&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0,0&amp;lt;/sub&amp;gt; {{=}} 1 (Note: &amp;#039;&amp;#039;M&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0,0&amp;lt;/sub&amp;gt; is a special variable)&lt;br /&gt;
* For {{mvar|k}} from 1 to {{mvar|n}}&amp;amp;minus;1:&lt;br /&gt;
** For {{mvar|i}} from {{mvar|k}}+1 to {{mvar|n}}:&lt;br /&gt;
*** For {{mvar|j}} from {{mvar|k}}+1 to {{mvar|n}}:&lt;br /&gt;
**** Set &amp;lt;math&amp;gt;M_{i,j} = \frac{M_{i,j} M_{k,k} - M_{i,k} M_{k,j}}{M_{k-1,k-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Set &amp;#039;&amp;#039;M&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;i,k&amp;lt;/sub&amp;gt; {{=}} 0&lt;br /&gt;
* Output: The matrix is modified [[In-place_algorithm|in-place]],&amp;lt;br/&amp;gt;each {{mvar|M}}&amp;lt;sub&amp;gt;{{mvar|k,k}}&amp;lt;/sub&amp;gt; entry contains the leading minor [{{mvar|M}}]&amp;lt;sub&amp;gt;{{mvar|k,k}}&amp;lt;/sub&amp;gt;,&amp;lt;br/&amp;gt;entry {{mvar|M&amp;lt;sub&amp;gt;n,n&amp;lt;/sub&amp;gt;}} contains the determinant of the original {{mvar|M}}.&lt;br /&gt;
{{frame-footer}}&lt;br /&gt;
&lt;br /&gt;
If the assumption about principal minors turns out to be false, e.g. if {{mvar|M}}&amp;lt;sub&amp;gt;{{mvar|k}}&amp;amp;minus;1,{{mvar|k}}&amp;amp;minus;1&amp;lt;/sub&amp;gt; = 0 and some {{mvar|M}}&amp;lt;sub&amp;gt;{{mvar|i}},{{mvar|k}}&amp;amp;minus;1&amp;lt;/sub&amp;gt; ≠ 0 ({{mvar|i}} = {{mvar|k}},...,{{mvar|n}}) then we can exchange the {{mvar|k}}&amp;amp;minus;1-th row with the {{mvar|i}}-th row and change the sign of the final answer.&lt;br /&gt;
&lt;br /&gt;
==Analysis==&lt;br /&gt;
During execution of the Bareiss algorithm, every integer that is computed is the determinant of a submatrix of the input matrix. This allows, using the [[Hadamard inequality]], to bound the size of these integers. Otherwise, the Bareiss algorithm may be viewed as a variant of [[Gaussian elimination]] and needs roughly the same number of arithmetic operations.&lt;br /&gt;
&lt;br /&gt;
It follows that, for an &amp;#039;&amp;#039;n&amp;#039;&amp;#039; × &amp;#039;&amp;#039;n&amp;#039;&amp;#039; matrix of maximum (absolute) value 2&amp;lt;sup&amp;gt;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;&amp;lt;/sup&amp;gt; for each entry, the Bareiss algorithm runs in [[Big O notation|O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)]] elementary operations with an O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;/2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;2&amp;lt;sup&amp;gt;&amp;#039;&amp;#039;nL&amp;#039;&amp;#039;&amp;lt;/sup&amp;gt;) bound on the absolute value of intermediate values needed. Its [[computational complexity]] is thus O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;(log(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)) when using elementary arithmetic or O(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;&amp;amp;nbsp;(log(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;)&amp;amp;nbsp;log(log(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;))) by using [[fast multiplication]].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
{{Numerical linear algebra}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Bareiss Algorithm}}&lt;br /&gt;
[[Category:Determinants]]&lt;br /&gt;
[[Category:Numerical linear algebra]]&lt;br /&gt;
[[Category:Exchange algorithms]]&lt;br /&gt;
[[Category:Computer algebra]]&lt;/div&gt;</summary>
		<author><name>imported&gt;D.Lazard</name></author>
	</entry>
</feed>