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

class sage.matrix.matrix_rational_dense.Matrix_rational_dense<br />

Bases: sage.matrix.matrix_dense.Matrix_dense<br />

antitranspose()<br />

Returns the antitranspose <strong>of</strong> self, without changing self.<br />

EXAMPLES:<br />

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

sage: type(A)<br />

<br />

sage: A.antitranspose()<br />

[5 2]<br />

[4 1]<br />

[3 0]<br />

sage: A<br />

[0 1 2]<br />

[3 4 5]<br />

sage: A.subdivide(1,2); A<br />

[0 1|2]<br />

[---+-]<br />

[3 4|5]<br />

sage: A.antitranspose()<br />

[5|2]<br />

[-+-]<br />

[4|1]<br />

[3|0]<br />

change_ring(R)<br />

Create the matrix over R with entries the entries <strong>of</strong> self coerced into R.<br />

EXAMPLES:<br />

sage: a = matrix(QQ,2,[1/2,-1,2,3])<br />

sage: a.change_ring(GF(3))<br />

[2 2]<br />

[2 0]<br />

sage: a.change_ring(ZZ)<br />

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

...<br />

TypeError: matrix has denominators so can’t change to ZZ.<br />

sage: b = a.change_ring(QQ[’x’]); b<br />

[1/2 -1]<br />

[ 2 3]<br />

sage: b.parent()<br />

Full MatrixSpace <strong>of</strong> 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational<br />

TESTS:<br />

Make sure that subdivisions are preserved when changing rings:<br />

sage: a = matrix(QQ, 3, range(9))<br />

sage: a.subdivide(2,1); a<br />

[0|1 2]<br />

[3|4 5]<br />

[-+---]<br />

[6|7 8]<br />

sage: a.change_ring(ZZ).change_ring(QQ)<br />

[0|1 2]<br />

[3|4 5]<br />

340 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!