function ival = r8mat_is_positive ( m, n, a )

%*****************************************************************************80
%
%% R8MAT_IS_POSITIVE checks whether an R8MAT is a positive matrix.
%
%  Discussion:
%
%    An R8MAT is a matrix of real values.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    09 April 2017
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, N, the row and column dimensions of 
%    the matrix.  M and N must be positive.
%
%    Input, real A(M,N), the matrix.
%
%    Output, integer IVAL:
%    -1, the matrix is not positive.
%    0, the matrix is nonnegative.
%    1, the matrix is positive.
%
  ival = 1;
 
  for i = 1 : m
    for j = 1 : n

      if ( a(i,j) < 0.0 )
        ival = -1;
        return
      elseif ( a(i,j) == 0.0 )
        ival = 0;
      end

    end
  end

  return
end
