class_docstr: Solve a linear equation;
  some methods find the exact solution in a finite number of steps
class_docstr_tok: ["Solve","a","linear","equation",";","some","methods","find","the","exact","solution","in","a","finite","number","of","steps"]
code: def _check_autojac(self, A, b):
      def func(x):
          return A.dot(x) - b
  
      def jac(v):
          return A
  
      sol = nonlin.nonlin_solve(
          func,
          np.zeros(b.shape[0]),
          jac,
          maxiter=2,
          f_tol=1e-6,
          line_search=None,
          verbose=0,
      )
      np.testing.assert_allclose(A @ sol, b, atol=1e-6)
      # test jac input as array -- not a function
      sol = nonlin.nonlin_solve(
          func,
          np.zeros(b.shape[0]),
          A,
          maxiter=2,
          f_tol=1e-6,
          line_search=None,
          verbose=0,
      )
      np.testing.assert_allclose(A @ sol, b, atol=1e-6)
  
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 6 for calling the TestLinear obj's underlying member method code with example usage: obj._check_autojac(A, b) and returns: unknown, A