function perm_ascend_test ( )

%*****************************************************************************80
%
%% perm_ascend_test() tests perm_ascend().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  n = 9;
  p = [ 2,3,9,6,7,8,5,4,1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'perm_ascend_test():\n' );
  fprintf ( 1, '  perm_ascend() determines the length of the longest\n' );
  fprintf ( 1, '  increasing subsequence in a permutation.\n' );

  perm1_print ( n, p, '  The permutation:' );

  [ length, subseq ] = perm_ascend ( n, p );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The longest increasing subsequence has length %d\n', length );

  i4vec_print ( length, subseq, '  A longest increasing subsequence:' );

  return
end
