function floyd_test02 ( )

%*****************************************************************************80
%
%% floyd_test02() applies Floyd's algorithm to matrices of increasing size.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 March 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1,'floyd_test02():\n' );
  fprintf ( 1, '  Test floyd() on matrices of increasing order N.\n' );
  fprintf ( 1, '  The work is roughly N^3.\n' );
  fprintf ( 1, '\n');
  fprintf ( 1, '         N   Time (seconds)  Time/N^3\n' );
  fprintf ( 1, '\n' );

  n = 1;
  while ( n <= 2048 )
    wtime = floyd_test02_sub ( n );
    fprintf ( 1, '  %8d  %12f  %12f\n', n, wtime, 1000000 * wtime / n^3 );
    n = n * 2;
  end

  return
end
function wtime = floyd_test02_sub ( n )

%*****************************************************************************80
%
%% floyd_test02_sub() tests floyd().
%
%  Discussion:
%
%    The matrix size is input by the user.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 March 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the size of the matrix.
%
%  Output:
%
%    real WTIME, the wall clock time required by FLOYD.
%
  A = randi ( [ 1, 2 ], n, n );
  A = A - diag ( diag ( A ) );
  i1 = find ( A == 2 );
  A(i1) = Inf;

  tic;

  B = floyd ( A );

  wtime = toc;

  return
end
