def inv(a):
 return (~ a)

def inv ( a ) : return ( ~ a )
compute the inverse of a sparse matrix parameters a : ndarray or sparse matrix square matrix to be inverted returns ainv : ndarray or sparse matrix inverse of a notes this computes the sparse inverse of a .