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

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

sage: A.with_swapped_rows(-1, 2)<br />

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

...<br />

IndexError: matrix row index out <strong>of</strong> range<br />

sage: A.with_swapped_rows(2, 5)<br />

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

...<br />

IndexError: matrix row index out <strong>of</strong> range<br />

sage.matrix.matrix0.set_max_cols(n)<br />

Sets the global variable max_cols (which is used in deciding how to output a matrix).<br />

EXAMPLES:<br />

sage: from sage.matrix.matrix0 import set_max_cols<br />

sage: set_max_cols(50)<br />

sage.matrix.matrix0.set_max_rows(n)<br />

Sets the global variable max_rows (which is used in deciding how to output a matrix).<br />

EXAMPLES:<br />

sage: from sage.matrix.matrix0 import set_max_rows<br />

sage: set_max_rows(20)<br />

sage.matrix.matrix0.unpickle(cls, parent, immutability, cache, data, version)<br />

Unpickle a matrix. This is only used internally by <strong>Sage</strong>. Users should never call this function directly.<br />

EXAMPLES: We illustrating saving <strong>and</strong> loading several different types <strong>of</strong> matrices.<br />

OVER Z:<br />

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

sage: loads(dumps(A)) # indirect doctest<br />

[0 1]<br />

[2 3]<br />

Sparse OVER Q:<br />

Dense over Q[x, y]:<br />

Dense over finite field.<br />

95

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

Saved successfully!

Ooh no, something went wrong!