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

EXAMPLES:<br />

sage: matrix(QQ,2,[1/5,-2/3,3/4,4/9]).row(1)<br />

(3/4, 4/9)<br />

sage: matrix(QQ,2,[1/5,-2/3,3/4,4/9]).row(1,from_list=True)<br />

(3/4, 4/9)<br />

sage: matrix(QQ,2,[1/5,-2/3,3/4,4/9]).row(-2)<br />

(1/5, -2/3)<br />

set_row_to_multiple_<strong>of</strong>_row(i, j, s)<br />

Set row i equal to s times row j.<br />

EXAMPLES:<br />

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

[0 1 2]<br />

[3 4 5]<br />

sage: a.set_row_to_multiple_<strong>of</strong>_row(1,0,-3)<br />

sage: a<br />

[ 0 1 2]<br />

[ 0 -3 -6]<br />

transpose()<br />

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

EXAMPLES:<br />

We create a matrix, compute its transpose, <strong>and</strong> note that the original matrix is not changed.<br />

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

sage: type(A)<br />

<br />

sage: B = A.transpose()<br />

sage: print B<br />

[0 3]<br />

[1 4]<br />

[2 5]<br />

sage: print A<br />

[0 1 2]<br />

[3 4 5]<br />

.T is a convenient shortcut for the transpose:<br />

sage: print A.T<br />

[0 3]<br />

[1 4]<br />

[2 5]<br />

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

[0|1 2]<br />

[3|4 5]<br />

sage: A.transpose()<br />

[0 3]<br />

[---]<br />

[1 4]<br />

[2 5]<br />

347

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

Saved successfully!

Ooh no, something went wrong!