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

•indices - whether or not to return the indices <strong>and</strong> elements <strong>of</strong> this matrix that satisfy the function.<br />

OUTPUT: If indices is not specified, return a matrix with 1 where f is satisfied <strong>and</strong> 0 where it is not.<br />

If indices is specified, return a dictionary containing the elements <strong>of</strong> this matrix satisfying f.<br />

EXAMPLES:<br />

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

sage: M.find(lambda entry:entry==0)<br />

[0 0 0]<br />

[0 0 0]<br />

[0 1 1]<br />

[0 1 0]<br />

sage: M.find(lambda u:u1.2)<br />

[0 0 0]<br />

[0 0 0]<br />

[0 0 0]<br />

[1 0 0]<br />

sage: sorted(M.find(lambda u:u!=0,indices=True).keys()) == M.nonzero_positions()<br />

True<br />

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

gram_schmidt(orthonormal=False)<br />

173

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

Saved successfully!

Ooh no, something went wrong!