コード例 #1
0
def dingdong(n):
    """
    dingdong  dingdong matrix - a symmetric Hankel matrix.
          a = dingdong(n) is the symmetric n-by-n Hankel matrix with
                         a(i,j) = 0.5/(n-i-j+1.5).
          the eigenvalues of a cluster around pi/2 and -pi/2.

          Invented by F.N. Ris.

          Reference:
          J.C. Nash, Compact Numerical Methods for Computers: Linear
          Algebra and Function Minimisation, second edition, Adam Hilger,
          Bristol, 1990 (Appendix 1).
    """
    p = -2 * np.arange(1, n + 1) + (n + 1.5)
    a = cauchy(p)

    return a
コード例 #2
0
ファイル: parter.py プロジェクト: serenidpity/rogues
def parter(n):
    """
    PARTER    Parter matrix - a Toeplitz matrix with singular values near PI.
          PARTER(N) is the matrix with (i,j) element 1/(i-j+0.5).
          It is a Cauchy matrix and a Toeplitz matrix.

          At the Second SIAM Conference on Linear Algebra, Raleigh, N.C.,
          1985, Cleve Moler noted that most of the singular values of
          PARTER(N) are very close to PI.  An explanation of the phenomenon
          was given by Parter; see also the paper by Tyrtyshnikov.

          References:
          The MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2.
          S.V. Parter, On the distribution of the singular values of Toeplitz
               matrices, Linear Algebra and Appl., 80 (1986), pp. 115-130.
          E.E. Tyrtyshnikov, Cauchy-Toeplitz matrices and some applications,
               Linear Algebra and Appl., 149 (1991), pp. 1-18.
    """
    a = cauchy(np.arange(1, n + 1) + 0.5, -np.arange(1, n + 1))

    return a