function s = r8vec_pair_sums ( a, b )

%*****************************************************************************80
%
%% r8vec_pair_sums finds all sums formed by a pair of vectors.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 March 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A(na), B(nb): two vectors.
%
%  Output:
%
%    real S(na*nb): all sums of an entry of A and an entry of B.
%
  na = length ( a );
  nb = length ( b );
  ns = na * nb;

  [ amat, bmat ] = meshgrid ( a, b );
  smat = amat + bmat;
  s = reshape ( smat, 1, ns );
  s = sort ( s );

  return
end

