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 test_anderson(self):
      # Anderson is rather similar to Broyden, if given enough storage space
      self._check(nonlin.Anderson(M=50, alpha=1.0), 20, 29, False)
      self._check(nonlin.Anderson(M=50, alpha=1.0), 20, 29, True)
  
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 4 for calling the TestLinear obj's underlying member method code with example usage: obj.test_anderson() without return types