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 />

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

[1 3 y]<br />

[0 2 x]<br />

sage: E.swapped_columns()<br />

(2, 0, 1)<br />

sage: A.pivots()<br />

(0, 1, 2)<br />

pivots()<br />

Return the pivot column positions <strong>of</strong> this matrix as a list <strong>of</strong> integers.<br />

This returns a list, <strong>of</strong> the position <strong>of</strong> the first nonzero entry in each row <strong>of</strong> the echelon form.<br />

OUTPUT:<br />

A list <strong>of</strong> Python ints.<br />

EXAMPLES:<br />

sage: matrix([PolynomialRing(GF(2), 2, ’x’).gen()]).pivots()<br />

(0,)<br />

sage: K = QQ[’x,y’]<br />

sage: x, y = K.gens()<br />

sage: m = matrix(K, [(-x, 1, y, x - y), (-x*y, y, y^2 - 1, x*y - y^2 + x), (-x*y + x, y - 1,<br />

sage: m.pivots()<br />

(0, 2)<br />

sage: m.rank()<br />

2<br />

swapped_columns()<br />

Return which columns were swapped during the Gauss-Bareiss reduction<br />

OUTPUT:<br />

Return a tuple representing the column swaps during the last application <strong>of</strong> the Gauss-Bareiss algorithm<br />

(see echelon_form() for details).<br />

The tuple as length equal to the rank <strong>of</strong> self <strong>and</strong> the value at the i-th position indicates the source column<br />

which was put as the i-th column.<br />

If no Gauss-Bareiss reduction was performed yet, None is returned.<br />

EXAMPLES:<br />

sage: R. = QQ[]<br />

sage: C = r<strong>and</strong>om_matrix(R, 2, 2, terms=2)<br />

sage: C.swapped_columns()<br />

sage: E = C.echelon_form(’bareiss’)<br />

sage: E.swapped_columns()<br />

(0, 1)<br />

402 Chapter 22. Dense matrices over multivariate polynomials over fields

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

Saved successfully!

Ooh no, something went wrong!