function wishart_unit_sample_test ( )

%*****************************************************************************80
%
%% wishart_unit_sample_test() tests wishart_unit_sample().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 September 2015
%
%  Author:
%
%    John Burkardt
%

%
%  Access the PDFLIB and RNGLIB libraries.
%
  addpath ( '../pdflib' );
  addpath ( '../rnglib' );
%
%  Initialize the RNGLIB library.
%
  initialize ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'wishart_unit_sample_test():\n' );
  fprintf ( 1, '  wishart_unit_sample() samples unit Wishart matrices by:\n' );
  fprintf ( 1, '  W = wishart_unit_sample ( n, df );\n' );
%
%  Set the parameters and call.
%
  n = 5;
  df = 8;
  w = wishart_unit_sample ( n, df );
  r8mat_print ( n, n, w, '  wishart_unit_sample ( 5, 8 ):' );
%
%  Calling again yields a new matrix.
%
  w = wishart_unit_sample ( n, df );
  r8mat_print ( n, n, w, '  wishart_unit_sample ( 5, 8 ):' );
%
%  Reduce DF
%
  n = 5;
  df = 5;
  w = wishart_unit_sample ( n, df );
  r8mat_print ( n, n, w, '  wishart_unit_sample ( 5, 5 ):' );
%
%  Try a smaller matrix.
%
  n = 3;
  df = 5;
  w = wishart_unit_sample ( n, df );
  r8mat_print ( n, n, w, '  wishart_unit_sample ( 3, 5 ):' );
%
%  What is the eigendecomposition of the matrix?
%
  [ v, lambda ] = eig ( w );
  r8mat_print ( n, n, v, '  Eigenvectors of previous matrix:' );
  r8mat_print ( n, n, lambda, '  Eigenvalues of previous matrix:' );

  rmpath ( '../pdflib' );
  rmpath ( '../rnglib' );

  return
end
