Implement matrix inverse by LU decomposition