function perm1_free_test ( )

%*****************************************************************************80
%
%% perm1_free_test() tests perm1_free().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 June 2015
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  p = [ 5, 2, 3, 4, 1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'perm1_free_test():\n' );
  fprintf ( 1, '  perm1_free() returns the unused values in a partial permutation of (1,...,N).\n' );

  for npart = 0 : n
    ipart(1:npart) = p(1:npart);
    nfree = n - npart;
    ifree = perm1_free ( npart, ipart, nfree );
    i4vec_transpose_print ( npart, ipart, '  Partial permutation:' );
    i4vec_transpose_print ( nfree, ifree, '  Values not yet used:' );
  end

  return
end
