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: F = E.augment(B); F<br />

[ 1 2 y y^2]<br />

sage: F.parent()<br />

Full MatrixSpace <strong>of</strong> 1 by 4 dense matrices over Univariate Polynomial Ring in y over Rational<br />

AUTHORS:<br />

•Naqi Jaffery (2006-01-24): examples<br />

•Rob Beezer (2010-12-07): vector argument, docstring, subdivisions<br />

block_sum(other)<br />

Return the block matrix that has self <strong>and</strong> other on the diagonal:<br />

[ self 0 ]<br />

[ 0 other ]<br />

EXAMPLES:<br />

sage: A = matrix(QQ[[’t’]], 2, range(1, 5))<br />

sage: A.block_sum(100*A)<br />

[ 1 2 0 0]<br />

[ 3 4 0 0]<br />

[ 0 0 100 200]<br />

[ 0 0 300 400]<br />

column(i, from_list=False)<br />

Return the i‘th column <strong>of</strong> this matrix as a vector.<br />

This column is a dense vector if <strong>and</strong> only if the matrix is a dense matrix.<br />

INPUT:<br />

•i - integer<br />

•from_list - bool (default: False); if true, returns the i‘th element <strong>of</strong> self.columns() (see<br />

columns()), which may be faster, but requires building a list <strong>of</strong> all columns the first time it is called<br />

after an entry <strong>of</strong> the matrix is changed.<br />

EXAMPLES:<br />

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

[0 1 2]<br />

[3 4 5]<br />

sage: a.column(1)<br />

(1, 4)<br />

If the column is negative, it wraps around, just like with list indexing, e.g., -1 gives the right-most column:<br />

sage: a.column(-1)<br />

(2, 5)<br />

TESTS:<br />

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

[0 1 2]<br />

[3 4 5]<br />

sage: a.column(3)<br />

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

...<br />

IndexError: column index out <strong>of</strong> range<br />

sage: a.column(-4)<br />

100 Chapter 6. Base class for matrices, part 1

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

Saved successfully!

Ooh no, something went wrong!