function quality_test_cvt ( )

%*****************************************************************************80
%
%% quality_test_cvt() calls the QUALITY routines for points in the unit hypercube.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 December 2006
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'quality_test_cvt()\n' );
  fprintf ( 1, '  Test QUALITY on points in the unit hypercube.' );

  ns = 100000;
  input_filename = 'cvt_02_00100.txt';

  [ n, dim_num ] = r8mat_header_read ( input_filename );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The pointset was read from "%s"\n', input_filename );
  fprintf ( 1, '  The sample routine is SAMPLE_HYPERCUBE_UNIFORM.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The spatial dimension DIM_NUM =  %12d\n', dim_num   );
  fprintf ( 1, '  The number of points N =	   %12d\n', n         );
  fprintf ( 1, '  The number of sample points NS = %12d\n', ns        );
  fprintf ( 1, '\n' );

  z = r8mat_data_read ( input_filename, n, dim_num );

  r8mat_print_some ( n, dim_num, z, 1, 1, 5, 5, ...
    '  5x5 portion of data read from file:' );
%
%  For 2 dimensional datasets, some quality measures work from the Delaunay triangulation.
%  Compute that here.
%
  if ( dim_num == 2 )

    triangle_node = delaunay ( z(1:n,1), z(1:n,2) );

    triangle_node = triangle_node';
    triangle_num = size ( triangle_node, 2 );

  else

    triangle_node = [];
    triangle_num = 0;

  end

  if ( dim_num == 2 )
    alpha_measure_test ( n, z, triangle_num, triangle_node );
    area_measure_test ( n, z, triangle_num, triangle_node );
  end
  beta_measure_test ( dim_num, n, z );
  chi_measure_test ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  d_measure_test ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  e_measure_test ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  quality_test04 ( dim_num, n, z );
  quality_test05 ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  quality_test06 ( dim_num, n, z );
  quality_test07 ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  quality_test08 ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  if ( dim_num == 2 )
    quality_test083 ( n, z, triangle_num, triangle_node );
  end
  quality_test085 ( dim_num, n, z );
  quality_test09 ( dim_num, n, z );
  quality_test10 ( dim_num, n, z, ns, 'sample_hypercube_uniform' );
  quality_test11 ( dim_num, n, z );

  return
end
