function mult = vector_multiplicity ( a )

%*****************************************************************************80
%
%% vector_multiplicity() computes the multiplicity of a vector.
%
%  Example:
%
%         A        mult
%    -----------   ----
%    ( 7, 7, 7 )     1
%    ( 5, 0, 5 )     3
%    ( 2, 1, 3 )     6
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 November 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer a(d): the vector.
%
%  Output:
%
%    integer mult: the multiplicity of the vector.
%
  d = length ( a );

  z = sort ( a );

  div = 1;
  mult = 1;
  for i = 2 : d
    mult = mult * i;
    if ( z(i) == z(i-1) )
      div = div + 1;
    else
      div = 1;
    end
    mult = mult / div;
  end

  return
end
