class_docstr: Construct a Sakurai matrix in various formats and its eigenvalues.
  
  Constructs the "Sakurai" matrix motivated by reference [1]_:
  square real symmetric positive definite and 5-diagonal
  with the main digonal ``[5, 6, 6, ..., 6, 6, 5], the ``+1`` and ``-1``
  diagonals filled with ``-4``, and the ``+2`` and ``-2`` diagonals
  made of ``1``. Its eigenvalues are analytically known to be
  ``16. * np.power(np.cos(0.5 * k * np.pi / (n + 1)), 4)``.
  The matrix gets ill-conditioned with its size growing.
  It is useful for testing and benchmarking sparse eigenvalue solvers
  especially those taking advantage of its banded 5-diagonal structure.
  See the notes below for details.
  
  Parameters
  ----------
  n : int
      The size of the matrix.
  dtype : dtype
      Numerical type of the array. Default is ``np.int8``.
  
  Methods
  -------
  toarray()
      Construct a dense array from Laplacian data
  tosparse()
      Construct a sparse array from Laplacian data
  tobanded()
      The Sakurai matrix in the format for banded symmetric matrices,
      i.e., (3, n) ndarray with 3 upper diagonals
      placing the main diagonal at the bottom.
  eigenvalues
      All eigenvalues of the Sakurai matrix ordered ascending.
  
  Notes
  -----
  Reference [1]_ introduces a generalized eigenproblem for the matrix pair
  `A` and `B` where `A` is the identity so we turn it into an eigenproblem
  just for the matrix `B` that this function outputs in various formats
  together with its eigenvalues.
  
  .. versionadded:: 1.12.0
  
  References
  ----------
  .. [1] T. Sakurai, H. Tadano, Y. Inadomi, and U. Nagashima,
     "A moment-based method for large-scale generalized
     eigenvalue problems",
     Appl. Num. Anal. Comp. Math. Vol. 1 No. 2 (2004).
  
  Examples
  --------
  >>> import numpy as np
  >>> from scipy.sparse.linalg._special_sparse_arrays import Sakurai
  >>> from scipy.linalg import eig_banded
  >>> n = 6
  >>> sak = Sakurai(n)
  
  Since all matrix entries are small integers, ``'int8'`` is
  the default dtype for storing matrix representations.
  
  >>> sak.toarray()
  array([[ 5, -4,  1,  0,  0,  0],
         [-4,  6, -4,  1,  0,  0],
         [ 1, -4,  6, -4,  1,  0],
         [ 0,  1, -4,  6, -4,  1],
         [ 0,  0,  1, -4,  6, -4],
         [ 0,  0,  0,  1, -4,  5]], dtype=int8)
  >>> sak.tobanded()
  array([[ 1,  1,  1,  1,  1,  1],
         [-4, -4, -4, -4, -4, -4],
         [ 5,  6,  6,  6,  6,  5]], dtype=int8)
  >>> sak.tosparse()
  <6x6 sparse matrix of type '<class 'numpy.int8'>'
      with 24 stored elements (5 diagonals) in DIAgonal format>
  >>> np.array_equal(sak.dot(np.eye(n)), sak.tosparse().toarray())
  True
  >>> sak.eigenvalues()
  array([0.03922866, 0.56703972, 2.41789479, 5.97822974,
         10.54287655, 14.45473055])
  >>> sak.eigenvalues(2)
  array([0.03922866, 0.56703972])
  
  The banded form can be used in scipy functions for banded matrices, e.g.,
  
  >>> e = eig_banded(sak.tobanded(), eigvals_only=True)
  >>> np.allclose(sak.eigenvalues, e, atol= n * n * n * np.finfo(float).eps)
  True
code: def __init__(self, n, dtype=np.int8):
      self.n = n
      self.dtype = dtype
      shape = (n, n)
      super().__init__(dtype, shape)
  
imports: import numpy
  from scipy.sparse.linalg import LinearOperator
  from scipy.sparse import kron, eye, dia_array
label_desc: Use image node_id 1 to create a new Sakurai object from inherited base classes: LinearOperator with example: obj = Sakurai(n, dtype)