function a = antisummation_matrix ( m, n )

%*****************************************************************************80
%
%% antisummation_matrix() returns the ANTISUMMATION matrix.
%
%  Example:
%
%    M = 5, N = 5
%
%    1  0  0  0  0
%   -1  1  0  0  0
%   -1 -1  1  0  0
%   -1 -1 -1  1  0
%   -1 -1 -1 -1  1
%
%  Properties:
%
%    A is generally not symmetric: A' /= A.
%
%    A is lower triangular.
%
%    A is Toeplitz: constant along diagonals.
%
%    A is nonsingular.
%
%    det ( A ) = 1.
%
%    A is the Cholesky factor of the MOLER3 matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 October 2022
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Nick Higham,
%    Seven Sins of Numerical Linear Algebra,
%    https://nhigham.com/2022/10/11/seven-sins-of-numerical-linear-algebra/
%
%  Input:
%
%    integer M: the number of rows.
%
%    integer N: the number of columns;
%
%  Output:
%
%    real A(M,N): the matrix.
%
  a = zeros ( m, n );

  for i = 1 : n
    for j = 1 : n
      if ( j == i )
        a(i,j) = 1.0;
      elseif ( j < i )
        a(i,j) = -1.0;
      else
        a(i,j) = 0.0;
      end
    end
  end

  return
end
