class_docstr: Check the Broyden methods for a few test problems.
  
  broyden1, broyden2, and newton_krylov must succeed for
  all functions. Some of the others don't -- tests in KNOWN_BAD are skipped.
class_docstr_tok: ["Check","the","Broyden","methods","for","a","few","test","problems",".","broyden1",",","broyden2",",","and","newton_krylov","must","succeed","for","all","functions",".","Some","of","the","others","do","n't","--","tests","in","KNOWN_BAD","are","skipped","."]
code: def _check_root(self, f, method, f_tol=1e-2):
      # Test Krylov methods
      if method == "krylov":
          for jac_method in [
              "gmres",
              "bicgstab",
              "cgs",
              "minres",
              "tfqmr",
          ]:
              if jac_method in f.ROOT_JAC_KSP_BAD:
                  continue
  
              res = root(
                  f,
                  f.xin,
                  method=method,
                  options={
                      "ftol": f_tol,
                      "maxiter": 200,
                      "disp": 0,
                      "jac_options": {"method": jac_method},
                  },
              )
              assert_(np.absolute(res.fun).max() < f_tol)
  
      res = root(
          f,
          f.xin,
          method=method,
          options={"ftol": f_tol, "maxiter": 200, "disp": 0},
      )
      assert_(np.absolute(res.fun).max() < f_tol)
  
imports: from numpy.testing import assert_
  import pytest
  from scipy.optimize import _nonlin, root
  from scipy.sparse import csr_array
  from numpy import diag, dot
  from numpy.linalg import inv
  import numpy
  from .test_minpack import pressure_network
label_desc: Use image node_id 2 for calling the TestNonlin obj's underlying member method code with example usage: obj._check_root(f, method, f_tol) without return types