15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Examples<br />

>>> from <strong>scipy</strong>.linalg import signm, eigvals<br />

>>> a = [[1,2,3], [1,2,1], [1,1,1]]<br />

>>> eigvals(a)<br />

array([ 4.12488542+0.j, -0.76155718+0.j, 0.63667176+0.j])<br />

>>> eigvals(signm(a))<br />

array([-1.+0.j, 1.+0.j, 1.+0.j])<br />

sqrtm(A, disp=1)<br />

Matrix square root.<br />

Notes<br />

Parameters<br />

A : array, shape(M,M)<br />

Matrix whose square root to evaluate<br />

disp : boolean<br />

SciPy Reference Guide, Release 0.8.dev<br />

Print warning if error in the result is estimated large instead of returning estimated<br />

error. (Default: True)<br />

Returns<br />

sgnA : array, shape(M,M)<br />

Value of the sign function at A<br />

(if disp == False) :<br />

errest : float<br />

Frobenius norm of the estimated error, ||err||_F / ||A||_F<br />

Uses algorithm by Nicholas J. Higham<br />

funm(A, func, disp=1)<br />

Evaluate a matrix function specified by a callable.<br />

Returns the value of matrix-valued function f at A. The function f is an extension of the scalar-valued function<br />

func to matrices.<br />

Parameters<br />

A : array, shape(M,M)<br />

Matrix at which to evaluate the function<br />

func : callable<br />

Callable object that evaluates a scalar function f. Must be vectorized (eg. using<br />

vectorize).<br />

disp : boolean<br />

Print warning if error in the result is estimated large instead of returning estimated<br />

error. (Default: True)<br />

Returns<br />

fA : array, shape(M,M)<br />

Value of the matrix function specified by func evaluated at A<br />

3.7. Linear algebra (<strong>scipy</strong>.linalg) 245

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

Saved successfully!

Ooh no, something went wrong!