function triangle_upper_to_i4_test ( )

%*****************************************************************************80
%
%% triangle_upper_to_i4_test() tests triangle_upper_to_i4().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_upper_to_i4_test():\n' );
  fprintf ( 1, '  triangle_upper_to_i4() converts an upper triangular index\n' );
  fprintf ( 1, '  to a linear one.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   I, J =>  K\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 4
    for j = i : 4
      k = triangle_upper_to_i4 ( i, j );
      fprintf ( 1, '  %4d  %4d    %4d\n', i, j, k );
    end
  end

  return
end
