'Return the inverse of a matrix.
CASE 1: If the matrix is a dense matrix.
Return the matrix inverse using the method indicated (default
is Gauss elimination).
Parameters
method : (\'GE\', \'LU\', or \'ADJ\')
Notes
According to the ``method`` keyword, it calls the appropriate method:
GE .... inverse_GE(); default
LU .... inverse_LU()
ADJ ... inverse_ADJ()
See Also
inverse_LU
inverse_GE
inverse_ADJ
Raises
ValueError
If the determinant of the matrix is zero.
CASE 2: If the matrix is a sparse matrix.
Return the matrix inverse using Cholesky or LDL (default).
kwargs
method : (\'CH\', \'LDL\')
Notes
According to the ``method`` keyword, it calls the appropriate method:
LDL ... inverse_LDL(); default
CH .... inverse_CH()
Raises
ValueError
If the determinant of the matrix is zero.'

def inv(self, method=None, **kwargs):

    if (not self.is_square):
        raise NonSquareMatrixError()
    if (method is not None):
        kwargs['method'] = method
    return self._eval_inverse(**kwargs)
