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

[]<br />

sage: m.transpose().parent()<br />

Full MatrixSpace <strong>of</strong> 3 by 0 dense matrices over Real Double Field<br />

zero_at(eps)<br />

Returns a copy <strong>of</strong> the matrix where elements smaller than or equal to eps are replaced with zeroes. For<br />

complex matrices, the real <strong>and</strong> imaginary parts are considered individually.<br />

This is useful for modifying output from algorithms which have large relative errors when producing zero<br />

elements, e.g. to create reliable doctests.<br />

INPUT:<br />

•eps - Cut<strong>of</strong>f value<br />

OUTPUT:<br />

A modified copy <strong>of</strong> the matrix.<br />

EXAMPLES:<br />

sage: a=matrix([[1, 1e-4r, 1+1e-100jr], [1e-8+3j, 0, 1e-58r]])<br />

sage: a<br />

[ 1.0 0.0001 1.0 + 1e-100*I]<br />

[ 1e-08 + 3.0*I 0.0 1e-58]<br />

sage: a.zero_at(1e-50)<br />

[ 1.0 0.0001 1.0]<br />

[1e-08 + 3.0*I 0.0 0.0]<br />

sage: a.zero_at(1e-4)<br />

[ 1.0 0.0 1.0]<br />

[3.0*I 0.0 0.0]<br />

394 Chapter 19. Dense matrices using a NumPy backend.

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

Saved successfully!

Ooh no, something went wrong!