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

[1||2 3]<br />

[4||5 6]<br />

matrix_from_columns(cols)<br />

Return the matrix constructed from self using columns with indices in the columns list.<br />

EXAMPLES:<br />

sage: M = MatrixSpace(GF(127),3,3,sparse=True)<br />

sage: A = M(range(9)); A<br />

[0 1 2]<br />

[3 4 5]<br />

[6 7 8]<br />

sage: A.matrix_from_columns([2,1])<br />

[2 1]<br />

[5 4]<br />

[8 7]<br />

matrix_from_rows(rows)<br />

Return the matrix constructed from self using rows with indices in the rows list.<br />

p<br />

INPUT:<br />

•rows - list or tuple <strong>of</strong> row indices<br />

EXAMPLE:<br />

sage: M = MatrixSpace(GF(127),3,3,sparse=True)<br />

sage: A = M(range(9)); A<br />

[0 1 2]<br />

[3 4 5]<br />

[6 7 8]<br />

sage: A.matrix_from_rows([2,1])<br />

[6 7 8]<br />

[3 4 5]<br />

rank(gauss=False)<br />

Compute the rank <strong>of</strong> self.<br />

INPUT:<br />

•gauss - if True LinBox’ Gaussian elimination is used. If False ‘Symbolic Reordering’ as implemented<br />

in LinBox is used. If ‘native’ the native <strong>Sage</strong> implementation is used. (default: False)<br />

EXAMPLE:<br />

sage: A = r<strong>and</strong>om_matrix(GF(127),200,200,density=0.01,sparse=True)<br />

sage: r1 = A.rank(gauss=False)<br />

sage: r2 = A.rank(gauss=True)<br />

sage: r3 = A.rank(gauss=’native’)<br />

sage: r1 == r2 == r3<br />

True<br />

sage: r1<br />

155<br />

ALGORITHM: Uses LinBox or native implementation.<br />

REFERENCES:<br />

301

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

Saved successfully!

Ooh no, something went wrong!