function pce_legendre_test ( )

%*****************************************************************************80
%
%% pce_legendre_test() tests pce_legendre().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    07 October 2022
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../pce_legendre' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pce_legendre_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test pce_legendre()\n' );

  n = 3;
  p = 2;
  [ nxy, bxy, fxy ] = pce_legendre_linear_assemble ( n, p );
  spy ( bxy );
  filename = 'arrow_n3_p2.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  n = 4;
  p = 1;
  [ nxy, bxy, fxy ] = pce_legendre_linear_assemble ( n, p );
  spy ( bxy );
  filename = 'arrow_n4_p1.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  n = 4;
  p = 2;
  [ nxy, bxy, fxy ] = pce_legendre_linear_assemble ( n, p );
  spy ( bxy );
  filename = 'arrow_n4_p2.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  n = 4;
  p = 3;
  [ nxy, bxy, fxy ] = pce_legendre_linear_assemble ( n, p );
  spy ( bxy );
  filename = 'arrow_n4_p3.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  n = 4;
  p = 4;
  [ nxy, bxy, fxy ] = pce_legendre_linear_assemble ( n, p );
  spy ( bxy );
  filename = 'arrow_n4_p4.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pce_legendre_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../pce_legendre' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

