class_docstr: Base class for `quadratic_assignment` tests.
class_docstr_tok: ["Base","class","for","`","quadratic_assignment","`","tests","."]
code: def test_accuracy_3(self):
      A, B, opt_perm = chr12c()
  
      # basic minimization
      res = quadratic_assignment(
          A, B, method=self.method, options={"rng": 0}
      )
      assert_(11156 <= res.fun < 21000)
      assert_equal(res.fun, _score(A, B, res.col_ind))
  
      # basic maximization
      res = quadratic_assignment(
          A, B, method=self.method, options={"rng": 0, "maximize": True}
      )
      assert_(74000 <= res.fun < 85000)
      assert_equal(res.fun, _score(A, B, res.col_ind))
  
      # check ofv with strictly partial match
      seed_cost = np.array([4, 8, 10])
      seed = np.asarray([seed_cost, opt_perm[seed_cost]]).T
      res = quadratic_assignment(
          A, B, method=self.method, options={"partial_match": seed}
      )
      assert_(11156 <= res.fun < 21000)
      assert_equal(res.col_ind[seed_cost], opt_perm[seed_cost])
  
      # check performance when partial match is the global optimum
      seed = np.asarray([np.arange(len(A)), opt_perm]).T
      res = quadratic_assignment(
          A, B, method=self.method, options={"partial_match": seed}
      )
      assert_equal(res.col_ind, seed[:, 1].T)
      assert_equal(res.fun, 11156)
      assert_equal(res.nit, 0)
  
      # check performance with zero sized matrix inputs
      empty = np.empty((0, 0))
      res = quadratic_assignment(
          empty, empty, method=self.method, options={"rng": 0}
      )
      assert_equal(res.nit, 0)
      assert_equal(res.fun, 0)
  
imports: import pytest
  import numpy
  from scipy.optimize import quadratic_assignment, OptimizeWarning
  from scipy.optimize._qap import _calc_score
  from numpy.testing import assert_equal, assert_, assert_warns
label_desc: Use image node_id 4 for calling the QAPCommonTests obj's underlying member method code with example usage: obj.test_accuracy_3() without return types