function value = i4vec_lt ( a1, a2 )

%*****************************************************************************80
%
%% i4vec_lt() == ( A1 < A2 ) for i4vec's.
%
%  Discussion:
%
%    The comparison is lexicographic.
%
%    A1 < A2  <=>                              A1(1) < A2(1) or
%                 ( A1(1)     == A2(1)     and A1(2) < A2(2) ) or
%                 ...
%                 ( A1(1:N-1) == A2(1:N-1) and A1(N) < A2(N)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 October 220
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A1(N), A2(N), the vectors to be compared.
%
%  Output:
%
%    logical VALUE, is true if and only if A1 < A2.
%
  n1 = length ( a1 );
  n2 = length ( a2 );

  if ( n1 ~= n2 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'i4vec_lt - Fatal error!\n' );
    fprintf ( 1, '  Vectors must be of the same length.\n' );
    error ( 'i4vec_lt - Fatal error!' );
  end

  value = false;

  for i = 1 : n1

    if ( a1(i) < a2(i) )
      value = true;
      break
    elseif ( a2(i) < a1(i) )
      value = false;
      break
    end

  end

  return
end

