function ival = r8mat_is_scalar_row ( m, n, a )

%*****************************************************************************80
%
%% R8MAT_IS_SCALAR_ROW checks whether an R8MAT is a scalar along rows.
%
%  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 row scalar.
%    1, the matrix is row scalar.
%
  ival = 1;

  for i = 1 : m
    s = a(i,1);
    for j = 2 : n
      if ( a(i,j) ~= s )
        ival = -1;
      end
    end
  end

  return
end
