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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

... [ 0, 0,a^3, 0],<br />

... [a^2 +4 , 0, 0,a + 2]])<br />

sage: A.zigzag_form(subdivide=False)<br />

[ 0 a^3 + 2*a^2 + 2*a + 2 0 0]<br />

[ 1 2*a + 2 0 0]<br />

[ 0 0 a^3 0]<br />

[ 0 0 0 a^2 + 1]<br />

TESTS:<br />

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

sage: A.zigzag_form()<br />

Traceback (most recent call last):<br />

...<br />

TypeError: matrix must be square, not 2 x 3<br />

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

sage: A.zigzag_form()<br />

Traceback (most recent call last):<br />

...<br />

TypeError: matrix entries must come from an exact field, not Ring <strong>of</strong> integers modulo 6<br />

sage: A = matrix(RDF, 2, 2, range(4))<br />

sage: A.zigzag_form()<br />

Traceback (most recent call last):<br />

...<br />

TypeError: matrix entries must come from an exact field, not Real Double Field<br />

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

sage: A.zigzag_form(transformation=’junk’)<br />

Traceback (most recent call last):<br />

...<br />

ValueError: ’transformation’ keyword must be True or False, not junk<br />

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

sage: A.zigzag_form(subdivide=’garbage’)<br />

Traceback (most recent call last):<br />

...<br />

ValueError: ’subdivide’ keyword must be True or False, not garbage<br />

Citations<br />

AUTHOR:<br />

•Rob Beezer (2011-06-09)<br />

sage.matrix.matrix2.cmp_pivots(x, y)<br />

Compare two sequences <strong>of</strong> pivot columns.<br />

•If x is shorter than y, return -1, i.e., x < y, “not as good”.<br />

•If x is longer than y, x > y, “better”.<br />

•If the length is the same then x is better, i.e., x > y if the entries <strong>of</strong> x are correspondingly >= those <strong>of</strong> y<br />

with one being greater.<br />

sage.matrix.matrix2.decomp_seq(v)<br />

This function is used internally be the decomposition matrix method. It takes a list <strong>of</strong> tuples <strong>and</strong> produces a<br />

sequence that is correctly sorted <strong>and</strong> prints with carriage returns.<br />

268 Chapter 7. Base class for matrices, part 2

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

Saved successfully!

Ooh no, something went wrong!