function a = parter_matrix ( m, n )

%*****************************************************************************80
%
%% parter_matrix() returns the PARTER matrix.
%
%  Formula:
%
%    A(I,J) = 1 / ( i - j + 0.5 )
%
%  Example:
%
%    N = 5
%
%     2   -2  -2/3 -2/5 -2/7
%    2/3   2   -2  -2/3 -2/5
%    2/5  2/3   2   -2  -2/3
%    2/7  2/5  2/3   2   -2
%    2/9  2/7  2/5  2/3   2
%
%  Properties:
%
%    The diagonal entries are all 2, the first superdiagonals all -2.
%
%    A is Toeplitz: constant along diagonals.
%
%    A is generally not symmetric: A' ~= A.
%
%    A is persymmetric: A(I,J) = A(N+1-J,N+1-I).
%
%    A is a special case of the Cauchy matrix.
%
%    Most of the singular values are very close to Pi.
%
%    The family of matrices is nested as a function of N.
%
%    A is not diagonally dominant.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 October 2007
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Seymour Parter,
%    On the distribution of the singular values of Toeplitz matrices,
%    Linear Algebra and Applications,
%    Volume 80, August 1986, pages 115-130.
%
%    Evgeny Tyrtyshnikov,
%    Cauchy-Toeplitz matrices and some applications,
%    Linear Algebra and Applications,
%    Volume 149, 15 April 1991, pages 1-18.
%
%    Cleve Moler,
%    A matrix for the new HPL-AI Benchmark,
%    https://blogs.mathworks.com/cleve/2019/12/04/a-matrix-for-the-new-hpl-ai-benchmark/
%    04 December 2019.
%
%  Input:
%
%    integer M, N, the order of A.
%
%  Output:
%
%    real A(M,N), the matrix.
%
  a = zeros ( m, n );

  i = 1:m;
  j = (1:n)';
  a = 1.0 ./ ( j - i + 0.5 );

  return
end
