code: def test_burkardt_13(self):
      # This is Ward's example #4.
      # This is a version of the Forsythe matrix.
      # The eigenvector problem is badly conditioned.
      # Ward's algorithm has difficulty esimating the accuracy
      # of its results for this problem.
      #
      # Check the construction of one instance of this family of matrices.
      A4_actual = _burkardt_13_power(4, 1)
      A4_desired = [
          [0, 1, 0, 0],
          [0, 0, 1, 0],
          [0, 0, 0, 1],
          [1e-4, 0, 0, 0],
      ]
      assert_allclose(A4_actual, A4_desired)
      # Check the expm for a few instances.
      for n in (2, 3, 4, 10):
          # Approximate expm using Taylor series.
          # This works well for this matrix family
          # because each matrix in the summation,
          # even before dividing by the factorial,
          # is entrywise positive with max entry 10**(-floor(p/n)*n).
          k = max(1, int(np.ceil(16 / n)))
          desired = np.zeros((n, n), dtype=float)
          for p in range(n * k):
              Ap = _burkardt_13_power(n, p)
              assert_equal(np.min(Ap), 0)
              assert_allclose(
                  np.max(Ap), np.power(10, -np.floor(p / n) * n)
              )
              desired += Ap / factorial(p)
          actual = expm(_burkardt_13_power(n, 1))
          assert_allclose(actual, desired)
  
imports: from __future__ import division, print_function, absolute_import
  import math
  import numpy
  from numpy import array, eye, exp, random
  from numpy.linalg import matrix_power
  from numpy.testing import assert_allclose, assert_, assert_array_almost_equal, assert_equal, assert_array_almost_equal_nulp
  from scipy._lib._numpy_compat import suppress_warnings
  from scipy.sparse import csc_matrix, SparseEfficiencyWarning
  from scipy.sparse.construct import eye
  from scipy.sparse.linalg.matfuncs import expm, _expm, ProductOperator, MatrixPowerOperator, _onenorm_matrix_power_nnm
  from scipy.sparse.sputils import matrix
  from scipy.linalg import logm
  from scipy.special import factorial, binom
  import scipy.sparse
  import scipy.sparse.linalg
label_desc: Use image node_id 26 for calling the TestExpM obj's underlying member method code with example usage: obj.test_burkardt_13() without return types