function ival = r8mat_is_diagonally_dominant_row ( m, n, a )

%*****************************************************************************80
%
%% R8MAT_IS_DIAGONALLY_DOMINANT_ROW: is A row diagonally dominant.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 April 2017
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, N, the row and column dimensions of 
%    the matrix.  M and N must be positive.
%
%    real A(M,N), the matrix.
%
%  Output:
%
%    integer IVAL:
%    -1, the matrix is not row diagonally dominant.
%    1, the matrix is row diagonally dominant.
%    2, the matrix is strictly row diagonally dominant.
%
  ival = 2;

  for i = 1 : min ( m, n )

    s = abs ( a(i,i) );
    sumj = 0.0;
    for j = 1 : n
      if ( j ~= i )
        sumj = sumj + abs ( a(i,j) );
      end
    end

    if ( s < sumj )
      ival = -1;
      return
    elseif ( s == sumj )
      ival = 1;
    end

  end

  return
end
