Compute the inverse of a matrix.
Parameters : | a : array-like, shape (M, M)
|
---|---|
Returns : | ainv : array-like, shape (M, M)
Raises LinAlgError if a is singular : |
Examples
>>> a = array([[1., 2.], [3., 4.]])
>>> inv(a)
array([[-2. , 1. ],
[ 1.5, -0.5]])
>>> dot(a, inv(a))
array([[ 1., 0.],
[ 0., 1.]])