function a = r8ge_identity ( m, n )

%*****************************************************************************80
%
%% r8ge_identity() copies the identity matrix to a R8GE matrix.
%
%  Discussion:
%
%    The R8GE storage format is used for a general M by N matrix.  A storage 
%    space is made for each logical entry.  The two dimensional logical
%    array is mapped to a vector, in which storage is by columns.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 February 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, N, the order of A.
%
%  Output:
%
%    real A(M,N), the identity matrix.
%
  a(1:m,1:n) = 0.0;

  for i = 1 : min ( m, n )
    a(i,i) = 1.0;
  end 

  return
end
