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 0 0|0 4 6]<br />

[0 1 0|4 2 2]<br />

[0 0 1|5 2 3]<br />

[-----+-----]<br />

sage: F.is_mutable()<br />

False<br />

sage: G = copy(F)<br />

sage: G.subdivide([],[]); G<br />

[1 0 0 0 4 6]<br />

[0 1 0 4 2 2]<br />

[0 0 1 5 2 3]<br />

If you want to determine exactly which algorithm is used to compute the echelon form, you can add<br />

additional keywords to pass on to the echelon_form() routine employed on the augmented matrix.<br />

Sending the flag include_zero_rows is a bit silly, since the extended echelon form will never have<br />

any zero rows.<br />

sage: A = matrix(ZZ, [[1,2], [5,0], [5,9]])<br />

sage: E = A.extended_echelon_form(algorithm=’padic’, include_zero_rows=False)<br />

sage: E<br />

[ 1 0 36 1 -8]<br />

[ 0 1 5 0 -1]<br />

[ 0 0 45 1 -10]<br />

TESTS:<br />

The subdivide keyword is checked.<br />

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

sage: A.extended_echelon_form(subdivide=’junk’)<br />

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

...<br />

TypeError: subdivide must be True or False, not junk<br />

AUTHOR:<br />

•Rob Beezer (2011-02-02)<br />

fcp(var=’x’)<br />

Return the factorization <strong>of</strong> the characteristic polynomial <strong>of</strong> self.<br />

INPUT:<br />

•var - (default: ‘x’) name <strong>of</strong> variable <strong>of</strong> charpoly<br />

EXAMPLES:<br />

sage: M = MatrixSpace(QQ,3,3)<br />

sage: A = M([1,9,-7,4/5,4,3,6,4,3])<br />

sage: A.fcp()<br />

x^3 - 8*x^2 + 209/5*x - 286<br />

sage: A = M([3, 0, -2, 0, -2, 0, 0, 0, 0])<br />

sage: A.fcp(’T’)<br />

(T - 3) * T * (T + 2)<br />

find(f, indices=False)<br />

Find elements in this matrix satisfying the constraints in the function f. The function is evaluated on each<br />

element <strong>of</strong> the matrix .<br />

INPUT:<br />

•f - a function that is evaluated on each element <strong>of</strong> this matrix.<br />

172 Chapter 7. Base class for matrices, part 2

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

Saved successfully!

Ooh no, something went wrong!