function nwspgr_time_test ( )

%*****************************************************************************80
%
%% nwspgr_time_test() times nwspgr().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 February 2014
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'nwspgr_time_test():\n' );
  fprintf ( 1, '  Compute the time required for nwspgr() to determine \n' );
  fprintf ( 1, '  a sparse grid, based on either:\n' );
  fprintf ( 1, '  one of the built-in 1D rules, or a family of 1D rules\n' );
  fprintf ( 1, '  supplied by the user.\n' );
%
%  CCE
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table, CC Exponential Uncompressed\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'cce', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 11 : 20
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 5
    fprintf ( 1, '  %2d:  ', k );
    for d = 11 : 20
      tic;
      [ x, w ] = nwspgr ( 'cce', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
%
%  CCL
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table for CC Linear Compressed\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'ccl', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 11 : 20
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 5
    fprintf ( 1, '  %2d:  ', k );
    for d = 11 : 20
      tic;
      [ x, w ] = nwspgr ( 'ccl', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
%
%  CCS
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table for CC Slow Compressed\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'ccs', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 11 : 20
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 5
    fprintf ( 1, '  %2d:  ', k );
    for d = 11 : 20
      tic;
      [ x, w ] = nwspgr ( 'ccs', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
%
%  GQN
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table for Gauss-Hermite\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'gqn', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 11 : 20
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 5
    fprintf ( 1, '  %2d:  ', k );
    for d = 11 : 20
      tic;
      [ x, w ] = nwspgr ( 'gqn', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
%
%  GQU
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table for Gauss-Legendre\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'gqu', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 11 : 20
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 5
    fprintf ( 1, '  %2d:  ', k );
    for d = 11 : 20
      tic;
      [ x, w ] = nwspgr ( 'gqu', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
%
%  KPN
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table, KP, (-oo,+oo)\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'kpn', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
%
%  KPU
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Dimension / Level Time table for KP on [0,1]\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 1 : 10
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 6
    fprintf ( 1, '  %2d:  ', k );
    for d = 1 : 10
      tic;
      [ x, w ] = nwspgr ( 'kpu', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, ' Dim:  ' )
  for d = 11 : 20
    fprintf ( 1, '  %8d', d );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, 'Level:\n' );
  for k = 1 : 5
    fprintf ( 1, '  %2d:  ', k );
    for d = 11 : 20
      tic;
      [ x, w ] = nwspgr ( 'kpu', d, k );
      t = toc;
      fprintf ( 1, '  %8f', t );
    end
    fprintf ( 1, '\n' );
  end

  return
end
