function [ i, j ] = i4mat_imax ( m, n, a )

%*****************************************************************************80
%
%% I4MAT_IMAX returns the location of the maximum of an I4MAT.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 April 2005
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the number of rows in A.
%
%    integer N, the number of columns in A.
%
%    integer A(M,N), the M by N matrix.
%
%  Output:
%
%    integer I, J, the indices of the maximum entry of A.
%
  i = -1;
  j = -1;

  for jj = 1 : n
    for ii = 1 : m
      if ( ii == 1 && jj == 1 )
        i = ii;
        j = jj;
      elseif ( a(i,j) < a(ii,jj) )
        i = ii;
        j = jj;
      end
    end
  end

  return
end
