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

5.47068444321<br />

sage: A.norm(1)<br />

6.0<br />

sage: A.norm(Infinity)<br />

8.41421356237<br />

sage: a = matrix([[],[],[],[]])<br />

sage: a.norm()<br />

0.0<br />

sage: a.norm(Infinity) == a.norm(1)<br />

True<br />

nullity()<br />

Return the (left) nullity <strong>of</strong> this matrix, which is the dimension <strong>of</strong> the (left) kernel <strong>of</strong> this matrix acting from<br />

the right on row vectors.<br />

EXAMPLES:<br />

sage: M = Matrix(QQ,[[1,0,0,1],[0,1,1,0],[1,1,1,0]])<br />

sage: M.nullity()<br />

0<br />

sage: M.left_nullity()<br />

0<br />

sage: A = M.transpose()<br />

sage: A.nullity()<br />

1<br />

sage: A.left_nullity()<br />

1<br />

sage: M = M.change_ring(ZZ)<br />

sage: M.nullity()<br />

0<br />

sage: A = M.transpose()<br />

sage: A.nullity()<br />

1<br />

numerical_approx(prec=None, digits=None)<br />

Return a numerical approximation <strong>of</strong> self as either a real or complex number with at least the requested<br />

number <strong>of</strong> bits or digits <strong>of</strong> precision.<br />

INPUT:<br />

•prec - an integer: the number <strong>of</strong> bits <strong>of</strong> precision<br />

•digits - an integer: digits <strong>of</strong> precision<br />

OUTPUT: A matrix coerced to a real or complex field with prec bits <strong>of</strong> precision.<br />

EXAMPLES:<br />

sage: d = matrix([[3, 0],[0,sqrt(2)]]) ;<br />

sage: b = matrix([[1, -1], [2, 2]]) ; e = b * d * b.inverse();e<br />

[ 1/2*sqrt(2) + 3/2 -1/4*sqrt(2) + 3/4]<br />

[ -sqrt(2) + 3 1/2*sqrt(2) + 3/2]<br />

sage: e.numerical_approx(53)<br />

[ 2.20710678118655 0.396446609406726]<br />

[ 1.58578643762690 2.20710678118655]<br />

217

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

Saved successfully!

Ooh no, something went wrong!