class_docstr: IterInv:
     helper class to repeatedly solve M*x=b
     using an iterative method.
code: def __init__(self, M, ifunc=gmres_loose, tol=0):
      self.M = M
      if hasattr(M, "dtype"):
          self.dtype = M.dtype
      else:
          x = np.zeros(M.shape[1])
          self.dtype = (M * x).dtype
      self.shape = M.shape
  
      if tol <= 0:
          # when tol=0, ARPACK uses machine tolerance as calculated
          # by LAPACK's _LAMCH function.  We should match this
          tol = 2 * np.finfo(self.dtype).eps
      self.ifunc = ifunc
      self.tol = tol
  
imports: from __future__ import division, print_function, absolute_import
  from .None import _arpack
  import numpy
  import warnings
  from scipy.sparse.linalg.interface import aslinearoperator, LinearOperator
  from scipy.sparse import eye, issparse, isspmatrix, isspmatrix_csr
  from scipy.linalg import eig, eigh, lu_factor, lu_solve
  from scipy.sparse.sputils import isdense
  from scipy.sparse.linalg import gmres, splu
  from scipy._lib._util import _aligned_zeros
  from scipy._lib._threadsafety import ReentrancyLock
label_desc: Use image node_id 1 to create a new IterInv object from inherited base classes: LinearOperator with example: obj = IterInv(M, ifunc, tol)