08.02.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Matrices</strong> <strong>and</strong> <strong>Spaces</strong> <strong>of</strong> <strong>Matrices</strong>, Release 6.1.1<br />

[ 1 0 0 -76/157]<br />

[ 0 1 0 -5/157]<br />

[ 0 0 1 238/157]<br />

[ 0 0 0 0]<br />

sage: a.echelon_form(algorithm=’multimodular’)<br />

[ 1 0 0 -76/157]<br />

[ 0 1 0 -5/157]<br />

[ 0 0 1 238/157]<br />

[ 0 0 0 0]<br />

The result is an immutable matrix, so if you want to modify the result then you need to make a copy. This<br />

checks that Trac #10543 is fixed.<br />

sage: A = matrix(QQ, 2, range(6))<br />

sage: E = A.echelon_form()<br />

sage: E.is_mutable()<br />

False<br />

sage: F = copy(E)<br />

sage: F[0,0] = 50<br />

sage: F<br />

[50 0 -1]<br />

[ 0 1 2]<br />

echelonize(algorithm=’default’, height_guess=None, pro<strong>of</strong>=None, **kwds)<br />

INPUT:<br />

•algorithm<br />

•‘default’ (default): use heuristic choice<br />

•‘padic’: an algorithm based on the IML p-adic solver.<br />

•‘multimodular’: uses a multimodular algorithm the uses linbox modulo many primes.<br />

•‘classical’: just clear each column using Gauss elimination<br />

•height_guess, **kwds - all passed to the multimodular algorithm; ignored by the p-adic algorithm.<br />

•pro<strong>of</strong> - bool or None (default: None, see pro<strong>of</strong>.linear_algebra or sage.structure.pro<strong>of</strong>). Passed to the<br />

multimodular algorithm. Note that the <strong>Sage</strong> global default is pro<strong>of</strong>=True.<br />

OUTPUT:<br />

•matrix - the reduced row echelon for <strong>of</strong> self.<br />

EXAMPLES:<br />

sage: a = matrix(QQ, 4, range(16)); a[0,0] = 1/19; a[0,1] = 1/5; a<br />

[1/19 1/5 2 3]<br />

[ 4 5 6 7]<br />

[ 8 9 10 11]<br />

[ 12 13 14 15]<br />

sage: a.echelonize(); a<br />

[ 1 0 0 -76/157]<br />

[ 0 1 0 -5/157]<br />

[ 0 0 1 238/157]<br />

[ 0 0 0 0]<br />

344 Chapter 18. Dense matrices over the rational field

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!