function arnoldi_test ( )

%*****************************************************************************80
%
%% arnoldi_test() tests arnoldi() on the simple -1,2-1 matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 April 2021
%
%  Author:
%
%    John Burkardt
%
  n = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'arnoldi_test():\n' );
  fprintf ( 1, '  Test arnoldi() on the simple -1,2-1 matrix\n' );
  fprintf ( 1, '  of order N = %d\n', n );

  x0 = zeros ( n, 1 );
  b = zeros ( n, 1 );
  b(n,1) = n + 1;

  k = 5;

  V = arnoldi ( x0, b, @atx_121, k )
%
%  Verify orthogonality.
%
  E = V' * V - eye ( n, n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Norm of V'' * V - I = %g\n', norm ( E ) );
 
  return
end

