function a = creation_matrix ( m, n )

%*****************************************************************************80
%
%% creation_matrix() returns the CREATION matrix.
%
%  Example:
%
%    M = 5, N = 5
%
%    0  0  0  0  0
%    1  0  0  0  0
%    0  2  0  0  0
%    0  0  3  0  0
%    0  0  0  4  0
%
%  Properties:
%
%    A is integral: int ( A ) = A.
%
%    A is strictly lower triangular.
%
%  Square properties:
%
%    A is generally not symmetric: A' /= A.
%
%    A is singular.
%
%    A has the null vector ( 0, 0, ..., 0, 1 ).
%
%    det ( A ) = 0.
%
%    LAMBDA(1:N) = 0
%
%    If 1 < N, A is defective.
%
%    A is not diagonalizable.
%
%    A is zero except for the first lower diagonal. A^2 is zero except for
%    the second lower diagonal.  A^(N-1) is the last nonzero power of A,
%    with a single nonzero entry in the (N,1) position.
%
%    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:
%
%    02 October 2007
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the number of rows of A.
%
%    integer N, the number of columns of A.
%
%  Output:
%
%    real A(M,N), the matrix.
%
  if ( nargin < 2 )
    n = m;
  end

  a = zeros ( m, n );

  for i = 1 : m
    for j = 1 : n
      if ( i == j + 1 )
        a(i,j) = j;
      else
        a(i,j) = 0.0;
      end
    end
  end

  return
end
