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: matrix(ZZ,m).hermite_form(algorithm=’padic’, include_zero_rows=False)<br />

[ 1 0 2 0 13 5 1 166 72 69]<br />

[ 0 1 1 0 20 4 15 195 65 190]<br />

[ 0 0 4 0 24 5 23 22 51 123]<br />

[ 0 0 0 1 23 7 20 105 60 151]<br />

[ 0 0 0 0 40 4 0 80 36 68]<br />

[ 0 0 0 0 0 10 0 100 190 170]<br />

[ 0 0 0 0 0 0 25 0 100 150]<br />

[ 0 0 0 0 0 0 0 200 0 0]<br />

[ 0 0 0 0 0 0 0 0 200 0]<br />

[ 0 0 0 0 0 0 0 0 0 200]<br />

index_in_saturation(pro<strong>of</strong>=None)<br />

Return the index <strong>of</strong> self in its saturation.<br />

INPUT:<br />

•pro<strong>of</strong> - (default: use pro<strong>of</strong>.linear_algebra()); if False, the determinant calculations are done with<br />

pro<strong>of</strong>=False.<br />

OUTPUT:<br />

•positive integer - the index <strong>of</strong> the row span <strong>of</strong> this matrix in its saturation<br />

ALGORITHM: Use Hermite normal form twice to find an invertible matrix whose inverse transforms a<br />

matrix with the same row span as self to its saturation, then compute the determinant <strong>of</strong> that matrix.<br />

EXAMPLES:<br />

sage: A = matrix(ZZ, 2,3, [1..6]); A<br />

[1 2 3]<br />

[4 5 6]<br />

sage: A.index_in_saturation()<br />

3<br />

sage: A.saturation()<br />

[1 2 3]<br />

[1 1 1]<br />

insert_row(index, row)<br />

Create a new matrix from self with.<br />

INPUT:<br />

•index - integer<br />

•row - a vector<br />

EXAMPLES:<br />

sage: X = matrix(ZZ,3,range(9)); X<br />

[0 1 2]<br />

[3 4 5]<br />

[6 7 8]<br />

sage: X.insert_row(1, [1,5,-10])<br />

[ 0 1 2]<br />

[ 1 5 -10]<br />

[ 3 4 5]<br />

[ 6 7 8]<br />

sage: X.insert_row(0, [1,5,-10])<br />

[ 1 5 -10]<br />

[ 0 1 2]<br />

[ 3 4 5]<br />

329

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

Saved successfully!

Ooh no, something went wrong!