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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<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: M = matrix(5, 5, range(25))<br />

sage: M.subdivide(3,3); M<br />

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

[ 5 6 7| 8 9]<br />

[10 11 12|13 14]<br />

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

[15 16 17|18 19]<br />

[20 21 22|23 24]<br />

sage: M.subdivision_entry(0,0,1,2)<br />

7<br />

sage: M.subdivision(0,0)[1,2]<br />

7<br />

sage: M.subdivision_entry(0,1,0,0)<br />

3<br />

sage: M.subdivision_entry(1,0,0,0)<br />

15<br />

sage: M.subdivision_entry(1,1,1,1)<br />

24<br />

Even though this entry exists in the matrix, the index is invalid for the submatrix.<br />

sage: M.subdivision_entry(0,0,4,0)<br />

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

...<br />

IndexError: Submatrix 0,0 has no entry 4,0<br />

subdivisions()<br />

Returns the current subdivision <strong>of</strong> self.<br />

EXAMPLES:<br />

sage: M = matrix(5, 5, range(25))<br />

sage: M.subdivisions()<br />

([], [])<br />

sage: M.subdivide(2,3)<br />

sage: M.subdivisions()<br />

([2], [3])<br />

sage: N = M.parent()(1)<br />

sage: N.subdivide(M.subdivisions()); N<br />

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

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

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

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

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

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

subs(in_dict=None, **kwds)<br />

EXAMPLES:<br />

sage: var(’a,b,d,e’)<br />

(a, b, d, e)<br />

sage: m = matrix([[a,b], [d,e]])<br />

sage: m.substitute(a=1)<br />

[1 b]<br />

[d e]<br />

sage: m.subs(a=b, b=d)<br />

[b d]<br />

[d e]<br />

259

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

Saved successfully!

Ooh no, something went wrong!