scipy.linalg.signm

scipy.linalg.signm(a, disp=1)

Matrix sign function.

Extension of the scalar sign(x) to matrices.

Parameters:

A : array, shape(M,M)

Matrix at which to evaluate the sign function

disp : boolean

Print warning if error in the result is estimated large instead of returning estimated error. (Default: True)

Returns:

sgnA : array, shape(M,M)

Value of the sign function at A

(if disp == False) :

errest : float

1-norm of the estimated error, ||err||_1 / ||A||_1

Examples

>>> from scipy.linalg import signm, eigvals
>>> a = [[1,2,3], [1,2,1], [1,1,1]]
>>> eigvals(a)
array([ 4.12488542+0.j, -0.76155718+0.j,  0.63667176+0.j])
>>> eigvals(signm(a))
array([-1.+0.j,  1.+0.j,  1.+0.j])

Previous topic

scipy.linalg.tanhm

Next topic

scipy.linalg.sqrtm

This Page

Quick search