numpy.core.defmatrix
index
/usr/lib/python2.6/dist-packages/numpy/core/defmatrix.py

 
Modules
       
numpy.core.numeric
sys

 
Functions
       
_convert_from_string(data)
_eval(astr)
_from_string(str, gdict, ldict)
matrix_power(M, n)
Raise a square matrix to the (integer) power n.
 
For positive integers n, the power is computed by repeated matrix
squarings and matrix multiplications. If n=0, the identity matrix
of the same type as M is returned. If n<0, the inverse is computed
and raised to the exponent.
 
Parameters
----------
M : array_like
    Must be a square array (that is, of dimension two and with
    equal sizes).
n : integer
    The exponent can be any integer or long integer, positive
    negative or zero.
 
Returns
-------
M to the power n
    The return value is a an array the same shape and size as M;
    if the exponent was positive or zero then the type of the
    elements is the same as those of M. If the exponent was negative
    the elements are floating-point.
 
Raises
------
LinAlgException
    If the matrix is not numerically invertible, an exception is raised.
 
See Also
--------
The matrix() class provides an equivalent function as the exponentiation
operator.
 
Examples
--------
>>> np.linalg.matrix_power(np.array([[0,1],[-1,0]]),10)
array([[-1,  0],
       [ 0, -1]])

 
Data
        __all__ = ['matrix', 'bmat', 'mat', 'asmatrix']
__file__ = '/usr/lib/python2.6/dist-packages/numpy/core/defmatrix.pyc'
__name__ = 'numpy.core.defmatrix'
__package__ = 'numpy.core'
_numchars = '0123456789.-+jeEL'
_table = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./...\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
_todelete = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*,/:;<...\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'