class_docstr: Check that some Jacobian approximations satisfy the secant condition
class_docstr_tok: ["Check","that","some","Jacobian","approximations","satisfy","the","secant","condition"]
docstr: Check that the given Jacobian approximation satisfies secant
  conditions for last `npoints` points.
code: def _check_secant(self, jac_cls, npoints=1, **kw):
      """
      Check that the given Jacobian approximation satisfies secant
      conditions for last `npoints` points.
      """
      jac = jac_cls(**kw)
      jac.setup(self.xs[0], self.fs[0], None)
      for j, (x, f) in enumerate(zip(self.xs[1:], self.fs[1:])):
          jac.update(x, f)
  
          for k in xrange(min(npoints, j + 1)):
              dx = self.xs[j - k + 1] - self.xs[j - k]
              df = self.fs[j - k + 1] - self.fs[j - k]
              assert_(np.allclose(dx, jac.solve(df)))
  
          # Check that the `npoints` secant bound is strict
          if j >= npoints:
              dx = self.xs[j - npoints + 1] - self.xs[j - npoints]
              df = self.fs[j - npoints + 1] - self.fs[j - npoints]
              assert_(not np.allclose(dx, jac.solve(df)))
  
imports: from __future__ import division, print_function, absolute_import
  from numpy.testing import assert_
  import pytest
  from scipy._lib.six import xrange
  from scipy.optimize import nonlin, root
  from numpy import diag, dot
  from numpy.linalg import inv
  import numpy
  from .test_minpack import pressure_network
label_desc: Use image node_id 1 for calling the TestSecant obj's underlying member method code with example usage: obj._check_secant(jac_cls, npoints) without return types